|
||||||||||
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.DiskSentencebank
A DiskSentencebank
object stores merely the information to
get at a corpus of sentences that is stored on disk. Access is usually
via applying a SentenceProcessor to an iteration over the sentences.
Constructor Summary | |
DiskSentencebank()
Create a new DiskSentencebank. |
|
DiskSentencebank(int initialCapacity)
Create a new Sentencebank. |
|
DiskSentencebank(int initialCapacity,
SentenceReaderFactory srf)
Create a new Sentencebank. |
|
DiskSentencebank(SentenceReaderFactory srf)
Create a new DiskSentencebank. |
Method Summary | |
void |
apply(SentenceProcessor sp)
Applies the SentenceProcessor to to all trees in the Sentencebank. |
void |
clear()
Empty a Sentencebank . |
File |
getCurrentFile()
Return the File from which trees are currently being
read by apply() , and pased to a
SentencePprocessor . |
Iterator |
iterator()
Return an Iterator over Sentences in the Sentencebank. |
void |
loadPath(File path,
FileFilter filt)
Load trees from given directory. |
static void |
main(String[] args)
Loads SentenceBank from first argument and prints it out. |
Methods inherited from class edu.stanford.nlp.trees.Sentencebank |
loadPath, loadPath, loadPath, remove, sentenceReaderFactory, size, 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 DiskSentencebank()
public DiskSentencebank(SentenceReaderFactory srf)
srf
- the factory class to be called to create a new
SentenceReader
public DiskSentencebank(int initialCapacity)
initialCapacity
- The initial size of the underlying Collection.
For a DiskSentencebank
, this parameter is ignored.public DiskSentencebank(int initialCapacity, SentenceReaderFactory srf)
initialCapacity
- The initial size of the underlying Collection,
For a DiskSentencebank
, this parameter is ignored.srf
- 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 fromfilt
- a FilenameFilter of files to loadpublic void apply(SentenceProcessor sp)
apply
in class Sentencebank
sp
- A class that can process trees.public File getCurrentFile()
File
from which trees are currently being
read by apply()
, and pased to a
SentencePprocessor
. This is useful if one wants to map
the original file and
directory structure over to a set of modified trees.
null
if no file is currently openpublic Iterator iterator()
apply()
.
iterator
in interface Collection
iterator
in class Sentencebank
public static void main(String[] args)
java edu.stanford.nlp.trees.DiskSentencebank
[-n|-w] sentencebankPath [low high]
args
- Array of command-line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |