Class BasicLineIterator
- java.lang.Object
-
- org.deeplearning4j.text.sentenceiterator.BasicLineIterator
-
- All Implemented Interfaces:
Iterable<String>,SentenceIterator
public class BasicLineIterator extends Object implements SentenceIterator, Iterable<String>
-
-
Constructor Summary
Constructors Constructor Description BasicLineIterator(@NonNull File file)BasicLineIterator(@NonNull InputStream stream)BasicLineIterator(@NonNull String filePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinalize()voidfinish()Allows for any finishing (closing of input streams or the like)SentencePreProcessorgetPreProcessor()booleanhasNext()Same idea asIteratorIterator<String>iterator()Implentation for Iterable interface.StringnextSentence()Gets the next sentence or null if there's nothing left (Do yourself a favor and check hasNext() )voidreset()Resets the iterator to the beginningvoidsetPreProcessor(SentencePreProcessor preProcessor)-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
BasicLineIterator
public BasicLineIterator(@NonNull @NonNull File file) throws FileNotFoundException- Throws:
FileNotFoundException
-
BasicLineIterator
public BasicLineIterator(@NonNull @NonNull InputStream stream)
-
BasicLineIterator
public BasicLineIterator(@NonNull @NonNull String filePath) throws FileNotFoundException- Throws:
FileNotFoundException
-
-
Method Detail
-
nextSentence
public String nextSentence()
Description copied from interface:SentenceIteratorGets the next sentence or null if there's nothing left (Do yourself a favor and check hasNext() )- Specified by:
nextSentencein interfaceSentenceIterator- Returns:
- the next sentence in the iterator
-
hasNext
public boolean hasNext()
Description copied from interface:SentenceIteratorSame idea asIterator- Specified by:
hasNextin interfaceSentenceIterator- Returns:
- whether there's anymore sentences left
-
reset
public void reset()
Description copied from interface:SentenceIteratorResets the iterator to the beginning- Specified by:
resetin interfaceSentenceIterator
-
finish
public void finish()
Description copied from interface:SentenceIteratorAllows for any finishing (closing of input streams or the like)- Specified by:
finishin interfaceSentenceIterator
-
getPreProcessor
public SentencePreProcessor getPreProcessor()
- Specified by:
getPreProcessorin interfaceSentenceIterator
-
setPreProcessor
public void setPreProcessor(SentencePreProcessor preProcessor)
- Specified by:
setPreProcessorin interfaceSentenceIterator
-
finalize
protected void finalize() throws Throwable
-
-