minor cleanups

parent d5194622
......@@ -256,13 +256,14 @@
{:id :noun
:match [[(? :interpretation) :lexicon (? :lex)]
[(? :interpretation) :isa "N"]]
:call (mapcat
:call (comp (mapcat
(fn [b]
(map (fn [lex]
(assoc b (? :num) (:numerus lex)
(? :cat) (clojure.string/capitalize (:form lex))
(? :sem-cat) (:type lex)))
(get lex-by-id (get b (? :lex))))))
(introduce (? :ref)))
:merge [[(? :interpretation) :referent (? :ref)]
[(? :interpretation) :numerus (? :num)]
[(? :ref) :isa "Referent"]
......@@ -273,13 +274,14 @@
]
:search-preference :min-bindings
}
{:id :pronoun ; Binding pronoun to referent of other noun. TODO: Use distance-heuristic
{:id :pronoun ; Binding pronoun to referent of other noun. TODO: Use distance-heuristic.
:match [[(? :interpretation) :lexicon (? :lex)]
[(? :interpretation) :isa "PPRON"]
[(? :prec-ref) :isa "Referent"]
[(? :prec-noun-intp) :isa "N"]
[(? :prec-noun-intp) :referent (? :prec-ref)]
[(? :prec-noun-intp) :numerus (? :num)]
[(? :prec-ref) :type "DesignedContainer"]
]
:call (mapcat
(fn [b]
......@@ -288,6 +290,7 @@
(get lex-by-id (get b (? :lex))))))
:merge [[(? :interpretation) :referent (? :prec-ref)]
[(? :interpretation) :numerus (? :num)]
[(? :interpretation) :resolved-at (str (new java.util.Date))] ; Hack for only applying once.
]
;:search-preference :min-bindings
}
......@@ -387,22 +390,22 @@
]
:call (introduce (? :trans) (? :illoc) (? :terminal-state)
(? :initial-state))
:merge [[(? :clause) :isa "ImperativeClause"]
[(? :trans) :is-expressed-by (? :clause)]
[(? :trans) :isa "StateTransition"]
[(? :trans) :tag "semantic"]
:merge [[(? :trans) :is-expressed-by (? :clause)]
[(? :trans) :satisfies (? :verb-schema)]
[(? :clause) :expresses (? :illoc)]
[(? :illoc) :isa "Command"]
[(? :illoc) :tag "semantic"]
[(? :trans) :has-terminal-state (? :terminal-state)]
[(? :terminal-state) :isa "Scene"]
[(? :terminal-state) :tag "semantic"]
[(? :terminal-state) :scene-state :terminal]
[(? :trans) :has-initial-state (? :initial-state)]
[(? :initial-state) :isa "Scene"]
[(? :initial-state) :tag "semantic"]
[(? :initial-state) :scene-state :initial]
[(? :initial-state) :tag "semantic"]
[(? :initial-state) :isa "Scene"]
[(? :terminal-state) :isa "Scene"]
[(? :terminal-state) :tag "semantic"]
[(? :illoc) :isa "Command"]
[(? :illoc) :tag "semantic"]
[(? :trans) :isa "StateTransition"]
[(? :trans) :tag "semantic"]
[(? :clause) :isa "ImperativeClause"]
]}
{:id :initial-schema-into-transition-state
:match [;[(? :clause) :isa "ImperativeClause"] ; Allow for X-schemas in declaratives to be treated, as well.
......@@ -420,7 +423,7 @@
]
:merge [[(? :initial-state) :satisfies (? :some-schema)]
]}
{:id :estschema-terminal-scene
#_{:id :estschema-terminal-scene
:match [[(? :ling-ref-expr) :evokes (? :est-schema)]
[(? :est-schema) :isa "ESTSchema"]
[(? :est-schema) :existing (? :ref)]
......@@ -437,31 +440,38 @@
:merge [[(? :term-state) :satisfies (? :est-schema)]
]
:search-preference :max-bindings}
{:id :transitive ; Bind an expressed object to existing clause.
;TODO: Atm, too rigid order constraints, e.g. cannot handle pronouns.
{:id :transitive ; Bind an expressed object to existing clause.
;TODO: Atm, too rigid order constraints, e.g. cannot handle pronouns (see below).
;TODO Applies more often than it should. At same point in time...
:match [[(? :vp) :isa "VP"]
[(? :vp) :head (? :v)]
[(? :v) :word (? :v-word)]
[(? :vp) :syn-valence (? :syn-val)]
[(? :syn-val) :isa :syn-valence]
[(? :vp) :sem-valence (? :sem-val)]
[(? :obj) :subunit (? :ling-ref-expr)]
[(? :ling-ref-expr) :word (? :ling-ref-expr-word)]
[(? :sem-val) :isa :sem-valence]
[(? :obj) :subunit (? :det)]
[(? :det) :isa "DET"]
[(? :det) :word (? :det-word)]
[(? :obj) :isa "NP"]
[(? :obj) :referent (? :ref)]
[(? :ref) :isa "Referent"]
[(? :clause) :subunit (? :vp)]
[(? :v-word) :meets (? :ling-ref-expr-word)]
[(? :v-word) :meets (? :det-word)]
]
:merge [[(? :clause) :subunit (? :obj)]
[(? :vp) :subunit (? :obj)]
[(? :syn-val) :object (? :obj)]
[(? :sem-val) :patient (? :ref)]]}
[(? :sem-val) :patient (? :ref)]]
:search-preference :min-bindings}
{:id :transitive-pronoun
:match [[(? :vp) :isa "VP"]
[(? :vp) :head (? :v)]
[(? :v) :word (? :v-word)]
[(? :vp) :syn-valence (? :syn-val)]
[(? :syn-val) :isa :syn-valence]
[(? :vp) :sem-valence (? :sem-val)]
[(? :sem-val) :isa :sem-valence]
[(? :ling-ref-expr) :isa "PPRON"]
[(? :ling-ref-expr) :word (? :ling-ref-expr-word)]
[(? :ling-ref-expr) :referent (? :ref)]
......@@ -490,7 +500,7 @@
[(? :pp) :tag "syntax"]
[(? :pp) :prep-id (? :p-form)]]}
{:id :NP-locative-On-PP ; "Cover the pot on the stove."
:match [[(? :pp) :isa "PP"] ;TODO take word order into account.
:match [[(? :pp) :isa "PP"]
[(? :pp) :subunit (? :embed-np)]
[(? :embed-np) :isa "NP"]
[(? :embed-np) :referent (? :supporter)]
......@@ -503,7 +513,7 @@
[(? :n) :word (? :n-word)]
[(? :n-word) :meets (? :p-word)]
]
;:call (introduce (? :tl-schema) (? :support-schema))
:call (introduce (? :tl-schema) (? :support-schema))
:merge [[(? :np) :subunit (? :pp)]
;[(? :pp) :evokes (? :support-schema)]
[(? :np) :evokes (? :support-schema)]
......@@ -593,11 +603,7 @@
(? :container-role) (? :containee-role) (? :goal-role)
(? :containee-role) (? :traj-role) (? :path-role))
:merge [[(? :pp) :evokes (? :spg-schema)]
[(? :spg-schema) :has-constituent (? :source-role)]
[(? :source-role) :classifies (? :source)]
[(? :spg-schema) :has-constituent (? :path-role)]
[(? :path-role) :isa "Path"]
[(? :path-role) :tag "semantic"]
[(? :path-role) :classifies (? :path)]
[(? :spg-schema) :has-constituent (? :goal-role)]
[(? :goal-role) :classifies (? :containment)]
......@@ -608,6 +614,8 @@
[(? :container-role) :classifies (? :container)]
[(? :containment) :has-constituent (? :containee-role)]
[(? :containee-role) :classifies (? :traj)]
[(? :path-role) :isa "Path"]
[(? :path-role) :tag "semantic"]
[(? :containee-role) :tag "semantic"]
[(? :source-role) :tag "semantic"]
[(? :container-role) :tag "semantic"]
......@@ -616,13 +624,13 @@
[(? :goal-role) :tag "semantic"]
[(? :spg-schema) :tag "semantic"]
[(? :spg-schema) :isa "SourcePathGoal"]
[(? :source-role) :isa "Source"]
[(? :goal-role) :isa "Goal"]
[(? :traj-role) :isa "Trajector"]
[(? :containee-role) :isa "Containee"]
[(? :containment) :isa "Containment"]
[(? :container-role) :isa "Container"]
]}
]
:search-preference :min-bindings}
{:id :cause-motion-goal-oriented
:match [[(? :vp) :sem-valence (? :sem-val)]
[(? :vp) :syn-valence (? :syn-val)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment