Package edu.stanford.nlp.trees

Examples of edu.stanford.nlp.trees.LabeledScoredTreeReaderFactory


  // int numSentences = 0;

  public TreeTaggedFileReader(TaggedFileRecord record) {
    filename = record.file;
    trf = record.trf == null ? new LabeledScoredTreeReaderFactory() : record.trf;
    transformer = record.treeTransformer;
    normalizer = record.treeNormalizer;
    treeFilter = record.treeFilter;

    treebank = new DiskTreebank(trf, record.encoding);
View Full Code Here


*/
public class ThreadedParserSlowITest extends TestCase {
  public static List<Tree> readTrees(String filename, String encoding) {
    ArrayList<Tree> trees = new ArrayList<Tree>();
    try {
      TreeReaderFactory trf = new LabeledScoredTreeReaderFactory();
      TreeReader tr = trf.newTreeReader(new InputStreamReader(
                        new FileInputStream(filename), encoding));
      Tree next;
      while ((next = tr.readTree()) != null) {
        trees.add(next);
      }
View Full Code Here

    File tree1Path = new File(args[0]);
    File tree2Path = new File(args[1]);

    try {
      TreeReaderFactory trf = new LabeledScoredTreeReaderFactory();
      TreeReader tR1 = trf.newTreeReader(new BufferedReader(new FileReader(tree1Path)));
      TreeReader tR2 = trf.newTreeReader(new BufferedReader(new FileReader(tree2Path)));

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

      Set<Constituent> t1Diff = markDiff(t1,t2);
View Full Code Here

    } else if(trfName.equalsIgnoreCase("CTBTreeReaderFactory")) {
      return new CTBTreeReaderFactory();
    } else if(trfName.equalsIgnoreCase("NoEmptiesCTBTreeReaderFactory")) {
      return new NoEmptiesCTBTreeReaderFactory();
    } else if(trfName.equalsIgnoreCase("Basic categories only (LabeledScoredTreeReaderFactory)")) {
      return new LabeledScoredTreeReaderFactory();
    } else if(trfName.equalsIgnoreCase("FrenchTreeReaderFactory")) {
      return new FrenchTreeReaderFactory();//PTB format
    } else if(trfName.equalsIgnoreCase("PennTreeReaderFactory")) {
      return new PennTreeReaderFactory();
    } else if(trfName.equalsIgnoreCase("StringLabeledScoredTreeReaderFactory")) {
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.trees.LabeledScoredTreeReaderFactory

Copyright © 2018 www.massapicom. 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.