Examples of originalText()


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

  protected String recoverOriginalText(List<CoreLabel> tokens, CoreNLPProtos.Sentence sentence) {
    StringBuilder text = new StringBuilder();
    CoreLabel last = null;
    if (tokens.size() > 0) {
      CoreLabel token = tokens.get(0);
      if (token.originalText() != null) { text.append(token.originalText()); } else { text.append(token.word()); }
      last = tokens.get(0);
    }
    for (int i = 1; i < tokens.size(); ++i) {
      CoreLabel token = tokens.get(i);
      if (token.before() != null) {
View Full Code Here

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

  protected String recoverOriginalText(List<CoreLabel> tokens, CoreNLPProtos.Sentence sentence) {
    StringBuilder text = new StringBuilder();
    CoreLabel last = null;
    if (tokens.size() > 0) {
      CoreLabel token = tokens.get(0);
      if (token.originalText() != null) { text.append(token.originalText()); } else { text.append(token.word()); }
      last = tokens.get(0);
    }
    for (int i = 1; i < tokens.size(); ++i) {
      CoreLabel token = tokens.get(i);
      if (token.before() != null) {
View Full Code Here

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

        while (missingWhitespace > 0) {
          text.append(' ');
          missingWhitespace -= 1;
        }
      }
      if (token.originalText() != null) { text.append(token.originalText()); } else { text.append(token.word()); }
      last = token;
    }
    return text.toString();
  }
}
View Full Code Here

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

        while (missingWhitespace > 0) {
          text.append(' ');
          missingWhitespace -= 1;
        }
      }
      if (token.originalText() != null) { text.append(token.originalText()); } else { text.append(token.word()); }
      last = token;
    }
    return text.toString();
  }
}
View Full Code Here

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

      throw new IllegalArgumentException("Only operates on CoreLabels");
    }
    CoreLabel childLabel = (CoreLabel) child.label();

    // Morphological Analysis
    String morphStr = childLabel.originalText();
    if (morphStr == null || morphStr.equals("")) {
      morphStr = label.value();
      // POS subcategory
      String subCat = childLabel.category();
      if (subCat != null && subCat != "") {
View Full Code Here

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

        coreLabel.setValue(escapedLemma);
        coreLabel.setLemma(lemma);
      }

      if (addMorphoToLeaves) {
        String morphStr = coreLabel.originalText();
        if(morphStr == null || morphStr.equals("")) {
          morphStr = MorphoFeatureSpecification.NO_ANALYSIS;
        } else {
          ++nMorphAnalyses;
        }
View Full Code Here

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

        List<Label> yield = tree1.yield();
        int yieldLen = yield.size();
        for (int i = 0; i < yieldLen; ++i) {
          CoreLabel rawToken = (CoreLabel) yield.get(i);
          String word = rawToken.value();
          String morphStr = rawToken.originalText();
          Pair<String,String> lemmaMorph = MorphoFeatureSpecification.splitMorphString(word, morphStr);
          String lemma = lemmaMorph.first();
          String morph = lemmaMorph.second();
          if (morph == null || morph.equals("") || morph.equals("XXX")) {
            morph = ((CoreLabel) pretermYield.get(i)).value();
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.