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 featuresInvalidFormatExceptionpublic NGramFeatureGenerator()
                      throws InvalidFormatException
InvalidFormatExceptionpublic Collection<String> extractFeatures(String[] text, Map<String,Object> extraInfo)
extractFeatures in interface FeatureGeneratortext - the text fragments to extract features fromextraInfo - optional extra informationCopyright © 2018 The Apache Software Foundation. All rights reserved.