Examples of realiseSentence()


Examples of simplenlg.realiser.english.Realiser.realiseSentence()

      SPhraseSpec p = nlgFactory.createClause( ) ;
      p.setSubject( subject ) ;
      p.setVerb( verb ) ;
      p.setObject( object ) ;
     
      String outputA = realiser.realiseSentence( p ) ;
      Assert.assertEquals( "Fast Mary chases the monkey.", outputA ) ;
     
      verb.addModifier( "quickly" ) ;
     
      String outputB = realiser.realiseSentence( p ) ;
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

      String outputA = realiser.realiseSentence( p ) ;
      Assert.assertEquals( "Fast Mary chases the monkey.", outputA ) ;
     
      verb.addModifier( "quickly" ) ;
     
      String outputB = realiser.realiseSentence( p ) ;
      Assert.assertEquals( "Fast Mary quickly chases the monkey.", outputB ) ;
     } // testSection8
 
  // there is no code specified in section 9
 
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

      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" ) ;
     
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

      // 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 ) ;
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

      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
 
  /**
   * test section 11 code
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

    Realiser realiser = new Realiser( lexicon ) ;
   
    SPhraseSpec pA = nlgFactory.createClause( "Mary", "chase", "the monkey" ) ;
    pA.addComplement( "in the park" ) ;
   
    String outputA = realiser.realiseSentence( pA ) ;   
    Assert.assertEquals( "Mary chases the monkey in the park.", outputA ) ;
   
    // alternative build paradigm
    NPPhraseSpec place = nlgFactory.createNounPhrase( "park" ) ;
    SPhraseSpec pB = nlgFactory.createClause( "Mary", "chase", "the monkey" ) ;
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

    pp.addComplement( place ) ;
    pp.setPreposition( "in" ) ;
   
    pB.addComplement( pp ) ;
   
    String outputB = realiser.realiseSentence( pB ) ;   
    Assert.assertEquals( "Mary chases the monkey in park.", outputB ) // NB missing the determiner "the" !! 
   
    place.addPreModifier( "leafy" ) ;
   
    String outputC = realiser.realiseSentence( pB ) ;   
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

    String outputB = realiser.realiseSentence( pB ) ;   
    Assert.assertEquals( "Mary chases the monkey in park.", outputB ) // NB missing the determiner "the" !! 
   
    place.addPreModifier( "leafy" ) ;
   
    String outputC = realiser.realiseSentence( pB ) ;   
    Assert.assertEquals( "Mary chases the monkey in leafy park.", outputC ) // NB missing the determiner "the" !! 
   } // testSection11

  // section12 only has a code table as illustration
 
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

    CoordinatedPhraseElement c = nlgFactory.createCoordinatedPhrase( ) ;
    c.addCoordinate( s1 ) ;
    c.addCoordinate( s2 ) ; // gives the wrong result ~ should be 'bones' but get 'bone' !
    c.addCoordinate( s3 ) ;
   
    String outputA = realiser.realiseSentence( c ) ;
    Assert.assertEquals( "My cat likes fish, my dog likes big bones and my horse likes grass.", outputA ) ;
   
    SPhraseSpec p = nlgFactory.createClause( "I", "be""happy" ) ;
    SPhraseSpec q = nlgFactory.createClause( "I", "eat", "fish" ) ;
    q.setFeature( Feature.COMPLEMENTISER, "because" ) ;
View Full Code Here

Examples of simplenlg.realiser.english.Realiser.realiseSentence()

    SPhraseSpec q = nlgFactory.createClause( "I", "eat", "fish" ) ;
    q.setFeature( Feature.COMPLEMENTISER, "because" ) ;
    q.setFeature( Feature.TENSE, Tense.PAST ) ;
    p.addComplement( q ) ;
   
    String outputB = realiser.realiseSentence( p ) ;
    Assert.assertEquals( "I am happy because I ate fish.", outputB ) ;
  } // testSection13
 
  /**
   * test section 14 code
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.