 (ns babel.espanol.lexicon
   (:refer-clojure :exclude [get-in])
   (:require
+   [clojure.tools.logging :as log]
    [babel.lexiconfn :refer [compile-lex map-function-on-map-vals unify]]
    [babel.espanol.morphology :as morph]
-   [babel.espanol.pos :refer :all :as pos]
-   [dag-unify.core :refer [get-in]]))
+   [babel.espanol.pos :refer :all]
+   [babel.pos :as pos]
+   [dag-unify.core :refer [fail? get-in]]))
 
 (def lexicon-source 
   {"abandonar" {:synsem {:cat :verb

                   :pred :I}
             :subcat '()}}})

;; see TODOs in lexiconfn/compile-lex (should be more of a pipeline as opposed to a argument-position-sensitive function.
(def lexicon
  (future (-> (compile-lex lexicon-source morph/exception-generator morph/phonize)

              ;; make an intransitive version of every verb which has an
              ;; [:sem :obj] path.
              pos/intransitivize
              
              ;; if verb does specify a [:sem :obj], then fill it in with subcat info.
              pos/transitivize
              
              ;; Cleanup functions can go here. Number them for ease of reading.
              ;; 1. this filters out any verbs without an inflection: infinitive verbs should have inflection ':infinitive', 

                                       :pronoun true
                                       :reflexive true
                                       :sem subject-semantics}}}})
   "se"
   [;; feminine singular
    (let [cat (ref :noun)]
      {:synsem {:cat cat
                :pronoun true
                :reflexive true
                :case pos/pronoun-acc
                :agr {:person :3rd
                      :gender :fem
                      :number :sing}
                :sem {:pred :lei}
                :subcat '()}})]

   "tirar" [{:synsem {:cat :verb
                      :sem {:pred :throw-out}}}
            {:synsem {:cat :verb
