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

OPTIONAL ARGUMENTS.

Mandarin allows general pro-drop of all verb arguments. For example:

    wo3 chi1 mian4bao1
    1SG eat bread
    'I ate bread.'

    ni3 chi1 ma
    2SG eat Q
    'Did you eat (it/something)?'

    bu4 chi1
    NEG eat
    '(I/you/he/she/it/they) did not eat (it/something).'

The interpretation of a dropped object as definite or indefinite appears to depend on context (as in the various interpretations of the above examples). I think a dropped subject is interpreted as definite. I need more native-speaker judgments to know which arguments are definite or indefinite and whether this depends on the specific verb.

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

CHANGES TO THE GRAMMAR: OPTIONAL ARGUMENTS.

I created an instance of the "basic-head-opt-comp-phrase" rule for pro-dropped verb complements. I also created a rule instance from "basic-head-opt-subj-phrase" and "head-compositional" for pro-dropped verb subjects. To hook up the semantics correctly, the C-CONT.RELS and C-CONT.HCONS features are both empty diff-lists.

I changed intransitive, transitive and ditransitive verbs to take a [ DEF-OPT + ] subject, since dropped subjects appear to have a definite interpretation. I left DEF-OPT underspecified on verb complements, since the interpretation as definite vs. indefinite depends on context (and perhaps on the specific verb).

Pro-drop broke my "tag-question-lex" for question particle "ma", so I marked the subject [ OPT - ] for tag questions, since their SUBJ (the main S clause) cannot be omitted.

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

MODIFICATION.

The grammar already supported adjectives and adverbs from a previous lab, but the semantics of adjectives was not quite right and the order of pre-NOM modifiers was not enforced.

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

CHANGES TO THE GRAMMAR: MODIFICATION.

To fix the semantics, I had the "basic-adjective-lex-plus" type inherit from "intersective-mod-lex" in addition to "basic-adjective-lex".

Then I derived different types of adjectives from "basic-adjective-lex-plus" to support the order of modifiers:

(1) Demonstratives ("demonstrative-lex") must not follow a numeral, classifier or adjective.

(2) Numerals ("numeral-lex") must be followed by a classifier.

(3) Classifiers ("classifier-lex") must come after either a demonstrative or a numeral.

(4) Adjectives ("adjective-lex") must not be followed by a demonstrative, numeral or classifier.

I added the MOD-ORDER feature to the canonical-synsem type to control the required order of noun modifiers.

The "mod-order" type has two subtypes, which are used as values for the MOD-ORDER feature: (1) "dem-or-num-required" for when a classifier is used and needs to be preceded by a demonstrative or numeral, and (2) "dem-or-num-not-required" for all other situations.

The "mod-order" type also consists of bool features: HAS-DEM (+ iff a demonstrative has been used), HAS-NUM (+ iff a numeral has been used), HAS-CLF (+ iff a classifier has been used). These features are to prevent an NP from having more than one demonstrative, numeral, etc.

Common nouns are dem-or-num-not-required, HAS-DEM -, HAS-NUM -, HAS-CLF -.

Adjectives are dem-or-num-not-required, HAS-DEM -, HAS-NUM -, HAS-CLF -. Their MOD argument must be dem-or-num-not-required, HAS-DEM -, HAS-NUM -, HAS-CLF -.

Classifier are dem-or-num-required, HAS-DEM -, HAS-NUM -, HAS-CLF +. Their MOD argument must be dem-or-num-not-required, HAS-DEM -, HAS-NUM -, HAS-CLF -.

Numerals are dem-or-num-not-required, HAS-DEM -, HAS-NUM +, HAS-CLF +. Their MOD argument must be dem-or-num-required, HAS-DEM -, HAS-NUM -, HAS-CLF +.

Demonstratives are dem-or-num-not-required, HAS-DEM +, HAS-NUM #num, HAS-CLF #clf. Their MOD argument must be HAS-DEM -, HAS-NUM #num, HAS-CLF #clf.

For noun phrases, the MOD-ORDER feature of the head daughter is restricted to the "dem-or-num-not-required" type. This prevents noun phrases from starting with a classifier.

The "adj-head-int-phrase" rule was augmented to copy up the MOD-ORDER feature from its non-head daughter.

The above mechanisms enforce most of the order requirements for pre-NOM modifiers. For example, the following sentences now correctly produce zero parses:

    *wo3 you3 ben3 zhe4 shu1
    *wo3 you3 ben3 shu1
    *wei4 yi1 lao3shi1 kan4 wo3
    *wei4 lao3shi1 kan4 wo3

But a couple of ungrammatical sentences, that have bad modifier order, still produce parses:

    *wo3 you3 liang3 zhe4 ben3 shu1
    *yi1 lao3shi1 kan4 wo3

I have been looking at the parses, but haven't figured out what's wrong yet. Something about the constraints is working differently than I think it should (it's like some of the constraints seem to be ignored).

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

TEST-SUITE RESULTS (FROM [DECR TSDB()]).

Baseline from 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

New 2006-05-13 Lab7 Final Grammar:

    Coverage of current batch parse output:
        87 out of 98 grammatical sentences parsed = 88.77 percent
    Overgeneration of current batch parse output:
        16 out of 70 ungrammatical sentences parsed = 22.85 percent

Coverage increased almost 20 percent and overgeneration decreased a little. This was mostly due to the addition of support for optional verb arguments and the restriction of noun modifier order.

The combination of pro-drop and asyndeton coordination of sentences can create some odd interpretations:

    wo3 yao4 chi1 mian4bao1
    1SG want eat bread
    'I want (something) and (it) eats bread.'

So the above sentence is getting an interpretation, but it is not the more obvious interpretation ('I want to eat bread.') because an additional sense of 'yao4' as a control verb has not yet been added. Perhaps in the right context, the odd interpretation would make sense?

In addition, the possessive marker ("de") has not yet been fixed to require an NP specifier and to hook up the "possessor" semantics. Along with pro-drop and asyndeton coordination, this gives an incorrect parse for several sentences containing "de" as either a possessive marker or a relative-clause marker.

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