|
|||||||||
| 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.DiskTreebank
public final class DiskTreebank
A DiskTreebank is a Collection of
Trees.
A DiskTreebank object stores merely the information to
get at a corpus of trees that is stored on disk. Access is usually
via apply()'ing a TreeVisitor to each Tree in the Treebank or by using
an iterator() to get an iteration over the Trees.
| Field Summary |
|---|
| Fields inherited from class edu.stanford.nlp.trees.Treebank |
|---|
DEFAULT_TREE_FILE_SUFFIX |
| Constructor Summary | |
|---|---|
DiskTreebank()
Create a new DiskTreebank. |
|
DiskTreebank(int initialCapacity)
Create a new Treebank. |
|
DiskTreebank(int initialCapacity,
TreeReaderFactory trf)
Create a new Treebank. |
|
DiskTreebank(java.lang.String encoding)
Create a new treebank, set the encoding for file access. |
|
DiskTreebank(TreeReaderFactory trf)
Create a new DiskTreebank. |
|
DiskTreebank(TreeReaderFactory trf,
java.lang.String encoding)
Create a new DiskTreebank. |
|
| Method Summary | |
|---|---|
void |
apply(TreeVisitor tp)
Applies the TreeVisitor to to all trees in the Treebank. |
void |
clear()
Empty a Treebank. |
java.lang.String |
getCurrentFilename()
Returns the absolute path of the file currently being read. |
java.util.List<java.io.File> |
getCurrentPaths()
|
java.util.Iterator<Tree> |
iterator()
Return an Iterator over Trees in the Treebank. |
void |
loadPath(java.io.File path,
java.io.FileFilter filt)
Load trees from given directory. |
void |
printFileNames()
|
| 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 DiskTreebank()
LabeledScoredTreeReaderFactory.
public DiskTreebank(java.lang.String encoding)
encoding - The charset encoding to use for treebank file decodingpublic DiskTreebank(TreeReaderFactory trf)
trf - the factory class to be called to create a new
TreeReader
public DiskTreebank(TreeReaderFactory trf,
java.lang.String encoding)
trf - the factory class to be called to create a new
TreeReaderencoding - The charset encoding to use for treebank file decodingpublic DiskTreebank(int initialCapacity)
LabeledScoredTreeReaderFactory.
initialCapacity - The initial size of the underlying Collection.
For a DiskTreebank, this parameter is ignored.
public DiskTreebank(int initialCapacity,
TreeReaderFactory trf)
initialCapacity - The initial size of the underlying Collection,
For a DiskTreebank, this parameter is ignored.trf - the factory class to be called to create a new
TreeReader| 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 tp)
apply in class Treebanktp - A class that can process trees.public java.lang.String getCurrentFilename()
public java.util.List<java.io.File> getCurrentPaths()
public void printFileNames()
public java.util.Iterator<Tree> iterator()
apply().
iterator in interface java.lang.Iterable<Tree>iterator in interface java.util.Collection<Tree>iterator in class java.util.AbstractCollection<Tree>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||