opennlp.tools.util
Class AbstractEventStream<T>
java.lang.Object
opennlp.model.AbstractEventStream
opennlp.tools.util.AbstractEventStream<T>
- All Implemented Interfaces:
- opennlp.model.EventStream
- Direct Known Subclasses:
- AbstractParserEventStream, DocumentCategorizerEventStream, POSSampleEventStream, SDEventStream, TokSpanEventStream
public abstract class AbstractEventStream<T>
- extends opennlp.model.AbstractEventStream
This is a base class for EventStream classes.
It takes an Iterator of sample objects as input and
outputs the events creates by a subclass.
|
Method Summary |
protected abstract Iterator<opennlp.model.Event> |
createEvents(T sample)
Creates events for the provided sample. |
boolean |
hasNext()
Checks if there are more training events available. |
opennlp.model.Event |
next()
|
| Methods inherited from class opennlp.model.AbstractEventStream |
remove |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractEventStream
public AbstractEventStream(ObjectStream<T> samples)
- Initializes the current instance with a sample
Iterator.
- Parameters:
samples - the sample Iterator.
createEvents
protected abstract Iterator<opennlp.model.Event> createEvents(T sample)
- Creates events for the provided sample.
- Parameters:
sample - the sample for which training Events
are be created.
- Returns:
- an
Iterator of training events or
an empty Iterator.
hasNext
public final boolean hasNext()
throws IOException
- Checks if there are more training events available.
- Throws:
IOException
next
public final opennlp.model.Event next()
Copyright © 2010. All Rights Reserved.