Package simplenlg.framework

Examples of simplenlg.framework.PhraseElement.addPreModifier()


    sent.addPreModifier(adv);

    Assert.assertEquals("John quickly eats", this.realiser.realise(sent) //$NON-NLS-1$
        .getRealisation());

    adv.addPreModifier("very"); //$NON-NLS-1$

    Assert.assertEquals("John very quickly eats", this.realiser.realise( //$NON-NLS-1$
        sent).getRealisation());

  }
View Full Code Here


  public void testAAn() {
    PhraseElement _dog = this.phraseFactory.createNounPhrase("a", "dog"); //$NON-NLS-1$ //$NON-NLS-2$
    Assert.assertEquals("a dog", this.realiser.realise(_dog) //$NON-NLS-1$
        .getRealisation());

    _dog.addPreModifier("enormous"); //$NON-NLS-1$

    Assert.assertEquals("an enormous dog", this.realiser.realise(_dog) //$NON-NLS-1$
        .getRealisation());

    PhraseElement elephant = this.phraseFactory.createNounPhrase(
View Full Code Here

    PhraseElement elephant = this.phraseFactory.createNounPhrase(
        "a", "elephant"); //$NON-NLS-1$ //$NON-NLS-2$
    Assert.assertEquals("an elephant", this.realiser.realise(elephant) //$NON-NLS-1$
        .getRealisation());

    elephant.addPreModifier("big"); //$NON-NLS-1$
    Assert.assertEquals("a big elephant", this.realiser.realise(elephant) //$NON-NLS-1$
        .getRealisation());

    // test treating of plural specifiers
    _dog.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
View Full Code Here

   * Test Modifier "guess" placement.
   */
  @Test
  public void testModifier() {
    PhraseElement _dog = this.phraseFactory.createNounPhrase("a", "dog"); //$NON-NLS-1$ //$NON-NLS-2$
    _dog.addPreModifier("angry"); //$NON-NLS-1$

    Assert.assertEquals("an angry dog", this.realiser.realise(_dog) //$NON-NLS-1$
        .getRealisation());

    _dog.addPostModifier("in the park"); //$NON-NLS-1$
View Full Code Here

    _dog.addPostModifier("in the park"); //$NON-NLS-1$
    Assert.assertEquals("an angry dog in the park", this.realiser.realise( //$NON-NLS-1$
        _dog).getRealisation());

    PhraseElement cat = this.phraseFactory.createNounPhrase("a", "cat"); //$NON-NLS-1$ //$NON-NLS-2$
    cat.addPreModifier(this.phraseFactory.createAdjectivePhrase("angry")); //$NON-NLS-1$
    Assert.assertEquals("an angry cat", this.realiser.realise(cat) //$NON-NLS-1$
        .getRealisation());

    cat.addPostModifier(this.phraseFactory.createPrepositionPhrase(
        "in", "the park")); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    PhraseElement noun2 = this.phraseFactory.createNounPhrase(
        "the", "patient's father"); //$NON-NLS-1$ //$NON-NLS-2$

    PhraseElement noun3 = this.phraseFactory
        .createNounPhrase("changed copy"); //$NON-NLS-1$
    noun3.addPreModifier("one"); //$NON-NLS-1$
    noun3.addComplement(prep1);

    CoordinatedPhraseElement coordNoun1 = new CoordinatedPhraseElement(
        noun1, noun2);
    coordNoun1.setConjunction( "or"); //$NON-NLS-1$
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.