 
 (defn compute-summary [source]
   (let [impact-forest (compute-impact-forest source)
-        analytics (map analyze-tree impact-forest)
+        analytics (pmap analyze-tree impact-forest)
         sizes (map :size analytics)
         pub-times (map :pub-times analytics)
         heights (map :height analytics)

  "Find all tweets that are related to a given tweet by a retweet or reply"
  [tweet]
  (let [tweet-id (:id_str tweet)
        neighbor-tweets (->> (mc/find-maps
                              @db
                              "tweets"
                              {$and [{$or [{"retweeted_status.id_str" tweet-id}
                                           {"in_reply_to_status_id_str" tweet-id}]}
                                     {:created_at {$gt (t/date-time 2014 7 1)}}]}))]
    (Reaction. tweet (vec (doall (pmap spread neighbor-tweets))))))


(defn compute-impact-tree
  "Create the impact tree using clojure zippers"
  [origin]
  (let [article (if (:article origin)
                      (mc/find-map-by-id @db "articles" (:article origin))
                      nil)
        tweet (mc/find-map-by-id @db "tweets" (:tweet origin))]
    (let [related-origins (if article

            [ceres.collector :refer [db custom-formatter news-accounts store]])
 (:import org.bson.types.ObjectId))

(defrecord Source [name articles])
(defrecord Article [source tweet reactions])
(defrecord Reaction [tweet reactions])

(def tokenize (make-tokenizer "data/de-token.bin"))
(def stopwords (read-string "data/stopwords.txt"))

;; --- DATA MINING ---

