|
||||||||||
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
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
.
clear
in interface Collection
clear
in class AbstractCollection
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
- suffix of files to loadrecursively
- descend into subdirectories as wellpublic 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()
iterator
in interface Collection
iterator
in class AbstractCollection
public abstract void apply(TreeProcessor tp)
tp
- The TreeProcessor to be appliedpublic String toString()
toString
in class AbstractCollection
public int size()
size
in interface Collection
size
in class AbstractCollection
public boolean remove(Object o)
remove
in interface Collection
remove
in class AbstractCollection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |