* test section 14 code
*/
@Test
public void testSection14( ) {
Lexicon lexicon = Lexicon.getDefaultLexicon( ) ; // default simplenlg lexicon
NLGFactory nlgFactory = new NLGFactory( lexicon ) ; // factory based on lexicon
Realiser realiser = new Realiser( lexicon ) ;
SPhraseSpec p1 = nlgFactory.createClause( "Mary", "chase", "the monkey" ) ;
SPhraseSpec p2 = nlgFactory.createClause( "The monkey", "fight back" ) ;
SPhraseSpec p3 = nlgFactory.createClause( "Mary", "be", "nervous" ) ;
DocumentElement s1 = nlgFactory.createSentence( p1 ) ;
DocumentElement s2 = nlgFactory.createSentence( p2 ) ;
DocumentElement s3 = nlgFactory.createSentence( p3 ) ;
DocumentElement par1 = nlgFactory.createParagraph( Arrays.asList( s1, s2, s3 ) ) ;
String output14a = realiser.realise( par1 ).getRealisation() ;
Assert.assertEquals( "Mary chases the monkey. The monkey fights back. Mary is nervous.\n\n", output14a ) ;
// actual output ~ Mary chases the monkey. The monkey fights back. Mary is nervous.
// So what exactly is JUnit not happy about?
DocumentElement section = nlgFactory.createSection( "The Trials and Tribulation of Mary and the Monkey" ) ;
section.addComponent( par1 ) ;
String output14b = realiser.realise( section ).getRealisation() ;
Assert.assertEquals( "The Trials and Tribulation of Mary and the Monkey\nMary chases the monkey. The monkey fights back. Mary is nervous.\n\n", output14b ) ;
} // testSection14