Package opennlp.tools.doccat
Class BagOfWordsFeatureGenerator
- java.lang.Object
-
- opennlp.tools.doccat.BagOfWordsFeatureGenerator
-
- All Implemented Interfaces:
FeatureGenerator
public class BagOfWordsFeatureGenerator extends Object implements FeatureGenerator
Generates a feature for each word in a document.
-
-
Constructor Summary
Constructors Constructor Description BagOfWordsFeatureGenerator()Instantiates a defaultBagOfWordsFeatureGeneratorinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<String>extractFeatures(String[] text, Map<String,Object> extraInformation)Extracts features from giventextfragments.
-
-
-
Constructor Detail
-
BagOfWordsFeatureGenerator
public BagOfWordsFeatureGenerator()
Instantiates a defaultBagOfWordsFeatureGeneratorinstance.
-
-
Method Detail
-
extractFeatures
public Collection<String> extractFeatures(String[] text, Map<String,Object> extraInformation)
Description copied from interface:FeatureGeneratorExtracts features from giventextfragments.- Specified by:
extractFeaturesin interfaceFeatureGenerator- Parameters:
text- The text fragments to extract features fromextraInformation- Optional extra information to be used by theFeatureGenerator.- Returns:
- A collection of features.
-
-