Package simplenlg.aggregation

Examples of simplenlg.aggregation.ClauseCoordinationRule


   */
  public ClauseAggregationTest(String name) {
    super(name);
    aggregator = new Aggregator();
    aggregator.initialise();
    coord = new ClauseCoordinationRule();
    fcr = new ForwardConjunctionReductionRule();
    bcr = new BackwardConjunctionReductionRule();
  }
View Full Code Here


 
  @Test
  public void testRafael() {
    // Rafael Valle's tests
    List<NLGElement> ss=new ArrayList<NLGElement>();
    ClauseCoordinationRule coord = new ClauseCoordinationRule();
    coord.setFactory(this.phraseFactory);
   
    ss.add(this.agreePhrase("John Lennon")); // john lennon agreed with it 
    ss.add(this.disagreePhrase("Geri Halliwell")); // Geri Halliwell disagreed with it
    ss.add(this.commentPhrase("Melanie B")); // Mealnie B commented on it
    ss.add(this.agreePhrase("you")); // you agreed with it
    ss.add(this.commentPhrase("Emma Bunton")); //Emma Bunton commented on it

    List<NLGElement> results=coord.apply(ss);
    List<String> ret=this.realizeAll(results);
    Assert.assertEquals("[John Lennon and you agreed with it, Geri Halliwell disagreed with it, Melanie B and Emma Bunton commented on it]", ret.toString());
  }
View Full Code Here

    Assert.assertEquals("The women do not smoke.", realiser.realiseSentence(sentence));

    // aggregation
    SPhraseSpec s1 = phraseFactory.createClause("the man", "be", "hungry");
    SPhraseSpec s2 = phraseFactory.createClause("the man", "buy", "an apple");
    NLGElement result = new ClauseCoordinationRule().apply(s1, s2);
    Assert.assertEquals("The man is hungry and buys an apple.", realiser.realiseSentence(result));

  }
View Full Code Here

TOP

Related Classes of simplenlg.aggregation.ClauseCoordinationRule

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.