public class LabelAwareListSentenceIterator extends java.lang.Object implements LabelAwareSentenceIterator
| Constructor and Description |
|---|
LabelAwareListSentenceIterator(java.io.InputStream is)
Same as calling (is,\t,0,1)
|
LabelAwareListSentenceIterator(java.io.InputStream is,
java.lang.String sep)
Same as calling (is,\t,0,1)
|
LabelAwareListSentenceIterator(java.io.InputStream is,
java.lang.String delimiter,
int labelPosition,
int textPosition)
Initializes the sentence iterator with the given args, note that this will close the input stream for you
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
currentLabel()
Returns the current label for nextSentence()
|
java.util.List<java.lang.String> |
currentLabels()
For multi label problems
|
void |
finish()
Allows for any finishing (closing of input streams or the like)
|
SentencePreProcessor |
getPreProcessor() |
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
|
void |
setPreProcessor(SentencePreProcessor preProcessor) |
public LabelAwareListSentenceIterator(java.io.InputStream is,
java.lang.String delimiter,
int labelPosition,
int textPosition)
throws java.io.IOException
is - the input stream (this will be closed)delimiter - the delimiter (tab comma,...)labelPosition - the position of the label on each linetextPosition - the position of the text on each linejava.io.IOExceptionpublic LabelAwareListSentenceIterator(java.io.InputStream is)
throws java.io.IOException
is - the input stream to read lines fromjava.io.IOExceptionpublic LabelAwareListSentenceIterator(java.io.InputStream is,
java.lang.String sep)
throws java.io.IOException
is - the input stream to read lines fromsep - the separator for the filejava.io.IOExceptionpublic java.lang.String currentLabel()
currentLabel in interface LabelAwareSentenceIteratorpublic java.util.List<java.lang.String> currentLabels()
LabelAwareSentenceIteratorcurrentLabels in interface LabelAwareSentenceIteratorpublic java.lang.String nextSentence()
nextSentence in interface SentenceIteratorpublic boolean hasNext()
IteratorhasNext in interface SentenceIteratorpublic void reset()
reset in interface SentenceIteratorpublic void finish()
finish in interface SentenceIteratorpublic SentencePreProcessor getPreProcessor()
getPreProcessor in interface SentenceIteratorpublic void setPreProcessor(SentencePreProcessor preProcessor)
setPreProcessor in interface SentenceIterator