 (ns babel.reader
-  [:refer-clojure :exclude [get-in resolve]]
   [:require
    [babel.config :as config]
    [babel.directory :refer [models]]

                               :results)]
      results))

;; (map #(str (get-in % [:en]) " / " (get-in % [:it]) " | ") (contains {:synsem {:sem {:pred :mangiare :subj {:pred :noi}}}}))

(defn get-meaning [input-map]
  "create a language-independent syntax+semantics that can be translated efficiently. The :cat specification helps speed up generation by avoiding searching syntactic constructs that are different from the desired input."
  (if (seq? input-map)
    (map get-meaning
         input-map)
    {:synsem {:cat (get-in input-map [:synsem :cat] :top)
              :sem (get-in input-map [:synsem :sem] :top)
              :subcat (get-in input-map [:synsem :subcat] :top)}}))

;; TODO: document why we need this
;; TODO: verbcoach should use this, not config/json-read-str

      {:source (:source pairing)
       :targets [(:target pairing)]
       :target-spec target-spec
       :target-roots [(u/get-in target-expression
                              [:root target-root-keyword target-root-keyword])]
       :target-semantics (strip-refs
                          (u/get-in target-expression [:synsem :sem]))})))
    
(defn get-lexeme [canonical language & [ spec ]]
  "get a lexeme from the database given the canonical form, given a
