public class BasicLineIterator extends java.lang.Object implements SentenceIterator, java.lang.Iterable<java.lang.String>
| Constructor and Description |
|---|
BasicLineIterator(java.io.File file) |
BasicLineIterator(java.io.InputStream stream) |
BasicLineIterator(java.lang.String filePath) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize() |
void |
finish()
Allows for any finishing (closing of input streams or the like)
|
SentencePreProcessor |
getPreProcessor() |
boolean |
hasNext()
Same idea as
Iterator |
java.util.Iterator<java.lang.String> |
iterator()
Implentation for Iterable interface.
|
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
|
void |
setPreProcessor(SentencePreProcessor preProcessor) |
public BasicLineIterator(@NonNull
java.io.File file)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic BasicLineIterator(@NonNull
java.io.InputStream stream)
public BasicLineIterator(@NonNull
java.lang.String filePath)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic java.lang.String nextSentence()
SentenceIteratornextSentence in interface SentenceIteratorpublic boolean hasNext()
SentenceIteratorIteratorhasNext in interface SentenceIteratorpublic void reset()
SentenceIteratorreset in interface SentenceIteratorpublic void finish()
SentenceIteratorfinish in interface SentenceIteratorpublic SentencePreProcessor getPreProcessor()
getPreProcessor in interface SentenceIteratorpublic void setPreProcessor(SentencePreProcessor preProcessor)
setPreProcessor in interface SentenceIteratorprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.util.Iterator<java.lang.String> iterator()
iterator in interface java.lang.Iterable<java.lang.String>