############################################################################
# David Bullock (bullockd@u.washington.edu).
# LING-567 "Knowledge Engineering for NLP" (Bender).
# Lab 7, due 2006-May-14.
############################################################################

MATRIX AND EMBEDDED INTERROGATIVES.

In Mandarin, matrix interrogatives can be formed in two ways: (1) by using a sentence-final question particle ("ma"), or (2) by using the verb-neg-verb form for the matrix verb.

For example, here is a matrix interrogative with a sentence-final question particle:

    ni3 de lao3shi1 kan4 ni3 ma
    2SG GEN teacher look.at 2SG Q
    'Does your teacher look at you?'

And here is a matrix interrogative using the verb-neg-verb form for the matrix verb:

    ni3 de lao3shi1 kan4bu4kan4 ni3
    2SG GEN teacher look.at.Q 2SG
    'Does your teacher look at you?'

An embedded interrogative clause can have the same form as the verb-neg-verb matrix interrogative. For example:

    ni3 zhi1dao4 ni3 de lao3shi1 kan4bu4kan4 ni3
    2SG know 2SG GEN teacher look.at.Q 2SG
    'You know whether your teacher looks at you.'

(Note: According to Zhengbo Zhou's judgment, the sentence-final question particle cannot be used to form an embedded interrogative clause in formal speech. However, it might be used this way in informal speech, where it would ambiguously indicate a matrix question or embedded interrogative.)

############################################################################

MATRIX IMPERATIVES.

Imperatives have a second-person subject that is often dropped.

When a sentence has a second-person subject or a pro-dropped subject, the interpretation as an imperative or declarative depends on context.

    ni3 gei3 wo3 zhe4 ben3 shu1
    2SG give 1SG this CLF book
    'Give me this book.' or 'You give me this book.'

    gei3 wo3 zhe4 ben3 shu1
    give 1SG this CLF book
    'Give me this book.' or '(Someone) gives me this book.'

############################################################################

CHANGES TO THE GRAMMAR: MATRIX AND EMBEDDED VERB-NEG-VERB INTERROGATIVES.

I added the feature [ QUES bool ] to the "verb" type. This bool feature is + for interrogative clauses, and - for non-interrogative clauses. In the lexicon, each verb has two entries: the ordinary verb entry is [ QUES - ], and the verb-neg-verb entry is [ QUES + ].

I created an "interrogative-clause-plus" type that hooks up the semantic relations for interrogative clauses. This type puts two message relations on C-CONT.RELS (question_m_rel and proposition_m_rel) and one qeq relation on C-CONT.HCONS. As a result, the semantic relations look like this (where #ltop is the HEAD-DTR.SYNSEM.LOCAL.CONT.HOOK.LTOP):

    h1: question_m_rel( #marg )
    #marg: proposition_m_rel( #harg )
    #harg qeq #ltop

I created two subtypes of this "interrogative-clause-plus" type:

1. The "matrix-interrogative-clause" type requires its daughter to be an S (fully saturated verb) that is a main clause [ MC + ] with an interrogative verb [ QUES + ]. The mother S will also be [ MC + ]. (In "rules.tdl", I declared "matrix-interrogative" as an instance of this type.)

2. The "embedded-interrogative-clause" type requires its daughter to be an S (fully saturated verb) that is not a main clause [ MC - ] but has an interrogative verb [ QUES + ]. The mother S will also be [ MC - ]. (In "rules.tdl", I declared "embedded-interrogative" as an instance of this type.)

I modified "matrix-declarative-clause" and "embedded-declarative-clause" so they both require a non-interrogative verb [ QUES - ].

############################################################################

CHANGES TO THE GRAMMAR: MATRIX QUESTION-PARTICLE INTERROGATIVES.

I added a "tag-question-lex" type. In the lexicon I changed the question particle "ma" to this type.

The SUBJ of the tag question must be an S (fully saturated verb), must be a main clause [ MC + ], must not be a question [ QUES - ], and must have proposition_m_rel as its message PRED.

The tag question SYSTEM.LOCAL.CONT.RELS contains a question_m_rel, which results in the semantic relation:

    #lbl: question_m_rel( #ltop )

where #lbl is the tag question's SYNSEM.LOCAL.CONT.HOOK.LTOP, and #ltop is the LOCAL.CONT.HOOK.LTOP of the tag question's SUBJ (which is the proposition_m_rel relation).

############################################################################

CHANGES TO THE GRAMMAR: MATRIX IMPERATIVES.

I created a "matrix-imperative-clause" type, a subtype of "imperative-clause".

The "matrix-imperative-clause" type requires its daughter to be an S (fully saturated verb) that is a main clause [ MC + ] with a non-interrogative verb [ QUES - ] and a second-person XARG. The mother S will also be [ MC + ]. (In "rules.tdl", I declared "matrix-imperative" as an instance of this type.)

The "matrix-imperative-clause" is similar to the "matrix-declarative-clause", except that the subject must be second-person and the top semantic relation is command_m_rel (instead of proposition_m_rel).

############################################################################

SEMANTIC REPRESENTATIONS FOR DIFFERENT CLAUSE TYPES.

For Matrix Interrogative clauses, the grammar now produces the expected semantic representation:

    lao3shi1 shui4 ma ('Does teacher sleep?')

    <h1,u2:SEMSORT,
    {h3:_teacher_n(x4:SEMSORT:BOOL:THIRD:NUMBER:CLF-WEI4),
    h5:reg_quant(x4, h6, h7),
    h8:_sleep_v(e9:SEMSORT:TENSE:ASPECT:MOOD, x4),
    h10:proposition_m(h11),
    h1:question_m(h10)},
    {h6 qeq h3,
    h11 qeq h8}>

    lao3shi1 shui4bu4shui4 ('Does teacher sleep?')

    <h1,e2:SEMSORT:TENSE:ASPECT:MOOD,
    {h3:_teacher_n(x4:SEMSORT:BOOL:THIRD:NUMBER:CLF-WEI4),
    h5:reg_quant(x4, h6, h7),
    h8:_sleep_v(e2, x4),
    h1:question_m(h9),
    h9:proposition_m(h10)},
    {h6 qeq h3,
    h10 qeq h8}>

(Slight differences in handle numbers: I don't think this is important. The top-level event "u2" vs. "e2" is different: How important? How to fix?)

For Embedded Interrogative clauses (with matrix declaratives), the grammar now produces the expected semantic representation:

    wo3 zhi1dao4 lao3shi1 shui4bu4shui4 ('I know whether teacher sleeps.')

    <h1,e2:SEMSORT:TENSE:ASPECT:MOOD,
    {h3:pronoun_n(x4:SEMSORT:FIRST:SG:NO-NOUN-CLASSIFIER:BOOL),
    h5:pronoun_q(x4, h6, h7),
    h8:_know_v(e2, x4, h9),
    h10:_teacher_n(x11:SEMSORT:BOOL:THIRD:NUMBER:CLF-WEI4),
    h12:reg_quant(x11, h13, h14),
    h15:_sleep_v(e16:SEMSORT:TENSE:ASPECT:MOOD, x11),
    h9:question_m(h17),
    h17:proposition_m(h18),
    h1:proposition_m(h19)},
    {h6 qeq h3,
    h13 qeq h10,
    h18 qeq h15,
    h19 qeq h8}>

For Matrix Imperative clauses, the grammar now produces the expected semantic representation:

    ni3 shui4 ('Sleep.')

    <h1,e2:SEMSORT:TENSE:ASPECT:MOOD,
    {h3:pronoun_n(x4:SECOND:SG:NO-NOUN-CLASSIFIER:SEMSORT:BOOL),
    h5:pronoun_q(x4, h6, h7),
    h8:_sleep_v(e2, x4),
    h1:command_m(h9)},
    {h6 qeq h3,
    h9 qeq h8}>

############################################################################

TEST-SUITE RESULTS.

Baseline from 2006-05-03 Lab6 Final Grammar:

    Coverage of current batch parse output:
        51 out of 98 grammatical sentences parsed = 52.04 percent
    Overgeneration of current batch parse output:
        15 out of 70 ungrammatical sentences parsed = 21.42 percent

New 2006-05-13 Lab7 Final Grammar:

    Coverage of current batch parse output:
        68 out of 98 grammatical sentences parsed = 69.38 percent
    Overgeneration of current batch parse output:
        17 out of 70 ungrammatical sentences parsed = 24.28 percent

Coverage has improved by 17 percent. This is mostly due to (1) the support of interrogatives in the grammar, (2) the addition of verb-neg-verb forms to the lexicon, and (3) the support of ditransitive verbs in the grammar and lexicon.

Overgeneration only increased a little: Restrictions are needed to prevent verb-neg-verb forms from being negated, and the verb 'yao4' cannot take an embedded interrogative (in fact, 'you4' needs to be reworked into a control verb).

Adding support for pro-drop and auxiliary verbs should produce another gain in coverage.

Other things still on the to-do list: (1) restricting the order of pre-NOM modifiers, and (2) fixing the possessive marker "de" so it must be preceded by an NP and hooks up the "possessor" semantics.

(Sorry, I'm using [decr tsdb()] again to avoid a weekend trip to Seattle.)

############################################################################

ADDITIONS TO LEXICON.

For the Machine Translation Extravaganza, I expanded my lexicon with more nouns from the class word list:

- student ('[yi1 ge] xue2sheng1')
- man ('[yi1 ge] nan2ren2')
- woman ('[yi1 ge] nu3ren2')
- boy ('[yi1 ge] nan2hai2zi')
- girl ('[yi1 ge] nu3hai2zi')
- father ('[yi1 ge] ba4ba')
- mother ('[yi1 ge] ma1ma')
- bread ('[yi1 ge] mian4bao1')
- house ('[yi1 dong4] fang2zi')

And more verbs from the class word list:

- sleep ('shui4')
- see ('kan4jian4')
- read ('kan4'), a second meaning for the verb
- write ('xie3')
- come ('lai2')
- go ('qu4')
- eat ('chi1')
- help ('bang1')
- give ('gei3'), a ditransitive verb

############################################################################
