string/ngram_utils library
N-gram generator for strings — character and word n-grams (roadmap #405).
Functions
-
characterNgrams(
String s, int n) → List< String> -
Returns character n-grams of
swith lengthn. Overlapping windows; empty string or n < 1 returns empty list. -
wordNgrams(
String s, int n) → List< List< String> > -
Returns word n-grams of
swithnwords per gram. Words are split on whitespace; empty or n < 1 returns empty list.