                             :failures 0}))
 
 (defn get-classifier
-  "Gets the classifier needed for the specified user/phrase."
+  "Gets the classifier needed for the specified user/phrase. If the classifier
+  is not found in the database then generate one."
   [user-id phrase]
   (if-let [result (mc/find-one-as-map "classifiers"
                                       {:user_id user-id :phrase phrase})]

                       {$set {:random_point [(rand) 0]}}))
    result))

(defn get-training-data
  "Returns cadences to be used to train a classifier as a tuple of bad cadences
  and good cadences."

  "Get the current authenticaion map of the signed in user. This is effectively
  the document from mongodb.

  EXAMPLE:

  {:_id \"4fbe571a593e1633b6dfa6ad\"
   :username \"Johnny\"
   :name \"John Doe\"
   :email \"johnny@example.com\"}"
  [] ((:authentications friend/*identity*) (:current friend/*identity*)))

(defn- get-phrase
  "Randomly as possible get a phrase that matches the given query."
  [query]
  (let [result (mc/find-one-as-map "phrases"
                                   (assoc query
                                          :random_point {"$near" [(rand) 0]})
                                   {:phrase 1})]
    ; Changes the random_point for increased randomlyishness.
    (when (not (nil? result))
