In this exercise, you will practice integrating a morphological analyzer into your grammar. Up to now you have been working with a full form lexicon. This means you have full control over the lexical entries within your grammar, but it is also very tedious as you have to write a separate lexical entry for each inflected (or derived) form.
In this exercise we will work with a version of the finite-state morphological analyzer that is part of the English ParGram grammar. It is called english.infl.patch.full.fst and can be found in the "prelex" folder of the English ParGram grammar. The English ParGram grammar is available to you via the XLE license.
Alternatively, you can also build your own finite-state morphological analyzer and hook it up, or use a different type of analyzer altogether. Details as to the morphology-grammar interface can be found in the Starter Notes and in the XLE Morphology Section.
You can use grammar6.lfg as a starting point. It already contains a sublexical rule for verbs as well as several entries for morphological tags.
grammar6.lfg already interacts with the morphological analyzer with respect to verbs.
Now expand the grammar so that nouns and adjectives are also coming out of the morphological analyzer.
Generally proceed in the following way:
% morphemes bananas analyzing {bananas} {bananas "+Token"|banana "+Noun" "+Pl"}
In the MORPHOLOGY section there is an "unknown" entry which allows the morphological analyzer to pass its knowledge about lexical items into the grammar.
-unknown ADJ-S XLE (^ PRED) = '%stem'; N-S XLE (^ PRED) = '%stem'.
This entry has the effect that any word not present in the Lexicon section of grammar6.lfg will be guessed to be either a noun or an adjective. If this word follows the sublexical rules specified in the grammar, then it can be parsed by the grammar.
You do need to write lexical entries for those words which do not have guessable functional annoations. For example, the morphological analyzer does not know whether a verb is intransitive, transitive, ditransitive, etc. So for verbs you need to specify the head word (lemma) and the relevant subcatgorization information in the lexicon.
For nouns and adjectives, this is not necessary, as the "unknown" guesser in guesses words not in the lexicon to be either nouns or adjectives. So, unless you wanted to specify extra information for a particular lemma, you do not need to have extra entries for nouns and adjectives in your lexicon. Try deleting (or commenting out) all the ones you have entered and see if your testsuite still works.
You have several entries in your grammars that could be several different Parts-of-Speech (for example "dog" has been encoded as a verb and as a noun). When you delete your noun entry for "dog", you need to make sure that the remaining entry interacts properly with the -unknown entry in the morph-lex-10.lfg file. The way to do this is to specify that the verb entry is not the only entry.
dog +V-S XLE @(TRANS dog); ETC.
Read more about the interactions between lexical entries and lexicons in XLE Lexicon Entries and Lookup Model.
The Grammar Writer's Cookbook, Ch. 12 (finite-state morphologies)
Kaplan, Ron, John T. Maxwell III, Tracy Holloway King and Richard Crouch. 2004. Integrating Finite-state Technology with Deep LFG Grammars. In Proceedings of the ESSLLI04 Workshop on Combining Shallow and Deep Processing for NLP.