public class NGramGenerator
extends java.lang.Object
Constructor and Description |
---|
NGramGenerator() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.String> |
generate(char[] input,
int n,
java.lang.String separator)
Generates an nGram based on a char[] input
|
static java.util.List<java.lang.String> |
generate(java.util.List<java.lang.String> input,
int n,
java.lang.String separator)
Creates an ngram separated
by the separator param value i.e.
|
public static java.util.List<java.lang.String> generate(java.util.List<java.lang.String> input, int n, java.lang.String separator)
input
- the input tokens the output ngrams will be derived fromn
- the number of tokens as the sliding windowseparator
- each string in each gram will be separated by this value if desired. Pass in empty string if no separator is desiredpublic static java.util.List<java.lang.String> generate(char[] input, int n, java.lang.String separator)
input
- the array of chars to convert to nGramn
- The number of grams (chars) that each output gram will consist ofseparator
- each char in each gram will be separated by this value if desired. Pass in empty string if no separator is desiredCopyright © 2010 - 2020 Adobe. All Rights Reserved