add method

void add(
  1. String? gram
)

Implementation

void add(String? gram) {
  if (name == null || gram == null) return;
  int length = gram.length;
  if (length < 1 || length > NGram.nGram) return;
  nWords[length - 1]++;
  freq.update(gram, (value) => value + 1, ifAbsent: () => 1);
}