edu.stanford.nlp.trees
Class FilteringTreebank
java.lang.Object
java.util.AbstractCollection<Tree>
edu.stanford.nlp.trees.Treebank
edu.stanford.nlp.trees.FilteringTreebank
- All Implemented Interfaces:
- Iterable<Tree>, Collection<Tree>
public class FilteringTreebank
- extends Treebank
This class wraps another Treebank, and will vend trees that passed
a Filter.
- Author:
- John Bauer
| Methods inherited from class edu.stanford.nlp.trees.Treebank |
decimate, encoding, loadPath, loadPath, loadPath, loadPath, loadPath, remove, size, textualSummary, textualSummary, toString, transform, treeReaderFactory |
FilteringTreebank
public FilteringTreebank(Treebank treebank,
Filter<Tree> filter)
clear
public void clear()
- Empty a
Treebank.
- Specified by:
clear in interface Collection<Tree>- Specified by:
clear in class Treebank
loadPath
public void loadPath(File path,
FileFilter filt)
- Load trees from given path specification. Not supported for this
type of treebank.
- Specified by:
loadPath in class Treebank
- Parameters:
path - file or directory to load fromfilt - a FilenameFilter of files to load
apply
public void apply(TreeVisitor tv)
- Applies the TreeVisitor, but only to the trees that pass the
filter. Applies the visitor to a copy of the tree.
- Specified by:
apply in class Treebank
- Parameters:
tv - A class that can process trees.
iterator
public Iterator<Tree> iterator()
- Specified by:
iterator in interface Iterable<Tree>- Specified by:
iterator in interface Collection<Tree>- Specified by:
iterator in class AbstractCollection<Tree>
Stanford NLP Group