Semantic modification must satisfy a few constraints:
Below we describe a proposed solution that meets these requirements.
The :ref
feature is used to avoid cycles (a. above). This :ref
is used by [:mod :arg]
to refer to what is being modified.
Three new ug meta-rules:
nest-mod
:
:head
and the :sem
of the parent are distinct: [:head :sem]
!= [:sem]
.:sem
: [:head :mod]
= [:sem :mod]
.cons-mod
:
[:head :sem]
= [:sem]
.[:head :mod :first]
= [:comp :sem]
[:head :mod :rest]
= [:comp :mod]
.cons-and-nest-mod
:
:sem
of the :head
and the :sem
of the parent are identical: [:head :sem]
= [:sem]
.[:sem :mod]
is a list with one member: [:comp :mod]
.English rules' use of these meta rules:
nest-mod
: np
,vp
.cons-mod
: nmod
(a.k.a. nbar
),..no-mod
: s
,s/
, cp
,..cons-and-nest-mod
: vmod
.{:cat :noun
:sem {:pred :dog
:ref {:spatial true}
:mod []}}
{:cat :adj
:sem {:pred :orange
:arg {:spatial true}}}
{:cat :adv
:sem {:pred :stealth
:arg {:activity true}}}
{:cat :verb
:sem {:pred :sleep
:activity true
:subj {:animate true (c.)
:ref [1]}}
:subcat {:1 {:cat :noun
:sem {:ref [1]}}
:2 []}}
nmod
is a rule where :sem and :mod are siblings (cons-mod
):
{:rule "nmod"
:comp [1]
:sem [2] {:ref [3]}
:mod <[4]{:arg [3]} [5]>
:head {:sem [2]
:mod [5]
:subcat {:1 [1]
:2 []}}}
:comp {:sem [4]}}
np
, by contrast, is a rule where :mod is within :sem (nest-mod
):
{:rule "np"
:sem {:mod [1]
:pred [2]
:ref [3]}
:head {:sem {:pred [2]
:ref [3]}
:mod [1]}}
Here we'll use the example sentence "the small orange cat that you see hunts a grey mouse stealthily" and its constituent phrases:
[s [np the [nmod [nmod small [nmod orange cat]] [cp that [s/ you see]]]] [vmod [vp hunts a mouse] stealthily]]
s
is neither nest-mod
, cons-mod
, nor :cons-and-nest-mod
: neither child should have a
:mod
feature. This is enforced with :mod :unspec
as shown below:
{:cat :verb
:sem {:pred :hunts
:obj {:pred :mouse
:mod <{:pred :grey}>}
:subj {:pred :cat
:mod <{:pred :see
:subj {:pred :you}},
{:pred :small},
{:pred :orange}>
:mod <{:pred :stealth>}>}}
{:cat :verb
:sem {:pred :hunts
:obj {:ref [3]
:pred :mouse
:mod [4] <{:ref [3]
:pred :grey}>}
:ref [2]
:subj {:pred [5] :cat
:ref [1]}
:mod <{:pred :see
:obj {:ref [1]
:pred [5]}
:subj {:pred :you}},
{:pred :small
:arg [1]},
{:pred :orange
:arg [1]}>}
:mod <{:pred :stealth
:arg [2]}>}
:mod :unspec}
:head {:mod :unspec}
:comp {:mod :unspec}}
[np the [nmod [nmod small [nmod orange cat]] [cp that [s/ you see]]]]
np
is nest-mod
and so [:sem :mod]
= [:head :mod]
.
{:cat :noun
:sem {:pred :cat
:mod <{:pred :see
:subj {:pred :you}},
{:pred :small},
{:pred :orange}>}}
{:cat :noun
:sem {:pred [5] :cat
:ref [1]}
:mod <{:pred :see
:obj {:ref [1]
:pred [5]}
:subj {:pred :you}}>}
{:pred :small
:arg [1]}
{:pred :orange
:arg [1]}>
:mod :unspec}
:head {:mod :unspec}
:comp {:mod :unspec}}
[nmod [nmod small [nmod orange cat]] [cp that [s/ you see]]]
nmod
is cons-mod
; as such, the outer nmod
: :sem
and :mod
are siblings:
{:cat :noun
:sem {:pred :cat
:mod <{:pred :see
:subj {:pred :you}},
{:pred :small},
{:pred :orange}>}}
{:cat :noun
:sem {:pred :cat
:ref [1]}
:mod <{:pred :see
:obj {:ref [1]}
:subj {:pred :you}}>},
{:pred :small
:arg [1]},
{:pred :orange
:arg [1]}>}
[nmod [nmod small [nmod orange cat]]]
The middle nmod
: :sem
and :mod
are also siblings:
{:cat :noun
:sem {:pred :cat
:ref [1]}
:mod <{:pred :small
:arg [1]},
{:pred :orange
:arg [1]}>}
[nmod orange cat]
The inner nmod
: :sem
and :mod
are, as in the parent, siblings:
{:cat :noun
:sem {:pred :cat
:ref [1]}
:mod <{:pred :orange
:arg [1]}>}
[cp that [s/ you see]]
Like s
. cp
is neither nest-mod
, cons-mod
, nor cons-and-nest-mod
: neither child should have a
:mod
feature. This is enforced with :mod :unspec
on the rule.
{:cat :comp
:sem {:pred :see
:subj {:pred :you}}>}
{:cat :comp
:subcat {:1 {:sem {:ref [1]}}}
:sem {:pred :see
:obj {:ref [1]}
:subj {:pred :you}}>}
:mod :unspec
:head {:mod :unspec}
:comp {:mod :unspec}}
[vmod [vp hunts a grey mouse] stealthily]
Since vmod
is cons-and-nest-mod
, the [:sem :mod]
is a list with one member: the sem
of "stealthily".
{:cat :verb
:subcat {:1 {:top :top}
:2 []}
:sem {:pred :hunts
:obj {:pred :mouse
:mod <{:pred :grey}>}
:mod <{:pred :stealth}>
{:cat :verb
:subcat {:1 {:cat :noun
:sem {:ref [1]}}
:2 []}}
:sem {:pred :hunts
:subj {:ref [1]
:obj {:ref [3]
:pred :mouse
:mod <{:ref [3]
:pred :grey}>}
:ref [2]
:mod <{:pred :stealth
:arg [2]}>}}
:mod :unspec
:head {:mod :unspec}
:comp {:mod :unspec}}
[vp hunts a grey mouse]
Like s
and cp
, vp
is neither nest-mod
, cons-mod
nor cons-and-nest-mod
: neither child should have a
:mod
feature. This is enforced with :mod :unspec
.
{:subcat {:1 {:top :top}
:2 []}
:sem {:pred :hunts
:obj {:pred :mouse
:mod <{:pred :grey}>}}}
{:subcat {:1 {:cat :noun}
:2 []}}
:sem {:pred :hunts
:subj [1]
:obj {:ref [3]
:pred :mouse
:mod <{:ref [3]
:pred :grey}>}
:ref [2]
:mod :unspec
:head {:mod :unspec}
:comp {:mod :unspec}}
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close