 
 (defn- parse-tree- [anon]
   (get- anon edu.stanford.nlp.trees.TreeCoreAnnotations$TreeAnnotation))
+
+(defn- coref- [anon]
+  (get- anon ;edu.stanford.nlp.dcoref.CorefCoreAnnotations$CorefChainAnnotation
+        edu.stanford.nlp.hcoref.CorefCoreAnnotations$CorefChainAnnotation))
 
 (defn- children- [graph node] (.getChildren graph node))
 

  See [[with-context]] and [[create-context]]."
  [utterance]
  (log/infof "parsing: <%s>" utterance)
  (let [anon (Annotation. utterance)
        context (atom {})
        pipeline (pipeline)]
    (->> (parse-with-pipeline pipeline context anon)
         anon-map)))

(defn- tokens-equal [a b]
  (and (= (text- a) (text- b))

                         {:child (map #(trav (.getTarget %) %) out-edges)}))))]
      (map #(trav % nil) (.getRoots graph)))))

(defn coref-tree-to-map [anon]
  (->> anon coref- vals       
       (map (fn [chain]
              (let [mentions (.getMentionsInTextualOrder chain)]
                {:id (.getChainID chain)
                 :mention (map (fn [cm]
                                 {:sent-index (-> cm .-sentNum)
                                  :token-range [(.-startIndex cm) (.-endIndex cm)]
                                  :head-index (-> cm .-headIndex)
                                  :gender (-> cm .-gender .toString)
                                  :animacy (-> cm .-animacy .toString)
                                        ;:span (-> cm .-mentionSpan)
                                  :type (-> cm .-mentionType .toString)
                                  :number (-> cm .-number .toString)})
                               mentions)})))
       doall))

(defn- anon-map [anon]
  (log/debugf "tokens: %s" (tokens- anon))
  {:text (text- anon)
   :mentions (map anon-word-map (mentions- anon))
   :coref (coref-tree-to-map anon)
   :sents (map (fn [anon]
                 {:text (text- anon)
                  :sent-index (sent-index- anon)
