public class FileSentenceIterator extends BaseSentenceIterator
| Modifier and Type | Field and Description |
|---|---|
protected Queue<String> |
cache |
protected File |
currentFile |
protected org.apache.commons.io.LineIterator |
currLineIterator |
protected File |
file |
protected Iterator<File> |
fileIterator |
preProcessor| Constructor and Description |
|---|
FileSentenceIterator(File dir) |
FileSentenceIterator(SentencePreProcessor preProcessor,
File file)
Takes a single file or directory
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Same idea as
Iterator |
String |
nextSentence()
Gets the next sentence or null
if there's nothing left (Do yourself a favor and
check hasNext() )
|
void |
reset()
Resets the iterator to the beginning
|
finish, getPreProcessor, setPreProcessorprotected volatile org.apache.commons.io.LineIterator currLineIterator
protected volatile File file
protected volatile File currentFile
public FileSentenceIterator(SentencePreProcessor preProcessor, File file)
preProcessor - the sentence pre processorfile - the file or folder to iterate overpublic FileSentenceIterator(File dir)
public String nextSentence()
SentenceIteratorpublic boolean hasNext()
SentenceIteratorIteratorpublic void reset()
SentenceIteratorCopyright © 2014. All rights reserved.