Class NGramGenerator


  • public class NGramGenerator
    extends Object
    • Constructor Detail

      • NGramGenerator

        public NGramGenerator()
    • Method Detail

      • generateTokenNGrams

        public ArrayList<String> generateTokenNGrams​(String[] tokens,
                                                     int currPos,
                                                     int[] ngramSizes)
        generates ngrams of all sizes specified in ngramSizes
        Parameters:
        tokens - tokens of the sentence
        currPos - the current position relative to which the ngrams are to be build
        the - ngramSizs of the ngrams
      • generateTokenNGrams

        public ArrayList<String> generateTokenNGrams​(String[] tokens,
                                                     int currPos,
                                                     int ngramSize)
        generates ngrams of size ngramSize
        Parameters:
        tokens - tokens of the sentence
        currPos - the current position relative to which the ngrams are to be build
        ngramSize - the size of the ngrams
      • main

        public static void main​(String[] args)