Class NGramFeatureGenerator

    • Constructor Detail

      • NGramFeatureGenerator

        public NGramFeatureGenerator​(int minGram,
                                     int maxGram)
                              throws InvalidFormatException
        Constructor for ngrams.
        Parameters:
        minGram - minGram value - which means minimum words in ngram features
        maxGram - maxGram value - which means maximum words in ngram features
        Throws:
        InvalidFormatException
    • Method Detail

      • extractFeatures

        public Collection<String> extractFeatures​(String[] text,
                                                  Map<String,​Object> extraInfo)
        Extract ngram features from given text fragments
        Specified by:
        extractFeatures in interface FeatureGenerator
        Parameters:
        text - the text fragments to extract features from
        extraInfo - optional extra information
        Returns:
        a collection of n gram features