Package simplenlg.framework

Examples of simplenlg.framework.NLGElement


   *            the current realisation of the clause.
   */
  private static ListElement realiseSubjects(PhraseElement phrase,
      SyntaxProcessor parent) {

    NLGElement currentElement = null;
    ListElement realisedElement = new ListElement();

    for (NLGElement subject : phrase
        .getFeatureAsElementList(InternalFeature.SUBJECTS)) {

View Full Code Here


   *         split the verb
   */
  private static NLGElement realiseInterrogative(PhraseElement phrase,
      SyntaxProcessor parent, ListElement realisedElement,
      NLGFactory phraseFactory, NLGElement verbElement) {
    NLGElement splitVerb = null;

    if (phrase.getParent() != null) {
      phrase.getParent().setFeature(InternalFeature.INTERROGATIVE, true);
    }

View Full Code Here

   * Elide the leftmost consitutents in the phrase list, that is, all phrases
   * except the rightmost.
   */
  public void elideLeftmost() {
    for (int i = this.phrases.size() - 2; i >= 0; i--) {
      NLGElement phrase = this.phrases.get(i);

      if (phrase != null) {
        phrase.setFeature(Feature.ELIDED, true);
      }
    }
  }
View Full Code Here

   *         split the verb
   */
  private static NLGElement realiseObjectWHInterrogative(String keyword,
      PhraseElement phrase, SyntaxProcessor parent,
      ListElement realisedElement, NLGFactory phraseFactory) {
    NLGElement splitVerb = null;
    realiseInterrogativeKeyWord(keyword, LexicalCategory.PRONOUN, parent, realisedElement, //$NON-NLS-1$
        phraseFactory);

    // if (!Tense.FUTURE.equals(phrase.getFeature(Feature.TENSE)) &&
    // !copular) {
View Full Code Here

  private static void realiseInterrogativeKeyWord(String keyWord,
      LexicalCategory cat, SyntaxProcessor parent,
      ListElement realisedElement, NLGFactory phraseFactory) {

    if (keyWord != null) {
      NLGElement question = phraseFactory.createWord(keyWord, cat);
      NLGElement currentElement = parent.realise(question);

      if (currentElement != null) {
        realisedElement.addComponent(currentElement);
      }
    }
View Full Code Here

   */
  public boolean lemmaIdentical() {
    boolean ident = !this.phrases.isEmpty();

    for (int i = 1; i < this.phrases.size() && ident; i++) {
      NLGElement left = this.phrases.get(i - 1);
      NLGElement right = this.phrases.get(i);
     
     
      if (left != null && right != null) {       
        NLGElement leftHead = left.getFeatureAsElement(InternalFeature.HEAD);
        NLGElement rightHead = right.getFeatureAsElement(InternalFeature.HEAD);       
        ident = (leftHead == rightHead || leftHead.equals(rightHead));
      }
    }

    return ident;
View Full Code Here

   */
  private static NLGElement realiseYesNo(PhraseElement phrase,
      SyntaxProcessor parent, NLGElement verbElement,
      NLGFactory phraseFactory, ListElement realisedElement) {

    NLGElement splitVerb = null;

    if (!(verbElement instanceof VPPhraseSpec && VerbPhraseHelper
        .isCopular(((VPPhraseSpec) verbElement).getVerb()))
        && !phrase.getFeatureAsBoolean(Feature.PROGRESSIVE)
            .booleanValue()
View Full Code Here

   */
  public boolean formIdentical() {
    boolean ident = !this.phrases.isEmpty();

    for (int i = 1; i < this.phrases.size() && ident; i++) {
      NLGElement left = this.phrases.get(i - 1);
      NLGElement right = this.phrases.get(i);

      if (left != null && right != null) {
        ident = left.equals(right);
      }
    }
View Full Code Here

   *            the current realisation of the clause.
   */
  private static void addCuePhrase(PhraseElement phrase,
      SyntaxProcessor parent, ListElement realisedElement) {

    NLGElement currentElement = parent.realise(phrase
        .getFeatureAsElement(Feature.CUE_PHRASE));

    if (currentElement != null) {
      currentElement.setFeature(InternalFeature.DISCOURSE_FUNCTION,
          DiscourseFunction.CUE_PHRASE);
      realisedElement.addComponent(currentElement);
    }
  }
View Full Code Here

   *            the current realisation of the clause.
   */
  private static void addComplementiser(PhraseElement phrase,
      SyntaxProcessor parent, ListElement realisedElement) {

    NLGElement currentElement;

    if (ClauseStatus.SUBORDINATE.equals(phrase
        .getFeature(InternalFeature.CLAUSE_STATUS))
        && !phrase
            .getFeatureAsBoolean(Feature.SUPRESSED_COMPLEMENTISER)
View Full Code Here

TOP

Related Classes of simplenlg.framework.NLGElement

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.