--- a/progs/re2.scala Sat Sep 27 00:37:02 2014 +0100
+++ b/progs/re2.scala Sun Sep 28 18:07:58 2014 +0100
@@ -35,7 +35,7 @@
case c::s => ders(s, der(c, r))
}
-def matcher(r: Rexp, s: String) : Boolean = nullable(ders(s.toList, r))
+def matches(r: Rexp, s: String) : Boolean = nullable(ders(s.toList, r))
//optional: one or zero times
@@ -51,12 +51,12 @@
}
for (i <- 1 to 100) {
- println(i + ": " + "%.5f".format(time_needed(1, matcher(EVIL(i), "a" * i))))
+ println(i + ": " + "%.5f".format(time_needed(1, matches(EVIL(i), "a" * i))))
}
//a bit bolder test
for (i <- 1 to 1000 by 50) {
- println(i + " " + "%.5f".format(time_needed(1, matcher(EVIL(i), "a" * i))))
+ println(i + " " + "%.5f".format(time_needed(1, matches(EVIL(i), "a" * i))))
}