|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<Tree>
edu.stanford.nlp.trees.Treebank
edu.stanford.nlp.trees.TransformingTreebank
public class TransformingTreebank
This class wraps another Treebank, and will vend trees that have been through
a TreeTransformer. You can access them via requests like apply() or
iterator().
Important note: This class will only function properly if the TreeTransformer used is a function (which doesn't change its argument) rather than if it is a TreeMunger.
| Field Summary |
|---|
| Fields inherited from class edu.stanford.nlp.trees.Treebank |
|---|
DEFAULT_TREE_FILE_SUFFIX |
| Constructor Summary | |
|---|---|
TransformingTreebank()
Create a new TransformingTreebank. |
|
TransformingTreebank(Treebank tb,
TreeTransformer transformer)
Create a new TransformingTreebank from a base Treebank that will transform trees with the given TreeTransformer. |
|
TransformingTreebank(TreeReaderFactory trf)
Create a new TransformingTreebank. |
|
| Method Summary | |
|---|---|
void |
apply(TreeVisitor tv)
Applies the TreeVisitor to to all trees in the Treebank. |
void |
clear()
Empty a Treebank. |
java.util.Iterator<Tree> |
iterator()
|
void |
loadPath(java.io.File path,
java.io.FileFilter filt)
Load trees from given path specification. |
static void |
main(java.lang.String[] args)
Loads treebank grammar from first argument and prints it. |
| Methods inherited from class edu.stanford.nlp.trees.Treebank |
|---|
decimate, encoding, loadPath, loadPath, loadPath, loadPath, loadPath, remove, size, textualSummary, textualSummary, toString, transform, treeReaderFactory |
| Methods inherited from class java.util.AbstractCollection |
|---|
add, addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public TransformingTreebank()
LabeledScoredTreeReaderFactory.
Compatibility note: Until Sep 2004, this used to create a Treebank
with a SimpleTreeReaderFactory, but this was changed as the old
default wasn't very useful, especially to naive users.
public TransformingTreebank(TreeReaderFactory trf)
trf - the factory class to be called to create a new
TreeReader
public TransformingTreebank(Treebank tb,
TreeTransformer transformer)
tb - The base Treebanktransformer - The TreeTransformer applied to each Tree.| Method Detail |
|---|
public void clear()
Treebank.
clear in interface java.util.Collection<Tree>clear in class Treebank
public void loadPath(java.io.File path,
java.io.FileFilter filt)
loadPath in class Treebankpath - file or directory to load fromfilt - a FilenameFilter of files to loadpublic void apply(TreeVisitor tv)
apply in class Treebanktv - A class that can process trees.public java.util.Iterator<Tree> iterator()
iterator in interface java.lang.Iterable<Tree>iterator in interface java.util.Collection<Tree>iterator in class java.util.AbstractCollection<Tree>public static void main(java.lang.String[] args)
usage: java MemoryTreebank treebankFilesPath
args - array of command-line arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||