Examples of word()


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

        for (int j = 1, size = tokens.size(); j <= size; ++j)
        {
          CoreLabel token = tokens.get(j - 1);
          output.printf("%d\t%s\t_\t%s\t%s\t_\t%d\t%s\t_\t_%n",
                  j, token.word(), token.tag(), token.tag(),
                  token.get(CoreAnnotations.CoNLLDepParentIndexAnnotation.class),
                  token.get(CoreAnnotations.CoNLLDepTypeAnnotation.class));
        }
        output.println();
      }
View Full Code Here

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

  protected List<ParserConstraint> constraints = null;

  private CoreLabel getCoreLabel(int labelIndex) {
    if (originalCoreLabels[labelIndex] != null) {
      CoreLabel terminalLabel = originalCoreLabels[labelIndex];
      if (terminalLabel.value() == null && terminalLabel.word() != null) {
        terminalLabel.setValue(terminalLabel.word());
      }
      return terminalLabel;
    }
View Full Code Here

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

  private CoreLabel getCoreLabel(int labelIndex) {
    if (originalCoreLabels[labelIndex] != null) {
      CoreLabel terminalLabel = originalCoreLabels[labelIndex];
      if (terminalLabel.value() == null && terminalLabel.word() != null) {
        terminalLabel.setValue(terminalLabel.word());
      }
      return terminalLabel;
    }

    String wordStr = wordIndex.get(words[labelIndex]);
View Full Code Here

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

      extentTokens.add(initCoreLabel("was"));
      final int ADDED_WORDS = 2;
      for (int i = m.startIndex; i < endIdx; i++) {
        // Add everything except separated dashes! The separated dashes mess with the parser too badly.
        CoreLabel label = tokens.get(i);
        if ( ! "-".equals(label.word())) {
          extentTokens.add(tokens.get(i));
        } else {
          approximateness++;
        }
      }
View Full Code Here

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

        String NERType = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);
        String currentType = token.get(CoreAnnotations.AnswerAnnotation.class);

        if (
            currentType != null ||
            (exact != null && ! (ignoreCase ? exact.equalsIgnoreCase(token.word()) : exact.equals(token.word()))) ||
            ! (entry.overwritableTypes.contains(NERType) || myLabels.contains(NERType))  ||
            ! pattern.matcher(token.word()).matches()  // last, as this is likely the expensive operation
            ) {
          failed = true;
          break;
View Full Code Here

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

        String NERType = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);
        String currentType = token.get(CoreAnnotations.AnswerAnnotation.class);

        if (
            currentType != null ||
            (exact != null && ! (ignoreCase ? exact.equalsIgnoreCase(token.word()) : exact.equals(token.word()))) ||
            ! (entry.overwritableTypes.contains(NERType) || myLabels.contains(NERType))  ||
            ! pattern.matcher(token.word()).matches()  // last, as this is likely the expensive operation
            ) {
          failed = true;
          break;
View Full Code Here

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

        if (
            currentType != null ||
            (exact != null && ! (ignoreCase ? exact.equalsIgnoreCase(token.word()) : exact.equals(token.word()))) ||
            ! (entry.overwritableTypes.contains(NERType) || myLabels.contains(NERType))  ||
            ! pattern.matcher(token.word()).matches()  // last, as this is likely the expensive operation
            ) {
          failed = true;
          break;
        }
      }
View Full Code Here

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

    if (tokens.isEmpty()) {
      return "";
    }

    CoreLabel lastToken = tokens.get(0);
    StringBuilder buffer = new StringBuilder(lastToken.word());

    for (int i = 1; i < tokens.size(); i++) {
      CoreLabel currentToken = tokens.get(i);
      int numSpaces = currentToken.beginPosition() - lastToken.endPosition();
      if (numSpaces < 0) {
View Full Code Here

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

      int numSpaces = currentToken.beginPosition() - lastToken.endPosition();
      if (numSpaces < 0) {
        numSpaces = 0;
      }

      buffer.append(repeat(' ', numSpaces)).append(currentToken.word());
      lastToken = currentToken;
    }

    return buffer.toString();
  }
View Full Code Here

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

          StringBuilder word = new StringBuilder();
          //wsg: Feb 2010 - Appears to support character-level parsing
          for (int i = start; i < end; i++) {
            if (sentence.get(i) instanceof HasWord) {
              HasWord cl = sentence.get(i);
              word.append(cl.word());
            } else {
              word.append(sentence.get(i).toString());
            }
          }
          for (int state = 0; state < numStates; state++) {
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.