diff --git "a/resources/espa\303\261ol/lexicon/rules.edn" "b/resources/espa\303\261ol/lexicon/rules.edn" index f87c86816..8fe38b15b 100644 --- "a/resources/espa\303\261ol/lexicon/rules.edn" +++ "b/resources/espa\303\261ol/lexicon/rules.edn" @@ -9,8 +9,8 @@ :boot-stem? true} :then [{:exceptions [{:infl :present :agr {:person :1st :number :sing} - :surface #(str (u/get-in % [:stems :boot]) "o") - } + :surface {:prefix [:stems :boot] + :suffix "o"}} ;; TODO: other numbers and persons. ]}]} diff --git a/src/menard/lexiconfn.cljc b/src/menard/lexiconfn.cljc index e9c5eecfd..e1fbb47f1 100644 --- a/src/menard/lexiconfn.cljc +++ b/src/menard/lexiconfn.cljc @@ -44,12 +44,15 @@ (merge consequent {:exceptions (map (fn [exception] (let [surface (:surface exception)] - (cond (fn? surface) - ;; TODO: lock down what can be evaluated - (merge exception - {:surface (surface lexeme)}) - :else - exception))) + (cond + (map? surface) + (merge exception + {:surface (str (u/get-in lexeme (:prefix surface)) + (:suffix surface))}) + (string? surface) + exception + :else + (exception "Cannot find surface form given intermediate surface value: " surface)))) (:exceptions consequent))})] retval) consequent))