|
||||||||||
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.Sentencebank
A Sentencebank
object provides access to a corpus of
sentences -- just plain sentences or tagged sentences, etc.
This class implements the Collection interface, but in a read-only way.
Constructor Summary | |
Sentencebank()
Create a new Sentencebank. |
|
Sentencebank(int initialCapacity)
Create a new Sentencebank. |
|
Sentencebank(int initialCapacity,
SentenceReaderFactory srf)
Create a new Sentencebank. |
|
Sentencebank(SentenceReaderFactory srf)
Create a new Sentencebank. |
Method Summary | |
abstract void |
apply(SentenceProcessor tp)
Apply a SentenceProcessor to each tree in the Sentencebank |
abstract void |
clear()
Empty a Sentencebank . |
abstract Iterator |
iterator()
Return an Iterator over Sentences in the Sentencebank |
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. |
boolean |
remove(Object o)
This operation isn't supported for a Sentencebank. |
protected SentenceReaderFactory |
sentenceReaderFactory()
Get the SentenceReaderFactory for a
Sentencebank -- this method is provided in order to
make the
SentenceReaderFactory available to subclasses. |
int |
size()
Returns the size of the Sentencebank. |
String |
toString()
Return the whole treebank as a series of big bracketed lists. |
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 |
add, addAll, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray |
Constructor Detail |
public Sentencebank()
public Sentencebank(SentenceReaderFactory srf)
srf
- the factory class to be called to create a new
SentenceReader
public Sentencebank(int initialCapacity)
initialCapacity
- The initial size of the underlying Collection,
(if a Collection-based storage mechanism is being provided)public Sentencebank(int initialCapacity, SentenceReaderFactory srf)
initialCapacity
- The initial size of the underlying Collection,
(if a Collection-based storage mechanism is being provided)Method Detail |
protected SentenceReaderFactory sentenceReaderFactory()
SentenceReaderFactory
for a
Sentencebank
-- this method is provided in order to
make the
SentenceReaderFactory
available to subclasses.
public abstract void clear()
Sentencebank
.
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(File path, String suffix, boolean recursively)
path
- file or directory to load fromsuffix
- suffix of files to loadrecursively
- descend into subdirectories as wellpublic abstract void loadPath(File path, FileFilter filt)
path
- file or directory to load frompublic abstract void apply(SentenceProcessor tp)
tp
- The SentenceProcessor to be appliedpublic abstract Iterator iterator()
iterator
in interface Collection
iterator
in class AbstractCollection
public 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 |