// passive with subject and indirect object
SPhraseSpec _s2 = this.phraseFactory.createClause(null, "give", //$NON-NLS-1$
this.phraseFactory.createNounPhrase("the", "baby")); //$NON-NLS-1$ //$NON-NLS-2$
PhraseElement morphine = this.phraseFactory
.createNounPhrase("50ug of morphine"); //$NON-NLS-1$
_s2.setIndirectObject(morphine);
_s2.setFeature(Feature.PASSIVE, true);
Assert.assertEquals("the baby is given 50ug of morphine", //$NON-NLS-1$
this.realiser.realise(_s2).getRealisation());
// passive with subject, complement and indirect object
_s2 = this.phraseFactory.createClause(this.phraseFactory
.createNounPhrase("the", "nurse"), "give", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
this.phraseFactory.createNounPhrase("the", "baby")); //$NON-NLS-1$ //$NON-NLS-2$
morphine = this.phraseFactory.createNounPhrase("50ug of morphine"); //$NON-NLS-1$
_s2.setIndirectObject(morphine);
_s2.setFeature(Feature.PASSIVE, true);
Assert.assertEquals("the baby is given 50ug of morphine by the nurse", //$NON-NLS-1$
this.realiser.realise(_s2).getRealisation());
// test agreement in passive
PhraseElement _s3 = this.phraseFactory.createClause(
new CoordinatedPhraseElement("my dog", "your cat"), "chase", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"George"); //$NON-NLS-1$
_s3.setFeature(Feature.TENSE, Tense.PAST);
_s3.addFrontModifier("yesterday"); //$NON-NLS-1$
Assert.assertEquals("yesterday my dog and your cat chased George", //$NON-NLS-1$
this.realiser.realise(_s3).getRealisation());
_s3 = this.phraseFactory.createClause(new CoordinatedPhraseElement(
"my dog", "your cat"), "chase", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
this.phraseFactory.createNounPhrase("George")); //$NON-NLS-1$
_s3.setFeature(Feature.TENSE, Tense.PAST);
_s3.addFrontModifier("yesterday"); //$NON-NLS-1$
_s3.setFeature(Feature.PASSIVE, true);
Assert.assertEquals(
"yesterday George was chased by my dog and your cat", //$NON-NLS-1$
this.realiser.realise(_s3).getRealisation());
// test correct pronoun forms
PhraseElement _s4 = this.phraseFactory.createClause(this.phraseFactory
.createNounPhrase("he"), "chase", //$NON-NLS-1$ //$NON-NLS-2$
this.phraseFactory.createNounPhrase("I")); //$NON-NLS-1$
Assert.assertEquals("he chases me", this.realiser.realise(_s4) //$NON-NLS-1$
.getRealisation());
_s4 = this.phraseFactory
.createClause(
this.phraseFactory.createNounPhrase("he"), "chase", this.phraseFactory.createNounPhrase("me")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
_s4.setFeature(Feature.PASSIVE, true);
Assert
.assertEquals(
"I am chased by him", this.realiser.realise(_s4).getRealisation()); //$NON-NLS-1$
// same thing, but giving the S constructor "me". Should recognise
// correct pro
// anyway
PhraseElement _s5 = this.phraseFactory
.createClause("him", "chase", "I"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Assert.assertEquals(
"he chases me", this.realiser.realise(_s5).getRealisation()); //$NON-NLS-1$
_s5 = this.phraseFactory.createClause("him", "chase", "I"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
_s5.setFeature(Feature.PASSIVE, true);
Assert
.assertEquals(
"I am chased by him", this.realiser.realise(_s5).getRealisation()); //$NON-NLS-1$
}