* phrase directly.
*/
@Test
public void testCoordinateVPComplexSubject() {
// "As a result of the procedure the patient had an adverse contrast media reaction and went into cardiogenic shock."
SPhraseSpec s = this.phraseFactory.createClause();
s.setSubject(this.phraseFactory.createNounPhrase("the", "patient"));
// first VP
VPPhraseSpec vp1 = this.phraseFactory.createVerbPhrase(this.lexicon
.getWord("have", LexicalCategory.VERB));
NPPhraseSpec np1 = this.phraseFactory.createNounPhrase("a",
this.lexicon.getWord("contrast media reaction",
LexicalCategory.NOUN));
np1.addPreModifier(this.lexicon.getWord("adverse",
LexicalCategory.ADJECTIVE));
vp1.addComplement(np1);
// second VP
VPPhraseSpec vp2 = this.phraseFactory.createVerbPhrase(this.lexicon
.getWord("go", LexicalCategory.VERB));
PPPhraseSpec pp = this.phraseFactory
.createPrepositionPhrase("into", this.lexicon.getWord(
"cardiogenic shock", LexicalCategory.NOUN));
vp2.addComplement(pp);
// coordinate
CoordinatedPhraseElement coord = this.phraseFactory
.createCoordinatedPhrase(vp1, vp2);
coord.setFeature(Feature.TENSE, Tense.PAST);
Assert
.assertEquals(
"had an adverse contrast media reaction and went into cardiogenic shock",
this.realiser.realise(coord).getRealisation());
// now put this in the sentence
s.setVerbPhrase(coord);
s.addFrontModifier("As a result of the procedure");
Assert
.assertEquals(
"As a result of the procedure the patient had an adverse contrast media reaction and went into cardiogenic shock",
this.realiser.realise(s).getRealisation());