public class FileSentenceIterator extends BaseSentenceIterator
Modifier and Type | Field and Description |
---|---|
protected java.util.Queue<java.lang.String> |
cache |
protected java.io.File |
currentFile |
protected org.apache.commons.io.LineIterator |
currLineIterator |
protected java.io.File |
file |
protected java.util.Iterator<java.io.File> |
fileIterator |
preProcessor
Constructor and Description |
---|
FileSentenceIterator(java.io.File dir) |
FileSentenceIterator(SentencePreProcessor preProcessor,
java.io.File file)
Takes a single file or directory
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Same idea as
Iterator |
java.lang.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, setPreProcessor
protected volatile java.util.Iterator<java.io.File> fileIterator
protected volatile java.util.Queue<java.lang.String> cache
protected volatile org.apache.commons.io.LineIterator currLineIterator
protected volatile java.io.File file
protected volatile java.io.File currentFile
public FileSentenceIterator(SentencePreProcessor preProcessor, java.io.File file)
preProcessor
- the sentence pre processorfile
- the file or folder to iterate overpublic FileSentenceIterator(java.io.File dir)
public java.lang.String nextSentence()
SentenceIterator
public boolean hasNext()
SentenceIterator
Iterator
public void reset()
SentenceIterator