   "Compute word frequencies in document list restricted to dictionary entries"
   [doc-list]
   (->> doc-list
-       (pmap #(into #{} (split % #" ")))
+       (map #(into #{} (split % #" ")))
        (apply concat)
        frequencies
-       (pmap (fn [[k v]] [k (/ v (count doc-list))]))
+       (map (fn [[k v]] [k (/ v (count doc-list))]))
        (into {})))
 
 

  (let [raw-spam (read-mails spam-dir)
        raw-ham (read-mails non-spam-dir)
        dictionary (->> (concat raw-spam raw-ham)
                        (pmap #(split % #" "))
                        (apply concat)
                        frequencies
                        (remove (fn [[k v]] (< (count k) 2)))


(comment

  (time (->> (train "data/spam-train" "data/nonspam-train")
             (test-mails "data/spam-test")
             (test-mails "data/nonspam-test")
             :done))

  )
