Package opennlp.tools.util.featuregen

# Class InSpanGenerator

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

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

@ThreadSafe public class InSpanGenerator extends Object implements opennlp.tools.util.featuregen.AdaptiveFeatureGenerator
Generates features if the tokens are recognized by the provided `TokenNameFinder`.

See Also:
  - `AdaptiveFeatureGenerator`
  - `TokenNameFinder`
  - `Span`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InSpanGenerator(String prefix, opennlp.tools.namefind.TokenNameFinder finder)`
  Initializes a `InSpanGenerator` instance.

- ## Method Summary

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

  ### 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

  - ### InSpanGenerator

    public InSpanGenerator(String prefix, opennlp.tools.namefind.TokenNameFinder finder)
    Initializes a `InSpanGenerator` instance.
    Parameters:
      `prefix` - The prefix is used to distinguish the generated features from features generated by other instances of `InSpanGenerator`. Must not be `null`.
      `finder` - The `TokenNameFinder` used to detect the names. Must not be `null`.

- ## Method Details

  - ### createFeatures

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