opennlp.tools.postag
Class POSSampleEventStream
java.lang.Object
opennlp.model.AbstractEventStream
opennlp.tools.util.AbstractEventStream<POSSample>
opennlp.tools.postag.POSSampleEventStream
- All Implemented Interfaces:
- opennlp.model.EventStream
public class POSSampleEventStream
- extends AbstractEventStream<POSSample>
This class reads the POSSample
s from the given Iterator
and converts the POSSample
s into Event
s which
can be used by the maxent library for training.
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 |
POSSampleEventStream
public POSSampleEventStream(ObjectStream<POSSample> samples,
POSContextGenerator cg)
- Initializes the current instance with the given samples and the
given
POSContextGenerator
.
- Parameters:
samples
- cg
-
POSSampleEventStream
public POSSampleEventStream(ObjectStream<POSSample> samples)
- Initializes the current instance with given samples
and a
DefaultPOSContextGenerator
.
- Parameters:
samples
-
createEvents
protected Iterator<opennlp.model.Event> createEvents(POSSample sample)
- Description copied from class:
AbstractEventStream
- Creates events for the provided sample.
- Specified by:
createEvents
in class AbstractEventStream<POSSample>
- Parameters:
sample
- the sample for which training Event
s
are be created.
- Returns:
- an
Iterator
of training events or
an empty Iterator
.
generateEvents
public static List<opennlp.model.Event> generateEvents(String[] sentence,
String[] tags,
POSContextGenerator cg)
Copyright © 2010. All Rights Reserved.