opennlp.tools.postag
Class POSSampleEventStream

java.lang.Object
  extended by opennlp.model.AbstractEventStream
      extended by opennlp.tools.util.AbstractEventStream<POSSample>
          extended by opennlp.tools.postag.POSSampleEventStream
All Implemented Interfaces:
opennlp.model.EventStream

public class POSSampleEventStream
extends AbstractEventStream<POSSample>

This class reads the POSSamples from the given Iterator and converts the POSSamples into Events which can be used by the maxent library for training.


Constructor Summary
POSSampleEventStream(ObjectStream<POSSample> samples)
          Initializes the current instance with given samples and a DefaultPOSContextGenerator.
POSSampleEventStream(ObjectStream<POSSample> samples, POSContextGenerator cg)
          Initializes the current instance with the given samples and the given POSContextGenerator.
 
Method Summary
protected  Iterator<opennlp.model.Event> createEvents(POSSample sample)
          Creates events for the provided sample.
static List<opennlp.model.Event> generateEvents(String[] sentence, String[] tags, POSContextGenerator cg)
           
 
Methods inherited from class opennlp.tools.util.AbstractEventStream
hasNext, 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
 

Constructor Detail

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 -
Method Detail

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 Events 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.