Examples of addPreModifier()


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());       
  }
 
  /**
   * Test for comma separation between verb premodifiers
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

    String verb = "associate";
    VPPhraseSpec adjP = this.phraseFactory.createVerbPhrase(verb);
    adjP.setFeature(Feature.TENSE, Tense.PAST);
   
    NPPhraseSpec np = this.phraseFactory.createNounPhrase("a", "thrombus");
    np.addPreModifier(adjP);
    String realised = this.realiser.realise(np).getRealisation();
    System.out.println(realised);
    // cch TESTING The following line doesn't work when the lexeme is a
    // verb.
    // morphP.preMod.Add(new AdjPhraseSpec((Lexeme)modifier));
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

  /**
   * Further tests for a/an agreement with coordinated premodifiers
   */
  public void testAAnCoord() {
    NPPhraseSpec _dog = this.phraseFactory.createNounPhrase("a", "dog");
    _dog.addPreModifier(this.phraseFactory.createCoordinatedPhrase("enormous", "black"));
    String realisation = this.realiser.realise(_dog).getRealisation();
    Assert.assertEquals("an enormous and black dog", realisation);
  }
 
  /**
 
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

  public void testAgreement() {

    // basic agreement
    NPPhraseSpec np = this.phraseFactory.createNounPhrase("dog"); //$NON-NLS-1$
    np.setSpecifier("the"); //$NON-NLS-1$
    np.addPreModifier("angry"); //$NON-NLS-1$
    PhraseElement _s1 = this.phraseFactory
        .createClause(np, "chase", "John"); //$NON-NLS-1$ //$NON-NLS-2$
    Assert.assertEquals("the angry dog chases John", this.realiser //$NON-NLS-1$
        .realise(_s1).getRealisation());
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

        .realise(_s1).getRealisation());

    // plural
    np = this.phraseFactory.createNounPhrase("dog"); //$NON-NLS-1$
    np.setSpecifier("the"); //$NON-NLS-1$
    np.addPreModifier("angry"); //$NON-NLS-1$
    np.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
    _s1 = this.phraseFactory.createClause(np, "chase", "John"); //$NON-NLS-1$ //$NON-NLS-2$
    Assert.assertEquals("the angry dogs chase John", this.realiser //$NON-NLS-1$
        .realise(_s1).getRealisation());
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

    Assert.assertEquals("the angry dogs chase John", this.realiser //$NON-NLS-1$
        .realise(_s1).getRealisation());

    // test agreement with "there is"
    np = this.phraseFactory.createNounPhrase("dog"); //$NON-NLS-1$
    np.addPreModifier("angry"); //$NON-NLS-1$
    np.setFeature(Feature.NUMBER, NumberAgreement.SINGULAR);
    np.setSpecifier("a"); //$NON-NLS-1$
    PhraseElement _s2 = this.phraseFactory.createClause("there", "be", np); //$NON-NLS-1$ //$NON-NLS-2$
    Assert.assertEquals("there is an angry dog", this.realiser //$NON-NLS-1$
        .realise(_s2).getRealisation());
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

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

    // plural with "there"
    np = this.phraseFactory.createNounPhrase("dog"); //$NON-NLS-1$
    np.addPreModifier("angry"); //$NON-NLS-1$
    np.setSpecifier("a"); //$NON-NLS-1$
    np.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
    _s2 = this.phraseFactory.createClause("there", "be", np); //$NON-NLS-1$ //$NON-NLS-2$
    Assert.assertEquals("there are some angry dogs", this.realiser //$NON-NLS-1$
        .realise(_s2).getRealisation());
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

    VPPhraseSpec vp1 = this.phraseFactory.createVerbPhrase(this.lexicon
        .getWord("have", LexicalCategory.VERB));
    NPPhraseSpec np1 = this.phraseFactory.createNounPhrase("a",
        this.lexicon.getWord("contrast media reaction",
            LexicalCategory.NOUN));
    np1.addPreModifier(this.lexicon.getWord("adverse",
        LexicalCategory.ADJECTIVE));
    vp1.addComplement(np1);

    // second VP
    VPPhraseSpec vp2 = this.phraseFactory.createVerbPhrase(this.lexicon
View Full Code Here

Examples of simplenlg.phrasespec.NPPhraseSpec.addPreModifier()

    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 ) ;   
    Assert.assertEquals( "Mary chases the monkey in leafy park.", outputC ) // NB missing the determiner "the" !! 
   } // testSection11
View Full Code Here

Examples of simplenlg.phrasespec.SPhraseSpec.addPreModifier()

    Assert.assertEquals(
        "Jake slowly got up and fell down behind the curtain",
        this.realiser.realise(s).getRealisation());

    // add premod to the sentence
    s.addPreModifier(this.lexicon
        .getWord("however", LexicalCategory.ADVERB));
    Assert.assertEquals(
        "Jake however slowly got up and fell down behind the curtain",
        this.realiser.realise(s).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.