    [dag_unify.core :refer [deserialize dissoc-paths
                            fail? fail-path get-in serialize strip-refs]]))
 
-(def lexicon (:lexicon (medium)))
-(def grammar (:grammar-map (medium)))
-
 ;; can't decide between 'morph' or 'fo' or something other better name.
 (defn morph [expr & {:keys [from-language show-notes]
                      :or {from-language nil

  "parse a string in English into zero or more (hopefully more) phrase structure trees"

  ([input]
   (parse (preprocess input) (medium)))

  ([input model]
   (parse/parse (preprocess input) model)))

(defn sentences [ & [count spec model]]
  (let [count (or (Integer. count) 100)
        model (or model (medium))
        spec (or (and spec
                      (unifyc spec {:modified false}))
                 {:modified false


(defn analyze
  ([surface-form]
   (analyze surface-form (:lexicon (grammar/medium))))
  ([surface-form lexicon] ;; use user-provided lexicon
   (morph/analyze surface-form lexicon)))

(defn generate
  [spec & {:keys [max-total-depth model truncate-children]
           :or {max-total-depth generate/max-total-depth
                truncate-children true
                model (grammar/medium)}}]
  (log/debug (str "generating with spec: " (strip-refs spec) " with max-total-depth: " max-total-depth))
  (let [result (engine/generate spec model
                                :max-total-depth max-total-depth
