Package simplenlg.phrasespec

Examples of simplenlg.phrasespec.NPPhraseSpec


 
  @Test
  public void testWikipedia() {
    // test code fragments in wikipedia
    // realisation
    NPPhraseSpec subject = phraseFactory.createNounPhrase("the", "woman");
    subject.setPlural(true);
    SPhraseSpec sentence = phraseFactory.createClause(subject, "smoke");
    sentence.setFeature(Feature.NEGATED, true);
    Assert.assertEquals("The women do not smoke.", realiser.realiseSentence(sentence));

    // aggregation
View Full Code Here


    sentence.setFeature(Feature.INTERROGATIVE_TYPE, InterrogativeType.WHAT_SUBJECT);
    Assert.assertEquals("What is a ball?", realiser.realiseSentence(sentence));
   
    sentence = phraseFactory.createClause();
    sentence.setVerb("be");
    NPPhraseSpec object = phraseFactory.createNounPhrase("example");
    object.setPlural(true);
    object.addModifier("of jobs");
    sentence.setFeature(Feature.INTERROGATIVE_TYPE, InterrogativeType.WHAT_SUBJECT);
    sentence.setObject(object);
    Assert.assertEquals("What are examples of jobs?", realiser.realiseSentence(sentence));
   
    SPhraseSpec p = phraseFactory.createClause();
        NPPhraseSpec sub1 = phraseFactory.createNounPhrase("Mary");
          
        sub1.setFeature(LexicalFeature.GENDER, Gender.FEMININE);
        sub1.setFeature(Feature.PRONOMINAL, true);
        sub1.setFeature(Feature.PERSON, Person.FIRST);
        p.setSubject(sub1);
        p.setVerb("chase");
        p.setObject("the monkey");

View Full Code Here

TOP

Related Classes of simplenlg.phrasespec.NPPhraseSpec

Copyright © 2018 www.massapicom. 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.