Package simplenlg.framework

Examples of simplenlg.framework.StringElement


    // add a premodifier the coordinate phrase, yielding
    // "seriously and undeniably incredibly salacious or amazingly beautiful
    // and stunning"
    CoordinatedPhraseElement preMod = new CoordinatedPhraseElement(
        new StringElement("seriously"), new StringElement("undeniably")); //$NON-NLS-1$//$NON-NLS-2$

    coord2.addPreModifier(preMod);
    Assert
        .assertEquals(
            "seriously and undeniably incredibly salacious or amazingly beautiful and stunning", //$NON-NLS-1$
View Full Code Here


    DocumentElement sentence = nlgFactory              // create a sentence DocumentElement from SPhraseSpec
        .createSentence(johnGoToThePark);

    // below creates a sentence DocumentElement by concatenating strings
    StringElement hePlayed = new StringElement("he played");       
    StringElement there = new StringElement("there");
    WordElement football = new WordElement("football");

    DocumentElement sentence2 = nlgFactory.createSentence();
    sentence2.addComponent(hePlayed);
    sentence2.addComponent(football);
View Full Code Here

    } else {
      realised.append(baseForm);
    }

    checkPossessive(element, realised);
    StringElement realisedElement = new StringElement(realised.toString());
    realisedElement.setFeature(InternalFeature.DISCOURSE_FUNCTION, element
        .getFeature(InternalFeature.DISCOURSE_FUNCTION));
    return realisedElement;
  }
View Full Code Here

        }
      } else {
        realised = baseForm;
      }
    }
    StringElement realisedElement = new StringElement(realised);
    realisedElement.setFeature(InternalFeature.DISCOURSE_FUNCTION, element
        .getFeature(InternalFeature.DISCOURSE_FUNCTION));
    return realisedElement;
  }
View Full Code Here

        }
      }
    } else {
      realised = baseForm;
    }
    StringElement realisedElement = new StringElement(realised);
    realisedElement.setFeature(InternalFeature.DISCOURSE_FUNCTION, element
        .getFeature(InternalFeature.DISCOURSE_FUNCTION));
    return realisedElement;
  }
View Full Code Here

        realised = buildRegularSuperlative(baseForm);
      }
    } else {
      realised = baseForm;
    }
    StringElement realisedElement = new StringElement(realised);
    realisedElement.setFeature(InternalFeature.DISCOURSE_FUNCTION, element
        .getFeature(InternalFeature.DISCOURSE_FUNCTION));
    return realisedElement;
  }
View Full Code Here

      }
      realised = PRONOUNS[numberIndex][positionIndex][personIndex];
    } else {
      realised = element.getBaseForm();
    }
    StringElement realisedElement = new StringElement(realised);
    realisedElement.setFeature(InternalFeature.DISCOURSE_FUNCTION, element
        .getFeature(InternalFeature.DISCOURSE_FUNCTION));

    return realisedElement;
  }
View Full Code Here

          }
        }       
      }
    }
   
    return new StringElement(realisation.toString());
  }
View Full Code Here

  private static void pushParticles(PhraseElement phrase,
      SyntaxProcessor parent, Stack<NLGElement> vgComponents) {
    Object particle = phrase.getFeature(Feature.PARTICLE);

    if (particle instanceof String) {
      vgComponents.push(new StringElement((String) particle));

    } else if (particle instanceof NLGElement) {
      vgComponents.push(parent.realise((NLGElement) particle));
    }
  }
View Full Code Here

        } else {
          realiseList(buffer, element.getChildren(), "");
        }

        // realiseList(buffer, element.getChildren(), "");
        realisedElement = new StringElement(buffer.toString());

      } else if (element instanceof CoordinatedPhraseElement) {
        realisedElement = realiseCoordinatedPhrase(element
            .getChildren());
View Full Code Here

TOP

Related Classes of simplenlg.framework.StringElement

Copyright © 2018 www.massapicom. 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.