OnePassDataIndexer (Apache OpenNLP Tools 2.5.9 API)
Description: declaration: package: opennlp.tools.ml.model, class: OnePassDataIndexer

# Class OnePassDataIndexer

java.lang.Object
opennlp.tools.ml.model.AbstractDataIndexer
opennlp.tools.ml.model.OnePassDataIndexer

All Implemented Interfaces:
  `DataIndexer`

Direct Known Subclasses:
  `OnePassRealValueDataIndexer`

public class OnePassDataIndexer extends AbstractDataIndexer
A `DataIndexer` for maxent model data which handles cutoffs for uncommon contextual predicates and provides a unique integer index for each of the predicates.

See Also:
  - `DataIndexer`
  - `AbstractDataIndexer`

- ## Field Summary

  ### Fields inherited from class AbstractDataIndexer

  `SORT_DEFAULT, SORT_PARAM`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OnePassDataIndexer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `index(ObjectStream<Event> eventStream)`
  Performs the data indexing.

  ### Methods inherited from class AbstractDataIndexer

  `getContexts, getNumEvents, getNumTimesEventsSeen, getOutcomeLabels, getOutcomeList, getPredCounts, getPredLabels, getValues, init`

  ### Methods inherited from class Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### OnePassDataIndexer

    public OnePassDataIndexer()

- ## Method Details

  - ### index

    public void index(ObjectStream<Event> eventStream) throws IOException
    Performs the data indexing.

    Note: Make sure the `DataIndexer.init(TrainingParameters, Map)` method is called first.

    Parameters:
      `eventStream` - A `ObjectStream<Event>` of events used as input.
    Throws:
      `IOException` - Thrown if IO errors occurred during indexing.