Examples of PhraseElement


Examples of simplenlg.framework.PhraseElement

  }

  @Test
  public void testNovelli() {
    // Nicole Novelli's test
    PhraseElement p = this.phraseFactory.createClause(
        "Mary", "chase", "George"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    PhraseElement pp = this.phraseFactory.createPrepositionPhrase(
        "in", "the park"); //$NON-NLS-1$ //$NON-NLS-2$
    p.addPostModifier(pp);

    Assert.assertEquals("Mary chases George in the park", this.realiser //$NON-NLS-1$
        .realise(p).getRealisation());
View Full Code Here

Examples of simplenlg.framework.PhraseElement

  @Test
  public void testPiotrek() {
    // Piotrek Smulikowski's test
    this.phraseFactory.setLexicon(this.lexicon);
    PhraseElement sent = this.phraseFactory.createClause(
        "I", "shoot", "the duck"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    sent.setFeature(Feature.TENSE,Tense.PAST);

    PhraseElement loc = this.phraseFactory.createPrepositionPhrase(
        "at", "the Shooting Range"); //$NON-NLS-1$ //$NON-NLS-2$
    sent.addPostModifier(loc);
    sent.setFeature(Feature.CUE_PHRASE, "then"); //$NON-NLS-1$

    Assert.assertEquals("then I shot the duck at the Shooting Range", //$NON-NLS-1$
View Full Code Here

Examples of simplenlg.framework.PhraseElement

  @Test
  public void testPrescott() {
    // Michael Prescott's test
    this.phraseFactory.setLexicon(this.lexicon);
    PhraseElement embedded = this.phraseFactory.createClause(
        "Jill", "prod", "Spot"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    PhraseElement sent = this.phraseFactory.createClause(
        "Jack", "see", embedded); //$NON-NLS-1$ //$NON-NLS-2$
    embedded.setFeature(Feature.SUPRESSED_COMPLEMENTISER, true);
    embedded.setFeature(Feature.FORM, Form.BARE_INFINITIVE);

    Assert.assertEquals("Jack sees Jill prod Spot", this.realiser //$NON-NLS-1$
View Full Code Here

Examples of simplenlg.framework.PhraseElement

  public void testWissner() {
    // Michael Wissner's text

    setUp();

    PhraseElement p = this.phraseFactory.createClause("a wolf", "eat"); //$NON-NLS-1$ //$NON-NLS-2$
    p.setFeature(Feature.INTERROGATIVE_TYPE, InterrogativeType.WHAT_OBJECT);
    Assert.assertEquals("what does a wolf eat", this.realiser.realise(p) //$NON-NLS-1$
        .getRealisation());

  }
View Full Code Here

Examples of simplenlg.framework.PhraseElement

  public void testPhan() {
    // Thomas Phan's text

    setUp();

        PhraseElement subjectElement = phraseFactory.createNounPhrase("I");
        PhraseElement verbElement = phraseFactory.createVerbPhrase("run");

        PhraseElement prepPhrase = phraseFactory.createPrepositionPhrase("from");
        prepPhrase.addComplement("home");

        verbElement.addComplement(prepPhrase);
        SPhraseSpec newSentence = phraseFactory.createClause();
        newSentence.setSubject(subjectElement);
        newSentence.setVerbPhrase(verbElement);
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.