Examples of lemma()


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

    // feat.incrementCount("TAG-" + l.tag());
    int window = 0;
    for (int j = Math.max(0, i - window); j < i; j++) {
      CoreLabel lj = sent[j];
      feat.incrementCount("PREV-" + "WORD-" + lj.word());
      feat.incrementCount("PREV-" + "LEMMA-" + lj.lemma());
      feat.incrementCount("PREV-" + "TAG-" + lj.tag());
    }

    for (int j = i + 1; j < sent.length && j <= i + window; j++) {
      CoreLabel lj = sent[j];
View Full Code Here

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

    }

    for (int j = i + 1; j < sent.length && j <= i + window; j++) {
      CoreLabel lj = sent[j];
      feat.incrementCount("NEXT-" + "WORD-" + lj.word());
      feat.incrementCount("NEXT-" + "LEMMA-" + lj.lemma());
      feat.incrementCount("NEXT-" + "TAG-" + lj.tag());
    }


    // System.out.println("adding " + l.word() + " as " + label);
View Full Code Here

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

             
              if (label == null || l.get(constVars.getAnswerClass().get(label)) == null || !l.get(constVars.getAnswerClass().get(label)).equals(label.toString())) {
                useWordNotLabeled = true;
              }
              phrase += " " + l.word();
              phraseLemma += " " + l.lemma();
              addedindices[i-s] = true;
            }
          }
        }
       
View Full Code Here

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

        for (E index : patternsLearnedThisIter.keySet()) {

          if (p1.contains(index)) {
            if (token == null)
              token = sentEn.getValue().get(en.getKey());
            wordsandLemmaPatExtracted.incrementCount(new Pair<String, String>(token.word(), token.lemma()), index);
          }
        }
      }
    }
  }
View Full Code Here

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

          // for (int j = Math.max(i - maxWin, 0); j < i; j++) {
          CoreLabel tokenj = sent.get(j);

          String tokenjStr;
          if (useLemmaContextTokens)
            tokenjStr = tokenj.lemma();
          else
            tokenjStr = tokenj.word();

          // do not use this word in context consideration
          if (useFillerWordsInPat
View Full Code Here

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

          // for (int j = i + 1; j < sent.size() && j <= i + maxWin; j++) {
          CoreLabel tokenj = sent.get(j);

          String tokenjStr;
          if (useLemmaContextTokens)
            tokenjStr = tokenj.lemma();
          else
            tokenjStr = tokenj.word();

          // do not use this word in context consideration
          if (useFillerWordsInPat
View Full Code Here

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

                    || !l.get(constVars.getAnswerClass().get(label)).equals(
                        label.toString())) {
                  useWordNotLabeled = true;
                }
                phrase += " " + l.word();
                phraseLemma += " " + l.lemma();
                addedindices[i-s] = true;
              }
            }
          }
          for(int i =0; i < addedindices.length; i++){
View Full Code Here

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

              if ((Boolean) token.get(igCl)) {
                negToken = true;
                break;
              }
            if (!negToken)
              if (constVars.getOtherSemanticClassesWords().contains(token.word()) || constVars.getOtherSemanticClassesWords().contains(token.lemma()))
                negToken = true;

            for (E sindex : pats) {
              //E s = constVars.patternIndex.get(sindex);
              if (negToken) {
View Full Code Here

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

      if (!(label instanceof CoreLabel)) {
        throw new IllegalArgumentException("Only works with CoreLabels trees");
      }

      CoreLabel coreLabel = (CoreLabel) label;
      String lemma = coreLabel.lemma();
      //PTB escaping since we're going to put this in the leaf
      if (lemma == null) {
        // No lemma, so just add the surface form
        lemma = coreLabel.word();
      } else if (lemma.equals("(")) {
View Full Code Here

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

        int yieldLen = yield.size();
        for (int i = 0; i < yieldLen; ++i) {
          CoreLabel tokenAnalysis = analysis.get(i);
          Label token = yield.get(i);
          String lemma = getLemma(token.value(), tokenAnalysis.lemma());
          String newLeaf = String.format("%s%s%s%s%s", token.value(),
              MorphoFeatureSpecification.MORPHO_MARK,
              lemma,
              MorphoFeatureSpecification.LEMMA_MARK,
              tokenAnalysis.tag());
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.