And for extra credit, deal with the special case of apostrophes, which

the Java version did not handle!
This commit is contained in:
Simon Brooke 2013-11-08 11:19:30 +00:00
parent 3315eef7b8
commit 08b0514908

View file

@ -58,4 +58,4 @@
file: the path name of a file to read;
depth: the depth of rules/length of window we're considering"
[file depth]
(analyse-tokens nil nil (map (fn [string] (.toLowerCase string)) (re-seq #"\w+|\p{Punct}" (slurp file))) depth))
(analyse-tokens nil nil (map (fn [string] (.toLowerCase string)) (re-seq #"\w+\'s|\w+|\p{Punct}" (slurp file))) depth))