Examples of pennString()


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

        tree.indexSpans(0);
        logger.fine("Index spans were generated.");
      } else {
        logger.fine("Index spans were NOT generated.");
      }
      logger.fine("Parse tree using CoreLabel:\n" + tree.pennString());

      //
      // now match all entity mentions against the syntactic tree
      //
      if (sentence.get(MachineReadingAnnotations.EntityMentionsAnnotation.class) != null) {
View Full Code Here

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

    // We now let it be any kind of nominal constituent, since there
    // are VP and S ones
    ParserConstraint constraint = new ParserConstraint(ADDED_WORDS, extentTokens.size() - 1, ".*");
    List<ParserConstraint> constraints = Collections.singletonList(constraint);
    Tree tree = parse(extentTokens, constraints);
    logger.fine("No exact match found. Local parse:\n" + tree.pennString());
    convertToCoreLabels(tree);
    tree.indexSpans(ent.getExtentTokenStart() - ADDED_WORDS)// remember it has ADDED_WORDS extra words at the beginning
    Tree subtree = findPartialSpan(tree, ent.getExtentTokenStart());
    Tree extentHead = safeHead(subtree);
    logger.fine("Head is: " + extentHead);
View Full Code Here

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

    List<CoreLabel> extentTokens = new ArrayList<CoreLabel>();
    for (int i = ent.getExtentTokenStart(); i < ent.getExtentTokenEnd(); i++)
      extentTokens.add(tokens.get(i));

    Tree tree = parse(extentTokens);
    logger.fine("No exact match found. Local parse:\n" + tree.pennString());
    convertToCoreLabels(tree);
    tree.indexSpans(ent.getExtentTokenStart());
    Tree extentHead = safeHead(tree);
    assert (extentHead != null);
    // extentHead is a child in the local extent parse tree. we need to find the
View Full Code Here

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

      Tree t1 = tR1.readTree();
      Tree t2 = tR2.readTree();

      Set<Constituent> t1Diff = markDiff(t1,t2);
      System.out.println(t2.pennString());
      System.out.println();
      for(Constituent c : t1Diff)
        System.out.println(c);

View Full Code Here

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

   */
  public String getMatches() {
    StringBuilder sb = new StringBuilder();
    for(int i = 0, sz = list.getModel().getSize(); i < sz; i++) {
      Tree t = ((TreeFromFile) list.getModel().getElementAt(i)).getTree();
      sb.append(t.pennString());
      sb.append("\n\n");
    }
    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.