Package opennlp.tools.tokenize

# Class TokenizerCrossValidator

java.lang.Object
opennlp.tools.tokenize.TokenizerCrossValidator

public class TokenizerCrossValidator extends Object
A cross validator for `tokenizers`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TokenizerCrossValidator(TrainingParameters params, TokenizerFactory factory, TokenizerEvaluationMonitor... listeners)`
  Creates a `TokenizerCrossValidator` using the given `TokenizerFactory`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `evaluate(ObjectStream<TokenSample> samples, int nFolds)`
  Starts the evaluation.
  `FMeasure`
  `getFMeasure()`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### TokenizerCrossValidator

    public TokenizerCrossValidator(TrainingParameters params, TokenizerFactory factory, TokenizerEvaluationMonitor... listeners)
    Creates a `TokenizerCrossValidator` using the given `TokenizerFactory`.
    Parameters:
      `params` - The `TrainingParameters` for the context of cross validation.
      `factory` - The `TokenizerFactory` to be used.
      `listeners` - The `evaluation listeners`.

- ## Method Details

  - ### evaluate

    public void evaluate(ObjectStream<TokenSample> samples, int nFolds) throws IOException
    Starts the evaluation.
    Parameters:
      `samples` - The `ObjectStream` of `samples` to train and test with.
      `nFolds` - Number of folds. It must be greater than zero.
    Throws:
      `IOException` - Thrown if IO errors occurred during evaluation.

  - ### getFMeasure

    public FMeasure getFMeasure()