Created
April 17, 2012 10:00
-
-
Save ponzao/2405041 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def dictionary | |
(with-open [rdr (reader "/usr/share/dict/words")] | |
(conj (set (line-seq rdr)) "clojure"))) | |
(defn correctly-spelled? | |
[sentence] | |
(->> (.toLowerCase sentence) | |
(re-seq #"\w+") | |
(every? dictionary))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment