Hi all. Ported my research project to clojure, and now just benchmarking parts of it. I am currently spending about 5/6th of all simulation time doing regular expressions, so I looked into alternative regex engines, optimizing the regular expression and trying to find out whether clojure's (re-pattern also compiles the regex.
This old website lists the performance of several regex engines (the fastest ones are also 'incomplete' compared to the other ones): http://www.tusker.org/regex/regex_benchmark.html , and I am trying to get one of them to run in clojure. As I've no experience with java, I am struggling a bit. (add-classpath "file:///home/boris/projects/chapter4/automaton.jar") (import '(brics.automaton.RegExp)) (import '(brics.automaton.Automaton)) (import '(brics.automaton.RunAutomaton)) The above all loads fine, but the examples on the brics website (http://www.brics.dk/~amoeller/automaton/faq.html ), is quite minimal.. and I tried a few guesses how to call it through clojure [I tried (.. new Regex ("ana")), for example]. Any help with translating the syntax in this example to the clojure version would be appreciated! [java example:] RegExp r = new RegExp("ab(c|d)*"); Automaton a = r.toAutomaton(); String s = "abcccdc"; System.out.println("Match: " + a.run(s)); // prints: true [example of a typical string and regex in the model] "GEDFFEDBGBFEBADACACAFGCBGDDEGGEFDFFFGDCGFGAEAGCFFBCDDCDEBCDAAFDCECCGABCGAAABBBCAFGACAABGFEBDACDFEAAGFGCGDFDGDAAEBFBGBCBDAFDFGFBCFBEABECBBAAEBABGAGFBBAAFFGGBDABFGFAFAEBBBACGEACCEBBCAFDGCADEBGCGFEEEFEADBCGCFBCEFGGGECEGEDCFCCBADBEABCCFGEADDDBEDBBFDBFDCBGDAEFECDEBFGBCBCCBEDEFGGEGCEABAFGECGCACFEGDDAEBAACDBFCGCEAEFEBBABAACFEECFDEAFFGAFEFBDCFCABEEBACBFDCEEAFFBCEDAFFDACEAABBEGFCGDCBFFBBFDDDEEBFCEGCFEFCAAGGEBBGDBCEEGFCFDDFBBFECEGGDBEFBGABFBGEACGAADAFBBDEAGDBADEECAEAAGEGEFEDCABBGFGBEFEFACEBEFFGFCFFFFFFDCB" ((?=([ BD][ ABCDF][ FG][ ABDEF][ ABCDFG][ ABCDEFG][ BCEG][ ABEG] [ BCDEFG])) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---