Package opennlp.tools.util.featuregen

# Class PrefixFeatureGenerator

java.lang.Object
opennlp.tools.util.featuregen.PrefixFeatureGenerator

All Implemented Interfaces:
  `opennlp.tools.util.featuregen.AdaptiveFeatureGenerator`

public class PrefixFeatureGenerator extends Object implements opennlp.tools.util.featuregen.AdaptiveFeatureGenerator
A feature generator implementation that generates prefix-based features.

See Also:
  - `AdaptiveFeatureGenerator`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PrefixFeatureGenerator()`
  Intializes a default `PrefixFeatureGenerator`.
  `PrefixFeatureGenerator(int prefixLength)`
  Intializes a `PrefixFeatureGenerator` with the specified `prefixLength`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `createFeatures(List<String> features, String[] tokens, int index, String[] previousOutcomes)`

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

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

  ### Methods inherited from interface opennlp.tools.util.featuregen.AdaptiveFeatureGenerator

  `clearAdaptiveData, updateAdaptiveData`

- ## Constructor Details

  - ### PrefixFeatureGenerator

    public PrefixFeatureGenerator()
    Intializes a default `PrefixFeatureGenerator`. The prefixLength length is set to the value of `DEFAULT_MAX_LENGTH`.

  - ### PrefixFeatureGenerator

    public PrefixFeatureGenerator(int prefixLength)
    Intializes a `PrefixFeatureGenerator` with the specified `prefixLength`.
    Parameters:
      `prefixLength` - The upper boundary prefix length to use.

- ## Method Details

  - ### createFeatures

    public void createFeatures(List<String> features, String[] tokens, int index, String[] previousOutcomes)
    Specified by:
      `createFeatures` in interface `opennlp.tools.util.featuregen.AdaptiveFeatureGenerator`