public class UimaSentenceIterator extends BaseSentenceIterator
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
path |
protected org.apache.uima.collection.CollectionReader |
reader |
protected java.util.Iterator<java.lang.String> |
sentences |
preProcessor
Constructor and Description |
---|
UimaSentenceIterator(SentencePreProcessor preProcessor,
org.apache.uima.collection.CollectionReader cr,
UimaResource resource) |
UimaSentenceIterator(SentencePreProcessor preProcessor,
java.lang.String path,
UimaResource resource) |
UimaSentenceIterator(java.lang.String path,
UimaResource resource) |
Modifier and Type | Method and Description |
---|---|
static SentenceIterator |
createWithPath(java.lang.String path)
Creates a uima sentence iterator with the given path
|
UimaResource |
getResource() |
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
|
static org.apache.uima.analysis_engine.AnalysisEngine |
segmenter()
Return a sentence segmenter
|
finish, getPreProcessor, setPreProcessor
protected volatile org.apache.uima.collection.CollectionReader reader
protected volatile java.util.Iterator<java.lang.String> sentences
protected java.lang.String path
public UimaSentenceIterator(SentencePreProcessor preProcessor, java.lang.String path, UimaResource resource)
public UimaSentenceIterator(SentencePreProcessor preProcessor, org.apache.uima.collection.CollectionReader cr, UimaResource resource)
public UimaSentenceIterator(java.lang.String path, UimaResource resource)
public java.lang.String nextSentence()
SentenceIterator
public UimaResource getResource()
public static SentenceIterator createWithPath(java.lang.String path) throws java.lang.Exception
path
- the path to the root directory or file to read fromjava.lang.Exception
public boolean hasNext()
SentenceIterator
Iterator
public void reset()
SentenceIterator
public static org.apache.uima.analysis_engine.AnalysisEngine segmenter()