public class NGramFeatureGenerator extends Object implements FeatureGenerator
FeatureGenerator
Constructor and Description |
---|
NGramFeatureGenerator()
Default constructor for Bi grams
|
NGramFeatureGenerator(int minGram,
int maxGram)
Constructor for ngrams.
|
Modifier and Type | Method and Description |
---|---|
Collection<String> |
extractFeatures(String[] text,
Map<String,Object> extraInfo)
Extract ngram features from given text fragments
|
public NGramFeatureGenerator(int minGram, int maxGram) throws InvalidFormatException
minGram
- minGram value - which means minimum words in ngram featuresmaxGram
- maxGram value - which means maximum words in ngram featuresInvalidFormatException
public NGramFeatureGenerator()
public Collection<String> extractFeatures(String[] text, Map<String,Object> extraInfo)
extractFeatures
in interface FeatureGenerator
text
- the text fragments to extract features fromextraInfo
- optional extra informationCopyright © 2017 The Apache Software Foundation. All rights reserved.