making better use of pos-info in lexicon; retrieving verb-specific

schemas
parent b6346ca5
......@@ -8,43 +8,43 @@
{:id (uuid)
:form "take"
:pos "V"
:agreement (? :agr)
:agreement nil
:tense :present
:satisfies "TakingSchema"}
:evokes "TakingSchema"}
{:id (uuid)
:form "bring"
:pos "V"
:agreement (? :agr)
:agreement nil
:tense :present
:satisfies "BringingSchema"}
:evokes "BringingSchema"}
{:id (uuid)
:form "crack"
:pos "V"
:agreement (? :agr)
:agreement nil
:tense :present
:satisfies "CrackingSchema"}
:evokes "CrackingSchema"}
{:id (uuid)
:form "move"
:pos "V"
:agreement (? :agr)
:agreement nil
:tense :present
:satisfies "MovingSchema"}
:evokes "MovingSchema"}
{:id (uuid)
:form "cover"
:pos "V"
:agreement (? :agr)
:agreement nil
:tense :present
:satisfies "CoveringSchema"}
:evokes "CoveringSchema"}
{:id (uuid)
:form "the"
:pos "DET"
:numerus (? :numerus)
:definiteness :def}
:definiteness "definite"}
{:id (uuid)
:form "a"
:pos "DET"
:numerus (? :numerus)
:definiteness :indef}
:definiteness "indefinite"}
{:id (uuid)
:form "pot"
:pos "N"
......@@ -73,14 +73,14 @@
:semantic-size :small}
{:id (uuid)
:form "from"
:pos :preposition
:pos "PREP"
:sem-function :generalDirectionalDistancing}
{:id (uuid)
:form "into"
:pos :preposition}
:pos "PREP"}
{:id (uuid)
:form "with"
:pos :preposition}
:pos "PREP"}
{:id (uuid)
:form "lid"
:pos "N"
......@@ -92,10 +92,10 @@
:semantic-category :surface}
{:id (uuid)
:form "off"
:pos :preposition}
:pos "PREP"}
{:id (uuid)
:form "to"
:pos :preposition}
:pos "PREP"}
{:id (uuid)
:form "counter"
:numerus "Singular"
......@@ -108,7 +108,7 @@
:semantic-category :surface}
{:id (uuid)
:form "on"
:pos :preposition}
:pos "PREP"}
{:id (uuid)
:form "and"
:pos :conjunction}
......@@ -202,117 +202,65 @@
:call (comp
(mapcat (fn [b]
(map (fn [lex]
(assoc b (? :lex) (:id lex)))
(assoc b (? :lex) (:id lex)
(? :pos) (:pos lex)))
(get lex-by-form (get b (? :form))))))
(introduce (? :interpretation)))
:merge #{[(? :word) :tag :syntax]
[(? :word) :tag :word]
[(? :interpretation) :isa :interpretation]
[(? :interpretation) :pos (? :pos)]
[(? :interpretation) :lexicon (? :lex)]
[(? :interpretation) :word (? :word)]
[(? :interpretation) :tag :syntax]}
:search-preference :min-bindings
}
{:id :definite-determiner
:match #{[(? :interpretation) :lexicon (? :lex)]}
:call (filter
(fn [b]
(let [lex (some->>
(? :lex)
(get b)
(get lex-by-id))]
(and (= "DET" (:pos (first lex)))
(= :def (:definiteness (first lex)))))))
:merge #{[(? :interpretation) :pos "DET"]
[(? :interpretation) :definiteness :definite]
[(? :interpretation) :referent (? :ref)]
[(? :ref) :identifiability (? :def)]
[(? :ref) :isa "Referent"]
[(? :ref) :tag :semantics]
;[(? :interpretation) :tag :syntax]
}
:search-preference :min-bindings
}
{:id :indefinite-determiner
:match #{[(? :interpretation) :lexicon (? :lex)]}
:call (filter
(fn [b]
(let [lex (some->>
(? :lex)
(get b)
(get lex-by-id))]
(and (= "DET" (:pos (first lex)))
(= :indef (:definiteness (first lex)))))))
:merge #{[(? :interpretation) :pos "DET"]
[(? :interpretation) :definiteness :indefinite]
{:id :determiner
:match #{[(? :interpretation) :lexicon (? :lex)]
[(? :interpretation) :pos "DET"]}
:call (mapcat
(fn [b]
(map (fn [lex]
(assoc b (? :def) (:definiteness lex)))
(get lex-by-id (get b (? :lex))))))
:merge #{[(? :interpretation) :definiteness (? :def)]
[(? :interpretation) :referent (? :ref)]
[(? :ref) :identifiability (? :def)]
[(? :ref) :isa "Referent"]
[(? :raf) :tag :semantics]
}
:search-preference :min-bindings
}
{:id :singular-noun
:match #{[(? :interpretation) :lexicon (? :lex)]}
:call (filter ;TODO: extract semantic-category from lexicon-entry
(fn [b]
(let [lex (some->>
(? :lex)
(get b)
(get lex-by-id))]
(and (= "N" (:pos (first lex)))
(= "Singular" (:numerus (first lex)))))))
:merge #{[(? :interpretation) :referent (? :ref)]
[(? :interpretation) :pos "N"]
[(? :interpretation) :numerus "Singular"]
[(? :ref) :isa "Referent"]
[(? :ref) :has-number-value "Singular"]
[(? :ref) :tag :semantics]
;[(? :ref) :tag :semantics]
}
:search-preference :min-bindings
}
{:id :plural-noun
:match #{[(? :interpretation) :lexicon (? :lex)]}
:call (filter ;TODO: extract semantic-category from lexicon-entry
{:id :noun
:match #{[(? :interpretation) :lexicon (? :lex)]
[(? :interpretation) :pos "N"]}
:call (mapcat ;TODO: extract semantic-category from lexicon-entry
(fn [b]
(let [lex (some->>
(? :lex)
(get b)
(get lex-by-id))]
(and (= "N" (:pos (first lex)))
(= "Plural" (:numerus (first lex)))))))
(map (fn [lex]
(assoc b (? :num) (:numerus lex)))
(get lex-by-id (get b (? :lex))))))
:merge #{[(? :interpretation) :referent (? :ref)]
[(? :interpretation) :pos "N"]
[(? :interpretation) :numerus "Plural"]
[(? :interpretation) :numerus (? :num)]
[(? :ref) :isa "Referent"]
[(? :ref) :has-number-value "Plural"]
[(? :ref) :tag :semantics]
[(? :ref) :has-number-value (? :num)]
;[(? :ref) :tag :semantics]
}
:search-preference :min-bindings
}
{:id :root-verb
:match #{[(? :v-intp) :lexicon (? :lex)]}
;TODO retrieve verb-specific schema
:call (filter
(fn [b]
(let [lex (some->>
(? :lex)
(get b)
(get lex-by-id))]
(and (= "V" (:pos (first lex)))
(= :present (:tense (first lex)))))))
:merge #{[(? :v-intp) :pos "V"]
[(? :v-intp) :agreement (? :agr)]
[(? :v-intp) :tense :present]}}
{:id :preposition
:match #{[(? :intp) :lexicon (? :lex)]}
:call (filter
(fn [b]
(let [lex (some->>
(? :lex)
(get b)
(get lex-by-id))]
(and (= :preposition (:pos (first lex)))))))
:merge #{[(? :intp) :pos :preposition]}}
:match #{[(? :v-intp) :lexicon (? :lex)]
[(? :v-intp) :pos "V"]}
:call (mapcat (fn [b]
(map (fn [lex]
(assoc b (? :tense) (:tense lex)
(? :agr) (:agreement lex (? :agr-val)) ; not working with var?
(? :schema-name) (:evokes lex)))
(get lex-by-id (get b (? :lex))))))
:merge #{[(? :v-intp) :agreement (? :agr)]
[(? :v-intp) :tense (? :tense)]
[(? :v-intp) :evokes (? :schema)]
[(? :schema) :isa (? :schema-name)]}}
{:id :determined-noun-NP
:match #{[(? :det-intp) :pos "DET"]
[(? :det-intp) :word (? :det-word)]
......@@ -445,7 +393,7 @@
[(? :syn-val) :object (? :obj)]
[(? :sem-val) :patient (? :ref)][]}}
{:id :PP ; PrepNP
:match #{[(? :p) :pos :preposition]
:match #{[(? :p) :pos "PREP"]
[(? :p) :word (? :p-word)]
[(? :p-word) :form (? :p-form)]
[(? :p-word) :meets (? :det-word)]
......
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