Skip to content

Commit

Permalink
(defn convert)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoontz committed Jun 4, 2024
1 parent 300fdf3 commit b2bdfdb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/menard/español.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[menard.morphology :refer [morph-leaf]]
[menard.serialization :as s]
[dag_unify.core :as u :refer [unify]]
#?(:clj [clojure.java.io :as io :refer [resource]])
[clojure.test :refer [deftest is]]
#?(:clj [clojure.tools.logging :as log])
#?(:cljs [cljslog.core :as log])))
Expand Down Expand Up @@ -41,3 +42,23 @@

:else
(s/morph tree (:morphology @model))))

(defn convert []
(->> (-> "resources/español/lexicon.edn"
slurp
read-string)
(filter (fn [[k v]]
(or true (= :verb (u/get-in v [:synsem :cat])))))
(map (fn [[k v]]
(cond (map? v)
[k (-> {:cat :verb
:sem (u/get-in v [:synsem :sem])}
(merge (if (u/get-in v [:synsem :agr])
{:agr (u/get-in v [:synsem :agr])}
{}))
(merge (if (u/get-in v [:espanol])
{:agr (u/get-in v [:espanol])}
{})))]
:else
[k v])))
(into {})))

0 comments on commit b2bdfdb

Please sign in to comment.