Search in sources :

Example 1 with TransformingTreebank

use of edu.stanford.nlp.trees.TransformingTreebank in project CoreNLP by stanfordnlp.

the class FileTreeModel method addFileFolder.

/**
   * Forks off a new thread to load your files based on the filters you set in the interface
   */
public void addFileFolder(final EnumMap<FilterType, String> filters, final File[] files) {
    List<FileTreeNode> newFiles = new ArrayList<>();
    //findLoadableFiles updates newFiles
    findLoadableFiles(filters, files, newFiles, FileTreeModel.this.getRoot());
    for (FileTreeNode fileNode : newFiles) {
        Treebank treebank = new DiskTreebank(trf, curEncoding);
        treebank.loadPath(fileNode.getFile(), null, true);
        TreeTransformer transformer = TregexGUI.getInstance().transformer;
        if (transformer != null) {
            treebank = new TransformingTreebank(treebank, transformer);
        }
        fileNode.setTreebank(treebank);
    }
    // System.out.println("Loadable files are: " + newFiles);
    FileTreeModel.this.fireTreeStructureChanged(new TreePath(getRoot()));
}
Also used : DiskTreebank(edu.stanford.nlp.trees.DiskTreebank) TreePath(javax.swing.tree.TreePath) Treebank(edu.stanford.nlp.trees.Treebank) DiskTreebank(edu.stanford.nlp.trees.DiskTreebank) TransformingTreebank(edu.stanford.nlp.trees.TransformingTreebank) TransformingTreebank(edu.stanford.nlp.trees.TransformingTreebank) TreeTransformer(edu.stanford.nlp.trees.TreeTransformer)

Aggregations

DiskTreebank (edu.stanford.nlp.trees.DiskTreebank)1 TransformingTreebank (edu.stanford.nlp.trees.TransformingTreebank)1 TreeTransformer (edu.stanford.nlp.trees.TreeTransformer)1 Treebank (edu.stanford.nlp.trees.Treebank)1 TreePath (javax.swing.tree.TreePath)1