*/
private NLGElement doMorphology(InflectedWordElement element) {
NLGElement realisedElement = null;
if (element.getFeatureAsBoolean(InternalFeature.NON_MORPH)
.booleanValue()) {
realisedElement = new StringElement(element.getBaseForm());
realisedElement.setFeature(InternalFeature.DISCOURSE_FUNCTION,
element.getFeature(InternalFeature.DISCOURSE_FUNCTION));
} else {
NLGElement baseWord = element
.getFeatureAsElement(InternalFeature.BASE_WORD);
if (baseWord == null && this.lexicon != null) {
baseWord = this.lexicon.lookupWord(element.getBaseForm());
}
ElementCategory category = element.getCategory();
if (category instanceof LexicalCategory) {
switch ((LexicalCategory) category) {
case PRONOUN:
realisedElement = MorphologyRules
.doPronounMorphology(element);
break;
case NOUN:
realisedElement = MorphologyRules.doNounMorphology(element,
(WordElement) baseWord);
break;
case VERB:
realisedElement = MorphologyRules.doVerbMorphology(element,
(WordElement) baseWord);
break;
case ADJECTIVE:
realisedElement = MorphologyRules.doAdjectiveMorphology(
element, (WordElement) baseWord);
break;
case ADVERB:
realisedElement = MorphologyRules.doAdverbMorphology(
element, (WordElement) baseWord);
break;
default:
realisedElement = new StringElement(element.getBaseForm());
realisedElement
.setFeature(
InternalFeature.DISCOURSE_FUNCTION,
element
.getFeature(InternalFeature.DISCOURSE_FUNCTION));