Package edu.stanford.nlp.trees

Examples of edu.stanford.nlp.trees.TreeReaderFactory


  /**
   * Removes all files from the panel
   */
  public void clearAll() {
    TreeReaderFactory oldTrf = treeModel.getTRF();//Preserve the current TRF when we refresh the tree file list
    FileTreeNode root = new FileTreeNode();
    treeModel = new FileTreeModel(root);
    setTreeReaderFactory(oldTrf);
    tree.setModel(treeModel);
    this.revalidate();
View Full Code Here


    //advanced stuff
    HeadFinder hf = Preferences.getHeadFinder();
    InputPanel.getInstance().setHeadFinder(hf);

    TreeReaderFactory trf = Preferences.getTreeReaderFactory();
    FilePanel.getInstance().setTreeReaderFactory(trf);

    String hfName = hf.getClass().getSimpleName();
    String trfName = trf.getClass().getSimpleName();
    String encoding = Preferences.getEncoding();
    if(encoding != null && !encoding.equals(""))
      FileTreeModel.setCurEncoding(encoding);
    if (PreferencesPanel.isChinese(hfName, trfName))
      setChineseFont();
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("TregexTreeReaderFactory")) {
      return new TregexPattern.TRegexTreeReaderFactory();
    } else {//try to find the class
      try {
        Class<?> trfClass = Class.forName(trfName);
        TreeReaderFactory trf = (TreeReaderFactory) trfClass.newInstance();
        return trf;
      } catch (Exception e) {
        return null;
      }
    }
View Full Code Here

    if (args.length < 2) {
      System.err.println("usage: Relation treebank numberRanges");
      return;
    }
    FileFilter testFilt = new NumberRangesFileFilter(args[1], true);
    TreeReaderFactory trf = new PennTreeReaderFactory(new NPTmpRetainingTreeNormalizer());
    DiskTreebank testTreebank = new DiskTreebank(trf);
    testTreebank.loadPath(new File(args[0]), testFilt);
    HeadFinder hf = new ModCollinsHeadFinder();
    List<Relation> relations = new ArrayList<Relation>();
    relations.addAll(Arrays.asList(SIMPLE_RELATIONS));
View Full Code Here

TOP

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

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.