|
||||||||||
| 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
|
+--edu.stanford.nlp.trees.MemorySentencebank
A MemorySentencebank object stores a corpus of examples with
given sentence structures in memory (as a Collection)
| Constructor Summary | |
MemorySentencebank()
Create a new sentence bank. |
|
MemorySentencebank(int initialCapacity)
Create a new Sentencebank. |
|
MemorySentencebank(int initialCapacity,
SentenceReaderFactory srf)
Create a new sentence bank. |
|
MemorySentencebank(SentenceReaderFactory srf)
Create a new sentence bank. |
|
| Method Summary | |
void |
apply(SentenceProcessor sp)
Apply the SentenceProcessor sp to all sentences in the Sentencebank |
void |
clear()
Empty a Sentencebank. |
Object |
get(int i)
Get a sentence by index from the Sentencebank. |
Iterator |
iterator()
Return an Iterator over Sentences in the Sentencebank |
void |
loadPath(File path,
FileFilter filt)
Load sentences from given directory. |
static void |
main(String[] args)
Loads sentencebank grammar from first argument and print it. |
void |
processFile(File file)
Load a collection of parse sentences from the file of given name. |
int |
size()
Returns the size of the Sentencebank. |
| Methods inherited from class edu.stanford.nlp.trees.Sentencebank |
loadPath, loadPath, loadPath, remove, sentenceReaderFactory, toString |
| 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 MemorySentencebank()
public MemorySentencebank(SentenceReaderFactory srf)
srf - the factory class to be called to create a new
SentenceReaderpublic MemorySentencebank(int initialCapacity)
initialCapacity - The initial size of the underlying Collection,
(if a Collection-based storage mechanism is being provided)
public MemorySentencebank(int initialCapacity,
SentenceReaderFactory srf)
initialCapacity - The initial size of the underlying Collectionsrf - the factory class to be called to create a new
SentenceReader| Method Detail |
public void clear()
Sentencebank.
clear in interface Collectionclear in class Sentencebank
public void loadPath(File path,
FileFilter filt)
loadPath in class Sentencebankpath - file or directory to load frompublic void processFile(File file)
FileProcessor interface.
processFile in interface FileProcessorfile - file to load a sentence fromfor traversing directoriespublic Object get(int i)
public void apply(SentenceProcessor sp)
apply in class Sentencebanksp - The SentenceProcessor to be appliedpublic Iterator iterator()
iterator in interface Collectioniterator in class Sentencebankpublic int size()
Sentencebank
size in interface Collectionsize in class Sentencebankpublic 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 | |||||||||