 ;; TODO: this is somewhat ugly.
 
 (defn word-triples [word]
-  (set (conj
+  (set (concat
          (map #(apply tuple %)
            (apply concat
              (for [c (map char (range (int \A) (inc (int \Z))))


;; (util/run-and-measure-timing
;;   (clojure.set/intersection
;;     (words-of-length @db 3)
;;     (words-excluding @db \A \E \I \O)
;;     (words-with-letter-position @db \F 0)
;;     (words-with-letter-position @db \U 1)
;;     ))
;;
;;  => {:response #{"FUG" "FUD" "FUN" "FUB" "FUR"},

  (r/fold clojure.set/union clojure.set/union
    (mapv word-triples coll)))


(defn file-triples [filename]
  (r/fold clojure.set/union clojure.set/union
    (mapv word-triples (words-from-file filename))))

;; (util/run-and-measure-timing 
;;   (count (file-triples +default-corpus-file+)))
;;
;;  => {:response         4511728,
;;      :start-time 1401197847802,
