Examples of CoordinatedPhraseElement


Examples of simplenlg.framework.CoordinatedPhraseElement

    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$

    PhraseElement verbPhrase1 = this.phraseFactory.createVerbPhrase("have"); //$NON-NLS-1$
    verbPhrase1.setFeature(Feature.TENSE,Tense.PRESENT);

    PhraseElement sentence1 = this.phraseFactory.createClause(coordNoun1,
        verbPhrase1, noun3);

    realiser.setDebugMode(true);
    Assert
        .assertEquals(
            "the patient's mother or the patient's father has one changed copy of the FGFR3 gene in every cell", //$NON-NLS-1$
            this.realiser.realise(sentence1).getRealisation());

    // Rachel's second test
    noun3 = this.phraseFactory.createNounPhrase("a", "gene test"); //$NON-NLS-1$ //$NON-NLS-2$
    noun2 = this.phraseFactory.createNounPhrase("an", "LDL test"); //$NON-NLS-1$ //$NON-NLS-2$
    noun1 = this.phraseFactory.createNounPhrase("the", "clinic"); //$NON-NLS-1$ //$NON-NLS-2$
    verbPhrase1 = this.phraseFactory.createVerbPhrase("perform"); //$NON-NLS-1$

    CoordinatedPhraseElement coord1 = new CoordinatedPhraseElement(noun2,
        noun3);
    sentence1 = this.phraseFactory.createClause(noun1, verbPhrase1, coord1);
    sentence1.setFeature(Feature.TENSE,Tense.PAST);

    Assert
View Full Code Here

Examples of simplenlg.framework.CoordinatedPhraseElement

    // conjoined test
    SPhraseSpec weather4 = this.phraseFactory.createClause("S 20-25", "back", "SSE");
    weather4.setFeature(Feature.FORM, Form.GERUND);
    weather4.getSubject().setFeature(Feature.ELIDED, true);
   
    CoordinatedPhraseElement coord = new CoordinatedPhraseElement();
    coord.addCoordinate(weather1);
    coord.addCoordinate(weather3);
    coord.addCoordinate(weather4);
    coord.setConjunction("then");
    Assert.assertEquals("SE 10-15 veering S 15-20, increasing 20-25 then backing SSE.", realiser.realiseSentence(coord));   
   

    // no verb
    SPhraseSpec weather5 = this.phraseFactory.createClause("rain", null, "likely");
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.