Examples of pennPrint()


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

          tree = subcategoryStripper.transformTree(tree);
        }

        if (pw != null) {
          if (parse) {
            tree.pennPrint(pw);
          } else {
            Iterator sentIter = s.iterator();
            for (; ;) {
              Word word = (Word) sentIter.next();
              pw.print(word.word());
View Full Code Here

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

      // TODO: somehow merge this into ParserQuery instead of being
      // LexicalizedParserQuery specific
      LexicalizedParserQuery pq = lp.lexicalizedParserQuery();
      pq.parse(lr);
      Tree t = pq.getBestParse();
      t.pennPrint();
    }
    //lr.processLattice();
  }

  public static class LatticeWord implements Comparable<LatticeWord> {
View Full Code Here

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

              Tree tb = sot.object();
              Tree tbd = debinarizer.transformTree(tb);
              tbd = subcategoryStripper.transformTree(tbd);
              pq.restoreOriginalWords(tbd);
              pwOut.println("PCFG Parse #" + iii + " with score " + tbd.score());
              tbd.pennPrint(pwOut);
              Tree tbtr = collinizer.transformTree(tbd);
              // pwOut.println("Tree size = " + tbtr.size() + "; depth = " + tbtr.depth());
              kGoodLB.evaluate(tbtr, transGoldTree, pwErr);
            }
          }
View Full Code Here

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

          int i = 0;
          for (ScoredObject<Tree> tp : trees) {
            i++;
            pwOut.println("PCFG Parse #" + i + " with score " + tp.score());
            Tree tbd = tp.object();
            tbd.pennPrint(pwOut);
            Tree tbtr = collinizer.transformTree(tbd);
            kGoodLB.evaluate(tbtr, transGoldTree, pwErr);
          }
        }
        // Chart parser (factored) n-best list
View Full Code Here

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

          int ii = 0;
          for (ScoredObject<Tree> tp : trees) {
            ii++;
            pwOut.println("Factored Parse #" + ii + " with score " + tp.score());
            Tree tbd = tp.object();
            tbd.pennPrint(pwOut);
            Tree tbtr = collinizer.transformTree(tbd);
            kGoodLB.evaluate(tbtr, transGoldTree, pwOut);
          }
        }
        //1-best output
View Full Code Here

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

    for (Tree tree : annotatedTrees) {
      System.out.println("ORIGINAL:\n");
      tree.pennPrint();
      System.out.println("CNFed:\n");
      Tree cnfTree = new ToCNFTransformer().transformTree(tree);
      cnfTree.pennPrint();
      System.out.println("UnCNFed:\n");
      Tree unCNFTree = new FromCNFTransformer().transformTree(cnfTree);
      unCNFTree.pennPrint();
      System.out.println("\n\n");
    }
View Full Code Here

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

      System.out.println("CNFed:\n");
      Tree cnfTree = new ToCNFTransformer().transformTree(tree);
      cnfTree.pennPrint();
      System.out.println("UnCNFed:\n");
      Tree unCNFTree = new FromCNFTransformer().transformTree(cnfTree);
      unCNFTree.pennPrint();
      System.out.println("\n\n");
    }
  }

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.