Package simplenlg.framework

Examples of simplenlg.framework.ElementCategory


            .getChildren()));

      } else if (element instanceof InflectedWordElement) {
        String baseForm = ((InflectedWordElement) element)
            .getBaseForm();
        ElementCategory category = element.getCategory();

        if (this.lexicon != null && baseForm != null) {
          WordElement word = ((InflectedWordElement) element)
              .getBaseWord();
View Full Code Here


   */
  private NLGElement realisePhraseElement(PhraseElement phrase) {
    NLGElement realisedElement = null;

    if (phrase != null) {
      ElementCategory category = phrase.getCategory();

      if (category instanceof PhraseCategory) {
        switch ((PhraseCategory) category) {

        case CLAUSE:
View Full Code Here

      Periphery periph = Periphery.LEFT;

      for (int i = 0; i < children1.size(); i++) {
        NLGElement child1 = children1.get(i);
        NLGElement child2 = children2.get(i);
        ElementCategory cat1 = child1.getCategory();
        ElementCategory cat2 = child2.getCategory();
        DiscourseFunction func1 = (DiscourseFunction) child1
            .getFeature(InternalFeature.DISCOURSE_FUNCTION);
        DiscourseFunction func2 = (DiscourseFunction) child2
            .getFeature(InternalFeature.DISCOURSE_FUNCTION);
View Full Code Here

    // CoordinatedPhraseElement
    if (wps instanceof simplenlg.xmlrealiser.wrapper.XmlCoordinatedPhraseElement) {
      simplenlg.xmlrealiser.wrapper.XmlCoordinatedPhraseElement wp = (simplenlg.xmlrealiser.wrapper.XmlCoordinatedPhraseElement) wps;
      CoordinatedPhraseElement cp = new CoordinatedPhraseElement();
      ElementCategory cat = UnwrapCategory(wp.getCat());
      if (cat != null && cat instanceof PhraseCategory) {
        cp.setCategory(cat);
      }
      if (wp.getConj() != null) {
        String s = wp.getConj();
View Full Code Here

      simplenlg.xmlrealiser.wrapper.XmlWordElement wordElement) {
    if (wordElement == null) {
      return null;
    }
    LexicalCategory lexCat = LexicalCategory.ANY;
    ElementCategory cat = UnwrapCategory(wordElement.getCat());

    if (cat != null && cat instanceof LexicalCategory) {
      lexCat = (LexicalCategory) cat;
    }
View Full Code Here

  @Override
  public NLGElement realise(NLGElement element) {
    NLGElement realisedElement = null;

    if (element != null) {
      ElementCategory category = element.getCategory();

      if (category instanceof DocumentCategory
          && element instanceof DocumentElement) {
        List<NLGElement> components = ((DocumentElement) element)
            .getComponents();
View Full Code Here

   * @return
   */
  private Set<String> getVariants(WordElement word) {
    Set<String> variants = new HashSet<String>();
    variants.add(word.getBaseForm());
    ElementCategory category = word.getCategory();
    if (category instanceof LexicalCategory) {
      switch ((LexicalCategory) category) {
      case NOUN:
        variants.add(getVariant(word, LexicalFeature.PLURAL, "s"));
        break;
View Full Code Here

          .getFeatureAsElement(InternalFeature.BASE_WORD);

      if (baseWord == null && this.lexicon != null) {
        baseWord = this.lexicon.lookupWord(element.getBaseForm());
      }
      ElementCategory category = element.getCategory();
      if (category instanceof LexicalCategory) {
        switch ((LexicalCategory) category) {
        case PRONOUN:
          realisedElement = MorphologyRules
              .doPronounMorphology(element);
View Full Code Here

  public NLGElement realise(NLGElement element) {
    NLGElement realisedComponent = null;
    StringBuffer realisation = new StringBuffer();
   
    if (element != null) {
      ElementCategory category = element.getCategory();
      List<NLGElement> components = element.getChildren();

      //NB: The order of the if-statements below is important!
     
      // check if this is a canned text first
View Full Code Here

TOP

Related Classes of simplenlg.framework.ElementCategory

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.