public abstract class MorphologyRules extends NLGModule
This abstract class contains a number of rules for doing simple inflection.
As a matter of course, the processor will first use any user-defined inflection for the world. If no inflection is provided then the lexicon, if it exists, will be examined for the correct inflection. Failing this a set of very basic rules will be examined to inflect the word.
All processing modules perform realisation on a tree of
NLGElements. The modules can alter the tree in whichever way
they wish. For example, the syntax processor replaces phrase elements with
list elements consisting of inflected words while the morphology processor
replaces inflected words with string elements.
N.B. the use of module, processing module and processor is interchangeable. They all mean an instance of this class.
| Constructor and Description |
|---|
MorphologyRules() |
| Modifier and Type | Method and Description |
|---|---|
static NLGElement |
doAdjectiveMorphology(InflectedWordElement element,
WordElement baseWord)
This method performs the morphology for adjectives.
|
static NLGElement |
doAdverbMorphology(InflectedWordElement element,
WordElement baseWord)
This method performs the morphology for adverbs.
|
static void |
doDeterminerMorphology(NLGElement determiner,
String realisation)
This method performs the morphology for determiners.
|
protected static StringElement |
doNounMorphology(InflectedWordElement element,
WordElement baseWord)
This method performs the morphology for nouns.
|
static NLGElement |
doPronounMorphology(InflectedWordElement element)
This method performs the morphology for pronouns.
|
protected static NLGElement |
doVerbMorphology(InflectedWordElement element,
WordElement baseWord)
This method performs the morphology for verbs.
|
getLexicon, initialise, realise, realise, setLexiconprotected static StringElement doNounMorphology(InflectedWordElement element, WordElement baseWord)
element - the InflectedWordElement.baseWord - the WordElement as created from the lexicon
entry.StringElement representing the word after
inflection.protected static NLGElement doVerbMorphology(InflectedWordElement element, WordElement baseWord)
element - the InflectedWordElement.baseWord - the WordElement as created from the lexicon
entry.StringElement representing the word after
inflection.public static NLGElement doAdjectiveMorphology(InflectedWordElement element, WordElement baseWord)
element - the InflectedWordElement.baseWord - the WordElement as created from the lexicon
entry.StringElement representing the word after
inflection.public static NLGElement doAdverbMorphology(InflectedWordElement element, WordElement baseWord)
element - the InflectedWordElement.baseWord - the WordElement as created from the lexicon
entry.StringElement representing the word after
inflection.public static NLGElement doPronounMorphology(InflectedWordElement element)
element - the InflectedWordElement.StringElement representing the word after
inflection.public static void doDeterminerMorphology(NLGElement determiner, String realisation)
determiner - the InflectedWordElement.realisation - the current realisation of the determiner.Copyright © 2020. All Rights Reserved.