Practical Work 3
Grammar Development
Templates with Arguments
Download
grammar2.lfg and take a good look
at it. Expand it or your own grammar so that the following sentences are assigned a sound
analysis:
- the hero sent the enemies a message
- the hero sent the enemies message
- monkeys love bananas
- a monkey loves a banana
The verb send ist a three-place verb. Assume the following
subcateogrization frame: SUBJ, OBJ, OBJ2. Assume that the object is always to the right
of the verb in English.
Your grammar should contain the following:
- A template for transitive verbs
- A template for intransitive verbs
- A template for ditransitive verbs
- A template OPT-TRANS that calls up templates for transitive and
intransitive verbs (for verbs like eat, which can be used
transitively or intransitively).
- Templates for for number and person so that this information can
be called up via templates in the noun entries.
- All your verbal lexical entries should call up their
subcategorization information, their subject-verb agreement
information and their tense-aspect-moood information via templates.
Feature Unification
These sentences should not work:
- the girl give the gorilla
bananas
- gorillas devours bananas
-
gorilla devour bananas
- gorillas
devours banana
That is, make sure that
subject-verb agreement works right and that singular count nouns
appear with a determiner (e.g., cf. gd-lesson2.pdf for the count noun
template).
Remember that there are several ways to formulate constraints on
f-structures.
- = assigns a value to an attribute (e.g., (^ DEF) = +)).
- ~= says that an attribute should not have this value
(e.g., (^ DEF) ~= +)).
- =c says an attribute is constrained to have a certain
value, but that this value should be provided in another part of
clause (e.g., (^ DEF) =c +)). This is called a
constraining equation.
- Just providing the attribute and no value is a so-called
existential contraint, e.g., (^ DEF). This means that this
attribute is considered to exist and that a value must be provided
by another part of the clause.
Testsuites
Create a testsuite of sample sentences and keep testing your
progress with respect to the testsuite (see XLE
Documentation for many details). Remember to do regression
testing to make sure your grammar does not lose capabilities you had
already implemented.
Lexical Rules, First look at PPs
The file grammar2.lfg also already
contains a lexical rule for the passive. It also contains a
simplified treatment of PPs. Use these as a basis for building a
lexical rule for the English Dative Shift. See the part on
templates and lexical rules in the XLE documentation for more
information. See the file gd-lesson3.pdf for information on the
dative shift.
This lexical rule should interact with the lexical rule for the
passive so that one can also parse passives of ditransitive verbs.
Update your templates for transitive and ditransitive verbs using
the two lexical rules (in interaction, if applicable).
Expand your grammar so that the following sentences also work:
- the hero sent a warning to the enemy
- the hero sent the enemy a warning
- the enemy was sent a warning by the hero
- a warning was given to the enemy by the hero
These sentences should not work:
- the hero sent to the enemy a warning
- the enemy was sent by the hero a bone
That is, you need to
make sure that the NPs and PPs appear in the right order.
Be sure to add all of the sentences to your (growing) testsuite.
Mark the ones that should not work with a 0!. See the part on Test
Files and Tree Banks in the XLE user documentation for more
information.
Your grammar should contain (at least) the following:
- Lexical rules for passive and Dative Shift in the TEMPLATE section.
- C-structure rules in the RULES section which allow for OBLs
PPs.
- The LEXICON section has to be expanded to take care of any new
lexical items.