Examples of word()


Examples of edu.stanford.nlp.ling.CategoryWordTag.word()

          } else if (headChild.isLeaf()) {
            tag = cat;
            word = headChild.label().value();
          } else {
            CategoryWordTag headLabel = (CategoryWordTag) headChild.label();
            word = headLabel.word();
            tag = headLabel.tag();
          }
          Label label = new CategoryWordTag(cat, word, tag);
          t.setLabel(label);
        }
View Full Code Here

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

        CoreLabel nxt = tokens.get(i + 1);

        // trailing +
        if(crt.endPosition() == nxt.beginPosition() &&
          ! isParen(crt.word()) &&
          nxt.word().equals("+")){
          String word = crt.word() + nxt.word();
          output.add(tokenFactory.makeToken(word, crt.beginPosition(), word.length()));
          i ++;
          continue;
        }
View Full Code Here

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

        // trailing +
        if(crt.endPosition() == nxt.beginPosition() &&
          ! isParen(crt.word()) &&
          nxt.word().equals("+")){
          String word = crt.word() + nxt.word();
          output.add(tokenFactory.makeToken(word, crt.beginPosition(), word.length()));
          i ++;
          continue;
        }
View Full Code Here

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

        // trailing -
        if(crt.endPosition() == nxt.beginPosition() &&
          (i + 2 >= tokens.size() || nxt.endPosition() != tokens.get(i + 2).beginPosition()) &&
          ! isParen(crt.word()) &&
          nxt.word().equals("-")){
          String word = crt.word() + nxt.word();
          output.add(tokenFactory.makeToken(word, crt.beginPosition(), word.length()));
          i ++;
          continue;
        }
View Full Code Here

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

        // trailing -
        if(crt.endPosition() == nxt.beginPosition() &&
          (i + 2 >= tokens.size() || nxt.endPosition() != tokens.get(i + 2).beginPosition()) &&
          ! isParen(crt.word()) &&
          nxt.word().equals("-")){
          String word = crt.word() + nxt.word();
          output.add(tokenFactory.makeToken(word, crt.beginPosition(), word.length()));
          i ++;
          continue;
        }
View Full Code Here

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

        }

        // preceding -
        if(crt.endPosition() == nxt.beginPosition() &&
          (i == 0 || crt.beginPosition() != tokens.get(i - 1).endPosition()) &&
          ! isParen(nxt.word()) &&
          crt.word().equals("-")){
          String word = crt.word() + nxt.word();
          output.add(tokenFactory.makeToken(word, crt.beginPosition(), word.length()));
          i ++;
          continue;
View Full Code Here

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

        // preceding -
        if(crt.endPosition() == nxt.beginPosition() &&
          (i == 0 || crt.beginPosition() != tokens.get(i - 1).endPosition()) &&
          ! isParen(nxt.word()) &&
          crt.word().equals("-")){
          String word = crt.word() + nxt.word();
          output.add(tokenFactory.makeToken(word, crt.beginPosition(), word.length()));
          i ++;
          continue;
        }
      }
View Full Code Here

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

  private static List<CoreLabel> breakOnPattern(List<CoreLabel> tokens, Pattern pattern) {
    List<CoreLabel> output = new ArrayList<CoreLabel>();
    for (int i = 0; i < tokens.size(); i++) {
      CoreLabel token = tokens.get(i);
      Matcher matcher = pattern.matcher(token.word());
      if (matcher.find()) {
        int sepPos = matcher.start(2);
        String s1 = token.word().substring(0, sepPos);
        if(! DISCARD_STANDALONE_DASHES || ! s1.equals("-")){
          output.add(tokenFactory.makeToken(s1, token.beginPosition(), sepPos));
View Full Code Here

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

    for (int i = 0; i < tokens.size(); i++) {
      CoreLabel token = tokens.get(i);
      Matcher matcher = pattern.matcher(token.word());
      if (matcher.find()) {
        int sepPos = matcher.start(2);
        String s1 = token.word().substring(0, sepPos);
        if(! DISCARD_STANDALONE_DASHES || ! s1.equals("-")){
          output.add(tokenFactory.makeToken(s1, token.beginPosition(), sepPos));
        }
        String sep = matcher.group(2);
        if(! DISCARD_STANDALONE_DASHES || ! sep.equals("-")){
View Full Code Here

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

        }
        String sep = matcher.group(2);
        if(! DISCARD_STANDALONE_DASHES || ! sep.equals("-")){
          output.add(tokenFactory.makeToken(sep, token.beginPosition() + sepPos, 1));
        }
        String s3 = token.word().substring(sepPos + 1);
        if(! DISCARD_STANDALONE_DASHES || ! s3.equals("-")){
          output.add(tokenFactory.makeToken(s3, token.beginPosition() + sepPos + 1,
            token.endPosition() - token.beginPosition() - sepPos - 1));
        }
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.