|
||||||||||
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
SentenceReader
public 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 Collection
clear
in class Sentencebank
public void loadPath(File path, FileFilter filt)
loadPath
in class Sentencebank
path
- file or directory to load frompublic void processFile(File file)
FileProcessor
interface.
processFile
in interface FileProcessor
file
- file to load a sentence fromfor traversing directories
public Object get(int i)
public void apply(SentenceProcessor sp)
apply
in class Sentencebank
sp
- The SentenceProcessor to be appliedpublic Iterator iterator()
iterator
in interface Collection
iterator
in class Sentencebank
public int size()
Sentencebank
size
in interface Collection
size
in class Sentencebank
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 |