public class Ngrams
extends java.lang.Object
Constructor and Description |
---|
Ngrams() |
Modifier and Type | Method and Description |
---|---|
static void |
addNGramsSizeN(java.lang.String word,
int n,
java.util.List<java.lang.String> allNGrams)
Extracts all
n -grams from the word and adds them
to allNGrams . |
static java.util.List<java.lang.String> |
extractAllNGramsFromWord(java.lang.String word,
int minN,
int maxN)
Pads the
word with boundary markers "<" and ">" and then
extracts all character n-grams for n=[minN..maxN] . |
public static java.util.List<java.lang.String> extractAllNGramsFromWord(java.lang.String word, int minN, int maxN)
word
with boundary markers "<" and ">" and then
extracts all character n-grams for n=[minN..maxN]
.word
- minN
- 0..nmaxN
- 1..npublic static void addNGramsSizeN(java.lang.String word, int n, java.util.List<java.lang.String> allNGrams)
n
-grams from the word
and adds them
to allNGrams
.word
- n
- allNGrams
-