Skip to content

Instantly share code, notes, and snippets.

@thheller
Created June 8, 2013 09:25
Show Gist options
  • Save thheller/5734642 to your computer and use it in GitHub Desktop.
Save thheller/5734642 to your computer and use it in GitHub Desktop.
(defn filter-file [filename]
(with-open [rdr (io/reader filename)]
(reduce (fn [words line]
(->> (str/split line #"\s+")
(filter #(and (<= (count %) 9)
(>= (count %) 4)))
(set)
(set/union words)))
#{}
(line-seq rdr))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment