

    Introduction to Gibberish
    -------------------------

The Gibberish parser has a limited but flexible parsing ability.
The code contains comments suggesting how Gibberish can be
modified to handle the sentences in file test2.  As a preliminary,
the student is advised to look at the simpler sentences in test1
and note how Gibberish handles them and why they are correct or
incorrect.  Comparing those sentences with the ones in test2 may
suggest what coverage this parser lacks, and what structures will
need to be added.  The following are a few hints about those
structures and how Gibberish can be expanded to suit:

    1)  the 'gapping' mechanism ("gap" is a term for a missing
        sentence constituent) has been implemented in full
        generality, so that any structure can be passed
        through as a gap.  In fact, gapping of noun phrases (NP's)
        has already been accomodated in the verb predicate,
        but it has not been utilized.  You *may* also wish
        to rewrite the prepositional phrase (PP) rule so that
        it can also accept gaps (hint)!

    2)  For an example of how the gapping works, look at the
        second "sentence" rule -- where the sentence is a
        question in which the modal has been 'moved' out of
        'normal' position to the front of the input.  The
        modal (if one is found, of course) is parsed unconditionally
        and its parsed structure is placed in the gap slot of
        the verb phrase (VP).  Notice in the VP rule that that
        structure is passed directly to the modal rule.  The
        second modal rule checks (since no modal has been
        found on the input) to see if the gap contains a modal
        passed in from the previous parsing.  The check is
        found in the Prolog goal "{Mgap =.. [modal|_]}".  If
        a modal is found, the output gap (Vbgap) is set to
        nogap (ie. the gap has been consumed) and the other
        variables are set to the appropriate state.  Now look
        at the first NP rule...

    3)  A sentence can only be judged correct if the gap has
        been consumed during the parse so that nothing is left
        over at the end of the sentence unresolved.  This is
        handled by the Prolog goal "{Gapout = nogap}" in the
        verb_bar rule.  If this equality fails, the parser 
        must backtrack.

    4)  This suggests that a profitable method of finding more
        general structures for parsing is to re-write sentences
        into a 'normal' form, ie.

        Does he know you stole his car.

        becomes:

        He does know you stole his car.

        A further possibility is:

        What do you want.

        becomes:

        You do want what.

    5)  In light of this, it is obvious that Gibberish's VP
        rules have to be expanded to include 'auxiliaries'
        and 'operators'.  'Wh-constituents' can also be worked
        into a similar scheme.  Of the roughly ten different
        'verb' tenses, Gibberish handles only three (hint)!

    6)  Another structure lacking in Gibberish is the sentence_bar
        (Sbar).  An example would be "for her to argue", or
        "having pleasure at the office".  The parser should be
        expanded to accomodate these as possible subjects and
        objects of verbs (and could be sub-categorized for).
        One possibility, in "noun_args", has been commented out.

    7)  The conjunction handling includes a simple mechanism
        to make conjoined structures agree much like simple ones.
        More structures than np, vp, and pp can be conjoined.
        In particular, the test sentence:

        a cat or dog will go and see the stamp.

        doesn't parse because the vp-level 'conj' expects both
        "will go" and "see" to be third & sing.  Conjunction at
        the vbar level will be needed to handle such a sentence.
        The nbar rule could use a similar arrangement.

    8)  Other areas of note: imperatives, adjectives, adverbs
        (and the phrases headed by both),  mood, voice, the
        verb "be",  the copula "be", pronouns, idioms, etc.
