*/
@Test
public void testSection10( ) {
Lexicon lexicon = Lexicon.getDefaultLexicon( ) ; // default simplenlg lexicon
NLGFactory nlgFactory = new NLGFactory( lexicon ) ; // factory based on lexicon
Realiser realiser = new Realiser( lexicon ) ;
NPPhraseSpec subject1 = nlgFactory.createNounPhrase( "Mary" ) ;
NPPhraseSpec subject2 = nlgFactory.createNounPhrase( "your", "giraffe" ) ;
// next line is not correct ~ should be nlgFactory.createCoordinatedPhrase ~ may be corrected in the API
CoordinatedPhraseElement subj = nlgFactory.createCoordinatedPhrase( subject1, subject2 ) ;
VPPhraseSpec verb = nlgFactory.createVerbPhrase( "chase" ) ; ;
SPhraseSpec p = nlgFactory.createClause( ) ;
p.setSubject( subj ) ;
p.setVerb( verb ) ;
p.setObject( "the monkey" ) ;
String outputA = realiser.realiseSentence( p ) ;
Assert.assertEquals( "Mary and your giraffe chase the monkey.", outputA ) ;
NPPhraseSpec object1 = nlgFactory.createNounPhrase( "the monkey" ) ;
NPPhraseSpec object2 = nlgFactory.createNounPhrase( "George" ) ;
// next line is not correct ~ should be nlgFactory.createCoordinatedPhrase ~ may be corrected in the API
CoordinatedPhraseElement obj = nlgFactory.createCoordinatedPhrase( object1, object2 ) ;
obj.addCoordinate( "Martha" ) ;
p.setObject( obj ) ;
String outputB = realiser.realiseSentence( p ) ;
Assert.assertEquals( "Mary and your giraffe chase the monkey, George and Martha.", outputB ) ;
obj.setFeature( Feature.CONJUNCTION, "or" ) ;
String outputC = realiser.realiseSentence( p ) ;
Assert.assertEquals( "Mary and your giraffe chase the monkey, George or Martha.", outputC ) ;
} // testSection10