Created
June 11, 2013 09:03
-
-
Save ray1729/5755484 to your computer and use it in GitHub Desktop.
Find 4-9 letter words in a file.
This file contains 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
(defn filter-file [filename] | |
(with-open [rdr (io/reader filename)] | |
(reduce (fn [words line] | |
(into words (filter #(<= 4 (count %) 9) (str/split line #"\s+")))) | |
#{} | |
(line-seq rdr)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment