*/
private static NLGElement createPronoun(SyntaxProcessor parent,
PhraseElement phrase) {
String pronoun = "it"; //$NON-NLS-1$
NLGFactory phraseFactory = phrase.getFactory();
Object personValue = phrase.getFeature(Feature.PERSON);
if (Person.FIRST.equals(personValue)) {
pronoun = "I"; //$NON-NLS-1$
} else if (Person.SECOND.equals(personValue)) {
pronoun = "you"; //$NON-NLS-1$
} else {
Object genderValue = phrase.getFeature(LexicalFeature.GENDER);
if (Gender.FEMININE.equals(genderValue)) {
pronoun = "she"; //$NON-NLS-1$
} else if (Gender.MASCULINE.equals(genderValue)) {
pronoun = "he"; //$NON-NLS-1$
}
}
// AG: createWord now returns WordElement; so we embed it in an
// inflected word element here
NLGElement element;
NLGElement proElement = phraseFactory.createWord(pronoun,
LexicalCategory.PRONOUN);
if (proElement instanceof WordElement) {
element = new InflectedWordElement((WordElement) proElement);
element.setFeature(LexicalFeature.GENDER, ((WordElement) proElement).getFeature(LexicalFeature.GENDER));