FeatureGenerator (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.doccat

## Interface FeatureGenerator

- All Known Implementing Classes:
    BagOfWordsFeatureGenerator, NGramFeatureGenerator

      public interface FeatureGenerator

  Interface for generating features for document categorization.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<String>` | `extractFeatures(String[] text, Map<String,Object> extraInformation)` Extract features from given text fragments

- - ### Method Detail

    - #### extractFeatures

          Collection<String> extractFeatures(String[] text,
                                             Map<String,Object> extraInformation)

      Extract features from given text fragments
      Parameters:
        `text` - the text fragments to extract features from
        `extraInformation` - optional extra information to be used by the feature generator
      Returns:
        a collection of features

Copyright © 2026 The Apache Software Foundation. All rights reserved.