Examples of addPreModifier()


Examples of simplenlg.framework.CoordinatedPhraseElement.addPreModifier()

    //first a simple phrase with no coordinates
    CoordinatedPhraseElement coord = this.phraseFactory.createCoordinatedPhrase();
    Assert.assertEquals("", this.realiser.realise(coord).getRealisation());
   
    //now one with a premodifier and nothing else
    coord.addPreModifier(this.phraseFactory.createAdjectivePhrase("nice"));
    Assert.assertEquals("nice", this.realiser.realise(coord).getRealisation());     
  }
 
  /**
   * Test change from "a" to "an" in the presence of a premodifier with a vowel
View Full Code Here

Examples of simplenlg.framework.CoordinatedPhraseElement.addPreModifier()

    coord.setFeature(Feature.TENSE, Tense.PAST);
    Assert.assertEquals("got up and fell down", this.realiser
        .realise(coord).getRealisation());

    // add a premodifier
    coord.addPreModifier("slowly");
    Assert.assertEquals("slowly got up and fell down", this.realiser
        .realise(coord).getRealisation());

    // adda postmodifier
    coord.addPostModifier(this.behindTheCurtain);
View Full Code Here

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

Examples of simplenlg.framework.PhraseElement.addPreModifier()

  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

Examples of simplenlg.framework.PhraseElement.addPreModifier()

    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

Examples of simplenlg.framework.PhraseElement.addPreModifier()

   * 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

Examples of simplenlg.framework.PhraseElement.addPreModifier()

    _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

Examples of simplenlg.framework.PhraseElement.addPreModifier()

    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

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

   
    //check without modifiers -- article should be "a"
    Assert.assertEquals("there is a stenosis", this.realiser.realise(s).getRealisation());
   
    //add a single modifier -- should turn article to "an"
    np.addPreModifier(this.phraseFactory.createAdjectivePhrase("eccentric"));
    Assert.assertEquals("there is an eccentric stenosis", this.realiser.realise(s).getRealisation());
  }
 
  /**
   * Test for comma separation between premodifers
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

  /**
   * Test for comma separation between premodifers
   */
  public void testMultipleAdjPremodifiers() {
    NPPhraseSpec np = this.phraseFactory.createNounPhrase("a", "stenosis");
    np.addPreModifier(this.phraseFactory.createAdjectivePhrase("eccentric"));
    np.addPreModifier(this.phraseFactory.createAdjectivePhrase("discrete"));
    Assert.assertEquals("an eccentric, discrete stenosis", this.realiser.realise(np).getRealisation());       
  }
 
  /**
 
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.