-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors prettyprint io io.encodings.ascii
-io.files kernel sequences assocs namespaces regexp ;
+USING: accessors io io.encodings.ascii io.files kernel sequences
+assocs math.parser namespaces regexp ;
IN: benchmark.regex-dna
! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=ruby&id=1
R/ agggtaa[cgt]|[acg]ttaccct/i
} [
[ raw>> write bl ]
- [ count-matches . ]
+ [ count-matches number>string print ]
bi
] with each ;
dup count-patterns
do-replacements
nl
- ilen get .
- clen get .
- length . ;
+ ilen get number>string print
+ clen get number>string print
+ length number>string print ;
: regex-dna-main ( -- )
"resource:extra/benchmark/regex-dna/regex-dna-test-in.txt" regex-dna ;