Skip to content

Commit

Permalink
handling boot-stems as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoontz committed Jun 2, 2024
1 parent 8749078 commit f57eef0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 23 deletions.
41 changes: 39 additions & 2 deletions resources/español/lexicon/rules.edn
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
[
{}
]
{:rule :boot-stem?
:if {:cat :verb
:stems {:boot ::unspec}}
:then {:boot-stem? false}}

{:rule :boot-stem
:if {:cat :verb
:boot-stem? true}
:then [{:exceptions [{:infl :present
:agr {:person :1st :number :sing}
:surface #(str (u/get-in % [:stems :boot]) "o")
}
;; TODO: other numbers and persons.
]}]}

{:rule :subcat-1
:if {:cat :verb
:subcat ::unspec}
:then [
;; intransitive
{:subcat {:1 {:cat :noun}
:2 []}}
;; transitive
{:subcat {:1 {:cat :noun}
:2 {:cat :noun}
:3 []}}]}

{:rule :subject-verb-agreement
:if {:cat :verb
:subcat {:1 {:cat :noun}}}
:then [(let [agr (atom :top)]
{:agr agr
:subcat {:1 {:agr agr
:cat :noun
:case :nom
:subcat []}}})]}


]
20 changes: 5 additions & 15 deletions resources/español/lexicon/verbs.edn
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{"querer" (let [exceptions {:boot-stem "quier"
:preterito-stem "quis"
:futuro-stem "querr"}
subcat {:1 {:cat :noun}}]
[{:exceptions exceptions
:subcat subcat
{"querer" (let [stems {:boot "quier"
:preterito "quis"
:futuro "querr"}]
[{:stems stems
:sem {:pred :want}}
{:exceptions exceptions
:subcat subcat
{:stems stems
:sem {:pred :love}}])}







15 changes: 9 additions & 6 deletions resources/español/morphology/verbs.edn
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
[
{:g [#"^(.*)$" "quiero"]
:p [#"^(.*)$" "querer"]
:u {:cat :verb
:canonical "querer"
:agr {:number :sing
:person :1st}}}

;; <present-tense rules>

{:g [#"^(.*)er$" "$1o"]
:p [#"^(.*)o$" "$1er"]
:u {:cat :verb
:infl :present
:agr {:number :sing
:person :1st}}}
;; </present-tense rules>

;; .. other tenses..


{:g [#"^(.*)$" "$1"]
:p [#"^(.*)$" "$1"]
:u {:cat :verb}}
Expand Down

0 comments on commit f57eef0

Please sign in to comment.