Skip to content

Commit

Permalink
support inherently-plural nouns like "clothes", "pants", etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoontz committed Aug 3, 2024
1 parent b4dec11 commit 38aba65
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions resources/english/lexicon/nouns.edn
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"civilization" [{:sem {:pred :civilization}}]
"civil servant" [{:sem {:pred :civil-servant}}]
"clothes" [{:sem {:pred :clothes}
:inherently-plural? true ;; as with pants, scissors, etc.
:agr {:number :plur}}]
"coat" [{:sem {:pred :coat}}]
"community" [{:sem {:pred :community}}]
Expand Down
6 changes: 6 additions & 0 deletions resources/english/lexicon/rules.edn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
:agr {:human? ::unspec}}
:then [{:agr {:human? false}}]}

;; e.g. "inherently plural" means nouns like "clothes","pants", and "scissors"
{:rule :nouns-are-not-inherently-plural-by-default
:if {:cat :noun
:inherently-plural? ::unspec}
:then [{:inherently-plural? false}]}

{:rule :complementizer
:if {:cat :comp}
:then [(let [sem (atom :top)
Expand Down
22 changes: 16 additions & 6 deletions resources/english/morphology/nouns.edn
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
;;
[{:g [#"^(.*)$" "$1"] ;; no change in inflection for singular form.
:p [#"^(.*)$" "$1"] ;; no change in inflection for singular form.
:u {:cat :noun
:derivation {:runtime-noun-analysis {:morphology-noun-sing true}}
:pronoun? false
:regular true
:regular? true
:agr {:number :sing}}}

{:g [#"^(.*)$" "$1"] ;; no change in inflection for singular form.
:p [#"^(.*)$" "$1"] ;; no change in inflection for singular form.
:u {:cat :noun
:derivation {:runtime-noun-analysis {:morphology-noun-inherently-plural true}}
:inherently-plural? true
:pronoun? false
:regular? true
:agr {:number :plur}}}

{:g [#"^(.*[^aeiou])[y]$" "$1ies"] ;; puppy -> puppies
:p [#"^(.*)ies$" "$1y"]
:u {:cat :noun
:null? false
:pronoun? false
:derivation {:runtime-noun-analysis {:morphology-noun-plur-1 true}}
:agr {:number :plur}
:regular true}}
:regular? true}}

{:g [#"^(.*)fe$" "$1ves"] ;; life -> lives
:p [#"^(.*)ves$" "$1fe"]
Expand All @@ -22,7 +32,7 @@
:derivation {:runtime-noun-analysis {:morphology-noun-plur-2 true}}
:pronoun? false
:agr {:number :plur}
:regular true}}
:regular? true}}

{:g [#"^(.*[cs]h)$" "$1es"] ;; ash -> ashes
:p [#"^(.*[cs]h)es$" "$1"]
Expand All @@ -31,7 +41,7 @@
:derivation {:runtime-noun-analysis {:morphology-noun-plur-3 true}}
:pronoun? false
:agr {:number :plur}
:regular true}}
:regular? true}}

{:g [#"^(.*[sx])$" "$1es"] ;; class -> classes
:p [#"^(.*)es$" "$1"] ;;
Expand All @@ -40,7 +50,7 @@
:pronoun? false
:derivation {:runtime-noun-analysis {:morphology-noun-plur-4 true}}
:agr {:number :plur}
:regular true}}
:regular? true}}

{:g [#"^(.*)$" "$1s"] ;; dog -> dogs
:p [#"^(.*)s$" "$1"] ;; dogs -> dog
Expand All @@ -49,5 +59,5 @@
:derivation {:runtime-noun-analysis {:morphology-noun-plur-5 true}}
:pronoun? false
:agr {:number :plur}
:regular true}}]
:regular? true}}]

0 comments on commit 38aba65

Please sign in to comment.