Examples of addPostModifier()


Examples of simplenlg.framework.CoordinatedPhraseElement.addPostModifier()

    Assert.assertEquals(
        "the dog on the rock and the woman behind the curtain", //$NON-NLS-1$
        this.realiser.realise(cnp2).getRealisation());

    // complementised coordinates + outer pp modifier
    cnp2.addPostModifier(this.inTheRoom);
    Assert
        .assertEquals(
            "the dog on the rock and the woman behind the curtain in the room", //$NON-NLS-1$
            this.realiser.realise(cnp2).getRealisation());
View Full Code Here

Examples of simplenlg.framework.CoordinatedPhraseElement.addPostModifier()

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

    // adda postmodifier
    coord.addPostModifier(this.behindTheCurtain);
    Assert.assertEquals("slowly got up and fell down behind the curtain",
        this.realiser.realise(coord).getRealisation());

    // put within the context of a sentence
    SPhraseSpec s = this.phraseFactory.createClause("Jake", coord);
View Full Code Here

Examples of simplenlg.framework.PhraseElement.addPostModifier()

    _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$
    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$
View Full Code Here

Examples of simplenlg.framework.PhraseElement.addPostModifier()

    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$
    Assert.assertEquals("an angry cat in the park", this.realiser.realise( //$NON-NLS-1$
        cat).getRealisation());

  }
View Full Code Here

Examples of simplenlg.framework.PhraseElement.addPostModifier()

    clause.setFeature(Feature.CUE_PHRASE, "after two weeks,");

    // Add the 'for a fortnight' as a post modifier. Alternatively
    // this could be added as a prepositional phrase 'for' with a
    // complement of a noun phrase ('a' 'fortnight')
    clause.addPostModifier("for a fortnight");

    // Set 'be' to 'was' as past tense
    clause.setFeature(Feature.TENSE,Tense.PAST);

    // Add the clause to a sentence.
View Full Code Here

Examples of simplenlg.framework.PhraseElement.addPostModifier()

    clause.setFeature(Feature.CUE_PHRASE, "after two weeks,");

    // Add the 'for a fortnight' as a post modifier. Alternatively
    // this could be added as a prepositional phrase 'for' with a
    // complement of a noun phrase ('a' 'fortnight')
    clause.addPostModifier("for a fortnight");

    // Set 'be' to 'was' as past tense
    clause.setFeature(Feature.TENSE,Tense.PAST);
   
    // Add the clause to a sentence.
View Full Code Here

Examples of simplenlg.framework.PhraseElement.addPostModifier()

  public void testDavesHouse() {
    this.phraseFactory.setLexicon(this.lexicon);

    PhraseElement born = phraseFactory.createClause("Dave Bus", "be", "born");
    born.setFeature(Feature.TENSE,Tense.PAST);
    born.addPostModifier("in");
    born.setFeature(Feature.COMPLEMENTISER, "which");

    PhraseElement theHouse = phraseFactory.createNounPhrase("the", "house");
    theHouse.addComplement(born);
View Full Code Here

Examples of simplenlg.framework.PhraseElement.addPostModifier()

    CoordinatedPhraseElement coord1 = new CoordinatedPhraseElement(
        dave, albert);
   
    PhraseElement born = phraseFactory.createClause(coord1, "be", "born");
    born.setFeature(Feature.TENSE,Tense.PAST);
    born.addPostModifier("in");
    born.setFeature(Feature.COMPLEMENTISER, "which");

    PhraseElement theHouse = phraseFactory.createNounPhrase("the", "house");
    theHouse.addComplement(born);
View Full Code Here

Examples of simplenlg.framework.PhraseElement.addPostModifier()

   
    // Possibly progressive as well not sure.
    outer.setFeature(Feature.PROGRESSIVE,true);
   
    //Outer clause postmodifier would be 'tomorrow'
    outer.addPostModifier("tomorrow");
    DocumentElement sentence = docFactory.createSentence(outer);
    NLGElement realised = realiser.realise(sentence);
//    System.out.println(realised.getRealisation());

    // Retrieve the realisation and dump it to the console
View Full Code Here

Examples of simplenlg.framework.PhraseElement.addPostModifier()

        "I want Mary", this.realiser.realise(_s2).getRealisation()); //$NON-NLS-1$

    // test recognition of pronoun for correct form
    PhraseElement subject = this.phraseFactory.createNounPhrase("dog"); //$NON-NLS-1$
    subject.setFeature(InternalFeature.SPECIFIER, "a"); //$NON-NLS-1$
    subject.addPostModifier("from next door"); //$NON-NLS-1$
    PhraseElement object = this.phraseFactory.createNounPhrase("I"); //$NON-NLS-1$
    PhraseElement s = this.phraseFactory.createClause(subject,
        "chase", object); //$NON-NLS-1$
    s.setFeature(Feature.PROGRESSIVE, true);
    Assert.assertEquals("a dog from next door is chasing me", //$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.