use of edu.stanford.nlp.trees.DiskTreebank 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()));
}
Aggregations