// simple coordination of complementised nps
this.dog.clearComplements();
this.woman.clearComplements();
CoordinatedPhraseElement cnp1 = new CoordinatedPhraseElement(this.dog,
this.woman);
cnp1.setFeature(Feature.RAISE_SPECIFIER, true);
NLGElement realised = this.realiser.realise(cnp1);
Assert.assertEquals("the dog and woman", realised.getRealisation());
this.dog.addComplement(this.onTheRock);
this.woman.addComplement(this.behindTheCurtain);
CoordinatedPhraseElement cnp2 = new CoordinatedPhraseElement(this.dog,
this.woman);
this.woman.setFeature(InternalFeature.RAISED, false);
Assert.assertEquals(
"the dog on the rock and the woman behind the curtain", //$NON-NLS-1$
this.realiser.realise(cnp2).getRealisation());
// complementised coordinates + outer pp modifier
cnp2.addPostModifier(this.inTheRoom);
Assert
.assertEquals(
"the dog on the rock and the woman behind the curtain in the room", //$NON-NLS-1$
this.realiser.realise(cnp2).getRealisation());
// set the specifier for this cnp; should unset specifiers for all inner
// coordinates
NLGElement every = this.phraseFactory.createWord(
"every", LexicalCategory.DETERMINER); //$NON-NLS-1$
cnp2.setFeature(InternalFeature.SPECIFIER, every);
Assert
.assertEquals(
"every dog on the rock and every woman behind the curtain in the room", //$NON-NLS-1$
this.realiser.realise(cnp2).getRealisation());
// pronominalise one of the constituents
this.dog.setFeature(Feature.PRONOMINAL, true); // ="it"
this.dog.setFeature(InternalFeature.SPECIFIER, this.phraseFactory
.createWord("the", LexicalCategory.DETERMINER));
// raising spec still returns true as spec has been set
cnp2.setFeature(Feature.RAISE_SPECIFIER, true);
// CNP should be realised with pronominal internal const
Assert.assertEquals(
"it and every woman behind the curtain in the room", //$NON-NLS-1$
this.realiser.realise(cnp2).getRealisation());