Examples of lemma()


Examples of edu.stanford.nlp.ling.CoreLabel.lemma()

    for (int i = 0; i < tokens.size(); ++i) {
      CoreLabel word = tokens.get(i);
      if (i > 0) {
        osw.write(" ");
      }
      osw.write(word.lemma());
    }
    osw.write("\n");
    osw.flush();
  }
View Full Code Here

Examples of edu.stanford.nlp.ling.CoreLabel.lemma()

    assertFalse(hashCode == foo.hashCode());
    foo.setWord("foo");
    assertFalse(hashCode == foo.hashCode());

    // Hash code doesn't care between a value of null and the key not existing
    assertTrue(foo.lemma() == null);
    int lemmalessHashCode = foo.hashCode();
    foo.remove(CoreAnnotations.LemmaAnnotation.class);
    assertEquals(lemmalessHashCode, foo.hashCode());
    foo.setLemma(null);
    assertEquals(lemmalessHashCode, foo.hashCode());
View Full Code Here

Examples of edu.stanford.nlp.ling.IndexedWord.lemma()

      if(nerString.equals("O") && gr == EnglishGrammaticalRelations.NOUN_COMPOUND_MODIFIER) {
        count++;
      }

      // add possessive if not a personal determiner
      if(gr == EnglishGrammaticalRelations.POSSESSION_MODIFIER && !dict.determiners.contains(word.lemma())) {
        count++;
      }
    }
    return count;
  }
View Full Code Here

Examples of edu.stanford.nlp.ling.IndexedWord.lemma()

    }

    // check the parent
    IndexedWord parent = dependency.getParent(headIndexedWord);
    if (parent != null) {
      if(dict.modals.contains(parent.lemma())) return 1;
      // check the children of the parent (that is needed for modal auxiliaries)
      IndexedWord child = dependency.getChildWithReln(parent,EnglishGrammaticalRelations.AUX_MODIFIER);
      if(!dependency.hasParentWithReln(headIndexedWord, EnglishGrammaticalRelations.NOMINAL_SUBJECT) && child != null && dict.modals.contains(child.lemma())) return 1;
    }
View Full Code Here

Examples of edu.stanford.nlp.ling.IndexedWord.lemma()

    IndexedWord parent = dependency.getParent(headIndexedWord);
    if (parent != null) {
      if(dict.modals.contains(parent.lemma())) return 1;
      // check the children of the parent (that is needed for modal auxiliaries)
      IndexedWord child = dependency.getChildWithReln(parent,EnglishGrammaticalRelations.AUX_MODIFIER);
      if(!dependency.hasParentWithReln(headIndexedWord, EnglishGrammaticalRelations.NOMINAL_SUBJECT) && child != null && dict.modals.contains(child.lemma())) return 1;
    }

    // look at the path to root
    List<IndexedWord> path = dependency.getPathToRoot(headIndexedWord);
    if(path == null) return 0;
View Full Code Here

Examples of edu.stanford.nlp.ling.IndexedWord.lemma()

    // check adverbial clause with marker "as"
    for(IndexedWord sibling : dependency.getSiblings(headIndexedWord)) {
      if(dict.reportVerb.contains(sibling.lemma()) && dependency.hasParentWithReln(sibling,EnglishGrammaticalRelations.ADV_CLAUSE_MODIFIER)) {
        IndexedWord marker = dependency.getChildWithReln(sibling,EnglishGrammaticalRelations.MARKER);
        if (marker != null && marker.lemma().equals("as")) {
          return 1;
        }
      }
    }
View Full Code Here

Examples of edu.stanford.nlp.process.Morphology.lemma()

      }

      if (!(label instanceof HasLemma)) {
        throw new IllegalArgumentException("Got a tree with labels which do not support lemma");
      }
      ((HasLemma) label).setLemma(morphology.lemma(label.value(), tag, true));
      ++index;
    }
    return t;
  }
}
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.