Examples of headTerminal()


Examples of edu.stanford.nlp.trees.Tree.headTerminal()

          // mentionSubTree = highest NP that has the same head
          Tree headTree = tree.getLeaves().get(mention.headIndex);
          if (headTree == null) { throw new RuntimeException("Missing head tree for a mention!"); }
          Tree t = headTree;
          while ((t = t.parent(tree)) != null) {
            if (t.headTerminal(headFinder) == headTree && t.value().equals("NP")) {
              mention.mentionSubTree = t;
            } else if(mention.mentionSubTree != null){
              break;
            }
          }
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.headTerminal()

      }
      if (StringUtils.isPunct(argWords.get(argWords.size() - 1))) {
        argWords.remove(argWords.size() - 1);
      }
      Tree argTree = parseStrings(argWords);
      headWordNode = argTree.headTerminal(headFinder);
      headWordIndex = getIndexByObjectEquality(argTree.getLeaves(),
          headWordNode)
          + entity.getExtentTokenStart();
      entity.setHeadTokenPosition(headWordIndex);
      entity.setHeadTokenSpan(new Span(headWordIndex, headWordIndex + 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.