ParserCrossValidator (Apache OpenNLP Tools 2.5.9 API)
Description: declaration: package: opennlp.tools.parser, class: ParserCrossValidator

# Class ParserCrossValidator

java.lang.Object
opennlp.tools.parser.ParserCrossValidator

public class ParserCrossValidator extends Object
Cross validator for a `Parser`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ParserCrossValidator(String languageCode, TrainingParameters params, HeadRules rules, ParserType parserType, ParserEvaluationMonitor... monitors)`
  Initializes a `ParserCrossValidator` instance via given parameters.

- ## Method Summary

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

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### ParserCrossValidator

    public ParserCrossValidator(String languageCode, TrainingParameters params, HeadRules rules, ParserType parserType, ParserEvaluationMonitor... monitors)
    Initializes a `ParserCrossValidator` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `params` - The `TrainingParameters` for the context of cross validation.
      `rules` - The `HeadRules` for the context of cross validation.
      `parserType` - The `ParserType` for the context of cross validation.
      `monitors` - the `evaluation listeners`.

- ## Method Details

  - ### evaluate

    public void evaluate(ObjectStream<Parse> 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.
      `IllegalStateException` - Thrown if the currently active `ParserType` is not supported.

  - ### getFMeasure

    public FMeasure getFMeasure()