    [clojure.string :refer (trim)]
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
-   [dag_unify.core :refer (copy dissoc-paths fail? get-in ref? strip-refs unifyc)]))
+   [dag_unify.core :refer (copy dissoc-paths fail? get-in ref? strip-refs unify unifyc)]))
 
 (def replace-patterns
   (concat

                                (get lexicon lex)))))))
           replace-patterns)))

(defn conjugate [infinitive unify-with]
  "Conjugate an infinitive into a surface form by taking the first 
   element of replace-patterns where the element's :u unifies successfully with
   unify-with."
  (let [result
        (take 1
              (remove #(nil? %)
                      (map
                       (fn [replace-pattern]
                         (let [from (nth (:g replace-pattern) 0)
                               to (nth (:g replace-pattern) 1)
                               unify-against (if (:u replace-pattern)
                                               (:u replace-pattern)
                                               :top)]
                            (if (and from to
                                     (re-matches from infinitive)
                                     (not (fail? (unifyc unify-against

                                (log/debug (str "input spec: " (strip-refs unify-with)))
                                (log/debug (str "pattern spec:"  (strip-refs unify-against)))
                                (string/replace infinitive from to)))))
                           replace-patterns))))]
    (if (empty? result)
      (throw (Exception. (str "nothing found to match infinitive: " infinitive " ; "
                              " unify-with: " (strip-refs unify-with) ".")))
      (first result))))

;; TODO: separate part-of-speech -related functionality (e.g. the word is a verb) from
;; compositional functionality (e.g. the word has an :a and :b, so combine by concatenation, etc)
;; 
(defn get-string [word & [b lexicon]]
  (cond (and (nil? b)
             (seq? word))
        (let [result (get-string word)]
