Skip to content

Commit

Permalink
improve ergonomics change :X-verb-with & to :X-verb {:with Y}
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoontz committed Aug 2, 2024
1 parent e26c108 commit c6846bd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
36 changes: 18 additions & 18 deletions resources/english/lexicon/rules.edn
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@

{:rule :prepositional-verb-with-none
:if {:cat :verb
:prepositional-verb-with ::unspec}
:then [{:prepositional-verb-with :none
:prepositional-verb ::unspec}
:then [{:prepositional-verb :none
:prepositional-verb? false}]}

{:rule :prepositional-verb-true
:if {:cat :verb
:prepositional-verb? ::unspec}
:then [{:prepositional-verb? true}]}

{:rule :adjectival-verb-with-none
{:rule :adjectival-verb-none
:if {:cat :verb
:adjectival-verb-with ::unspec}
:then [{:adjectival-verb-with :none
:adjectival-verb ::unspec}
:then [{:adjectival-verb :none
:adjectival-verb? false}]}

{:rule :adjectival-verb-true
Expand All @@ -102,8 +102,8 @@

{:rule :nominal-verb-with-none
:if {:cat :verb
:nominal-verb-with ::unspec}
:then [{:nominal-verb-with :none
:nominal-verb ::unspec}
:then [{:nominal-verb {:with :none}
:nominal-verb? false}]}

{:rule :nominal-verb-true
Expand Down Expand Up @@ -466,8 +466,8 @@
:subcat {:2 {:cat :prep}
:3 []}}
:then (let [subj (atom :top)
with-preposition (atom :top)]
[{:prepositional-verb-with with-preposition
preposition (atom :top)]
[{:prepositional-verb {:with preposition}
:reflexive? false
:sem {:obj :none
:iobj :none
Expand All @@ -476,15 +476,15 @@
:2 {:cat :prep
:subcat []
:phrasal? false
:canonical with-preposition}
:canonical {:with preposition}}
:3 []}}
(let [iobj (atom :top)]
{:prepositional-verb-with with-preposition
{:prepositional-verb-with {:with preposition}
:sem {:obj :none
:subj subj
:iobj iobj}
:subcat {:1 {:sem subj}
:2 {:root with-preposition
:2 {:root {:with preposition}
:cat :prep
:subcat []
:sem {:obj iobj}}}})])}
Expand All @@ -493,8 +493,8 @@
:if {:cat :verb
:adjectival-verb? true}
:then (let [subj (atom :top)
with-adjective (atom :top)]
[{:adjectival-verb-with with-adjective
adjective (atom :top)]
[{:adjectival-verb {:with adjective}
:reflexive? false
:sem {:obj :none
:iobj :none
Expand All @@ -503,22 +503,22 @@
:2 {:cat :adjective
:subcat []
:phrasal? false
:canonical with-adjective}
:canonical adjective}
:3 []}}])}

{:rule :nominal-arg-verbs-number ;; "have lunch", not "have lunches"
:if {:cat :verb
:nominal-verb? true}
:then [{:nominal-argument-number :sing}]}
:then [{:nominal-verb {:number :sing}}]}

{:rule :nominal-arg-verbs ;; "have lunch"
:if {:cat :verb
:nominal-verb? true}
:then (let [subj (atom :top)
with-noun (atom :top)
nominal-argument-number (atom :top)]
[{:nominal-verb-with with-noun
:nominal-argument-number nominal-argument-number
[{:nominal-verb {:with with-noun
:number nominal-argument-number}
:reflexive? false
:sem {:obj :none
:iobj :none
Expand Down
38 changes: 19 additions & 19 deletions resources/english/lexicon/verbs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"arrive" [{:intransitive-only? true
:sem {:pred :arrive}}]
"ask" [{:sem {:pred :ask}}
{:prepositional-verb-with "for"
{:prepositional-verb {:with "for"}
:sem {:pred :ask-for}}]
"assure" [{ :sem {:pred :assure}}]
"avoid" [{ :sem {:pred :avoid}}]
Expand Down Expand Up @@ -164,7 +164,7 @@
"cause" [{:sem {:pred :cause}}]
"change" [{:sem {:pred :change}}
{:sem {:pred :change-clothes}
:nominal-verb-with "clothes"}]
:nominal-verb {:with "clothes"}}]
"cheat" [{:sem {:pred :cheat}}]
"clean" [{:sem {:pred :clean}}]
"close" [{:sem {:pred :close}}]
Expand Down Expand Up @@ -338,7 +338,7 @@
:sem {:pred :fall}}
{:exceptions exceptions
:sem {:pred :fall-asleep}
:adjectival-verb-with "asleep"}])
:adjectival-verb {:with "asleep"}}])

"feed" [{:sem {:pred :feed}
:exceptions [{:infl :past-simple
Expand Down Expand Up @@ -370,13 +370,13 @@
:sem {:pred :get}}
{:exceptions exceptions
:sem {:pred :get-angry}
:adjectival-verb-with "angry"}
:adjectival-verb {:with "angry"}}
{:exceptions exceptions
:sem {:pred :get-married}
:adjectival-verb-with "married"}
:adjectival-verb {:with "married"}}
{:exceptions exceptions
:sem {:pred :get-up}
:prepositional-verb-with "up"}])
:prepositional-verb {:with "up"}}])

"give" (let [exceptions [{:infl :past-simple :surface "gave"}
{:infl :past-participle :surface "given"}]]
Expand All @@ -401,7 +401,7 @@
:3 []}}

{:exceptions exceptions
:prepositional-verb-with "out"
:prepositional-verb {:with "out"}
:sem {:pred :go-out}}])

"guess" [{:sem {:pred :guess}}]
Expand Down Expand Up @@ -460,21 +460,21 @@
{:sense 4
:aux? false
:reflexive? false
:nominal-verb-with "dinner"
:nominal-verb {:with "dinner"}
:sem {:pred :have-dinner}
:exceptions non-aux-exceptions}

{:sense 5
:aux? false
:reflexive? false
:nominal-verb-with "fun"
:nominal-verb {:with "fun"}
:sem {:pred :have-fun}
:exceptions non-aux-exceptions}

{:sense 6
:aux? false
:reflexive? false
:nominal-verb-with "lunch"
:nominal-verb {:with "lunch"}
:sem {:pred :have-lunch}
:exceptions non-aux-exceptions}])

Expand Down Expand Up @@ -542,16 +542,16 @@
:mental-state? true}}]
"linger" [{:sem {:pred :linger}
:intransitive-only? true}]
"listen" [{:prepositional-verb-with "to"
"listen" [{:prepositional-verb {:with "to"}
:sem {:pred :listen-to}}]
"live" [{:sem {:pred :live}}]
"look" [{:intransitive-only? true
:sem {:pred :look}}
{:prepositional-verb-with "at"
{:prepositional-verb {:with "at"}
:sem {:pred :look-at}}
{:prepositional-verb-with "for"
{:prepositional-verb {:with "for"}
:sem {:pred :look-for}}
{:prepositional-verb-with "up"
{:prepositional-verb {:with "up"}
:sem {:pred :look-up}}]
"lose" (let [exceptions [{:infl :past-simple :surface "lost"}
{:infl :past-participle :surface "lost"}]]
Expand Down Expand Up @@ -608,7 +608,7 @@
"prevent" [{ :sem {:pred :prevent}}]

;; TODO: rewrite after better lexical support for ditransitive verbs (similar to what
;; was done for {:prepositional-verb-with "X"}.
;; was done for {:prepositional-verb {:with "X"}.
"put" (let [exceptions [{:infl :past-simple :surface "put"}
{:infl :past-participle :surface "put"}]]
[{:intransitive-only? true
Expand Down Expand Up @@ -768,7 +768,7 @@
:exceptions exceptions}

{:sem {:pred :throw-out}
:prepositional-verb-with "out"
:prepositional-verb {:with "out"}
:exceptions exceptions}])

"to" ;; to (in "she is able to"), "to sleep", "to see them"
Expand Down Expand Up @@ -845,9 +845,9 @@
:to? true})]
"try" [{:sem {:pred :try}
:modal :infinitive}]
"turn" [{:prepositional-verb-with "on"
"turn" [{:prepositional-verb {:with "on"}
:sem {:pred :turn-on}}
{:prepositional-verb-with "off"
{:prepositional-verb {:with "off"}
:sem {:pred :turn-off}}]
"understand" [{:sem {:pred :understand}
:exceptions [{:infl :past-simple :surface "understood"}
Expand All @@ -864,7 +864,7 @@
:aspect :progressive}
:used-to? true}]

"wake" [{:prepositional-verb-with "up"
"wake" [{:prepositional-verb {:with "up"}
:sem {:pred :wake-up}}]

"walk" [{:sem {:pred :walk}}
Expand Down

0 comments on commit c6846bd

Please sign in to comment.