|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--edu.stanford.nlp.trees.Treebank | +--edu.stanford.nlp.trees.DiskTreebank
A DiskTreebank
object stores merely the information to
get at a corpus of trees that is stored on disk. Access is usually
via applying a TreeProcessor to an iteration over the trees.
Constructor Summary | |
DiskTreebank()
Create a new DiskTreebank. |
|
DiskTreebank(int initialCapacity)
Create a new Treebank. |
|
DiskTreebank(int initialCapacity,
TreeReaderFactory trf)
Create a new Treebank. |
|
DiskTreebank(TreeReaderFactory trf)
Create a new DiskTreebank. |
Method Summary | |
void |
apply(TreeProcessor tp)
Applies the TreeProcessor to to all trees in the Treebank. |
void |
clear()
Empty a Treebank . |
File |
getCurrentFile()
Return the File from which trees are currently being
read by apply() , and pased to a
TreePprocessor . |
Iterator |
iterator()
Return an Iterator over Trees in the Treebank. |
void |
loadPath(File path,
FileFilter filt)
Load trees from given directory. |
static void |
main(String[] args)
Loads treebank grammar from first argument and print it. |
Methods inherited from class edu.stanford.nlp.trees.Treebank |
loadPath, loadPath, loadPath, loadPath, loadPath, remove, size, toString, 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()
public DiskTreebank(TreeReaderFactory trf)
trf
- the factory class to be called to create a new
TreeReader
public DiskTreebank(int initialCapacity)
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 Collection
clear
in class Treebank
public void loadPath(File path, FileFilter filt)
loadPath
in class Treebank
path
- file or directory to load fromfilt
- a FilenameFilter of files to loadpublic void apply(TreeProcessor tp)
apply
in class Treebank
tp
- A class that can process trees.public File getCurrentFile()
File
from which trees are currently being
read by apply()
, and pased to a
TreePprocessor
. This is useful if one wants to map
the original file and
directory structure over to a set of modified trees.
null
if no file is currently openpublic Iterator iterator()
apply()
.
iterator
in interface Collection
iterator
in class Treebank
public static void main(String[] args)
args
- array of command-line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |