kGrams method

Map<KGram, Set<Term>> kGrams([
  1. int k = 2
])

Returns a hashmap of k-grams to terms from the collection of tokens.

Implementation

Map<KGram, Set<Term>> kGrams([int k = 2]) => terms.toKGramsMap(k);