Examples of beginPosition()


Examples of edu.stanford.nlp.ling.HasOffset.beginPosition()

    for (int j = 0; j < size - 1; j++) {
      String tag = finalTags[j];
      TaggedWord w = new TaggedWord(sent.get(j), tag);
      if (hasOffset) {
        HasOffset offset = (HasOffset) origWords.get(j);
        w.setBeginPosition(offset.beginPosition());
        w.setEndPosition(offset.endPosition());
      }
      taggedSentence.add(w);
    }
    return taggedSentence;
View Full Code Here

Examples of edu.stanford.nlp.ling.Word.beginPosition()

  public static String tokensToString(Word [] tokens) {
    StringBuilder  sb = new StringBuilder(512);
    for(int i = 0; i < tokens.length; i ++){
      if(i > 0) sb.append(" ");
      Word l = tokens[i];
      sb.append(l.word() + "{" + l.beginPosition() + ", " + l.endPosition() + "}");
    }
    return sb.toString();
  }

  // /**
 
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.