|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
edu.stanford.nlp.trees.Treebank
A Treebank
object provides access to a corpus of examples with
given tree structures.
This class now implements the Collection interface. However, it may offer
less than the full power of the Collection interface: some Treebanks are
read only, and so may throw the UnsupportedOperationException.
Constructor Summary | |
Treebank()
Create a new Treebank (using a SimpleTreeReaderFactory). |
|
Treebank(int initialCapacity)
Create a new Treebank. |
|
Treebank(int initialCapacity,
TreeReaderFactory trf)
Create a new Treebank. |
|
Treebank(TreeReaderFactory trf)
Create a new Treebank. |
Method Summary | |
abstract void |
apply(TreeProcessor tp)
Apply a TreeProcessor to each tree in the Treebank. |
abstract void |
clear()
Empty a Treebank . |
abstract Iterator |
iterator()
Return an Iterator over Trees in the Treebank. |
void |
loadPath(File path)
Load a sequence of trees from given directory and its subdirectories. |
abstract void |
loadPath(File path,
FileFilter filt)
Load trees from given path specification. |
void |
loadPath(File path,
String suffix,
boolean recursively)
Load trees from given directory. |
void |
loadPath(String pathName)
Load a sequence of trees from given directory and its subdirectories. |
void |
loadPath(String pathName,
FileFilter filt)
Load a sequence of trees from given directory and its subdirectories which match the file filter. |
void |
loadPath(String pathName,
String suffix,
boolean recursively)
Load trees from given directory. |
boolean |
remove(Object o)
This operation isn't supported for a Treebank. |
int |
size()
Returns the size of the Treebank. |
String |
toString()
Return the whole treebank as a series of big bracketed lists. |
protected TreeReaderFactory |
treeReaderFactory()
Get the TreeReaderFactory for a Treebank --
this method is provided in order to make the
TreeReaderFactory available to subclasses. |
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 Treebank()
public Treebank(TreeReaderFactory trf)
trf
- the factory class to be called to create a new
TreeReader
public Treebank(int initialCapacity)
initialCapacity
- The initial size of the underlying Collection,
(if a Collection-based storage mechanism is being provided)public Treebank(int initialCapacity, TreeReaderFactory trf)
initialCapacity
- The initial size of the underlying Collection,
(if a Collection-based storage mechanism is being provided)trf
- the factory class to be called to create a new
TreeReader
Method Detail |
protected TreeReaderFactory treeReaderFactory()
TreeReaderFactory
for a Treebank
--
this method is provided in order to make the
TreeReaderFactory
available to subclasses.
public abstract void clear()
Treebank
.
public void loadPath(String pathName)
pathName
- file or directory namepublic void loadPath(File path)
path
- File specificationpublic void loadPath(String pathName, String suffix, boolean recursively)
pathName
- File or directory namesuffix
- Extension of files to load: If pathName
is a directory, then, if this is
non-null
, all and only files ending in "." followed
by this extension will be loaded; if it is null
,
all files in directories will be loaded. If pathName
is not a directory, this parameter is ignored.public void loadPath(File path, String suffix, boolean recursively)
path
- file or directory to load fromsuffix
- suffix of files to loadrecursively
- descend into subdirectories as wellpublic void loadPath(String pathName, FileFilter filt)
pathName
- file or directory namefilt
- A filter used to determine which files matchpublic abstract void loadPath(File path, FileFilter filt)
path
- file or directory to load fromfilt
- a FilenameFilter of files to loadpublic abstract Iterator iterator()
public abstract void apply(TreeProcessor tp)
tp
- The TreeProcessor to be appliedpublic String toString()
public int size()
public boolean remove(Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |