Package opennlp.tools.ngram
Class NGramGenerator
java.lang.Object
opennlp.tools.ngram.NGramGenerator
Generates an nGram, via an optional separator, and returns the grams as a list
 of strings
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
NGramGeneratorpublic NGramGenerator()
 
- 
- 
Method Details- 
generateCreates nGrams separated by the separator param value i.e.a,b,c,dwithn = 3and a separator as"-"would returna-b-c,b-c-d.- Parameters:
- input- the input tokens the output ngrams will be derived from
- n- the number of tokens as the sliding window
- separator- each string in each gram will be separated by this value if desired. Pass in empty string if no separator is desired
- Returns:
- The generated list of resulting nGrams.
 
- 
generateGenerates nGrams based on achar[]input.- Parameters:
- input- the array of chars to convert to nGram
- n- The number of grams (chars) that each output gram will consist of
- separator- each char in each gram will be separated by this value if desired. Pass in empty string if no separator is desired
- Returns:
- The generated list of resulting nGrams.
 
 
-