update method

void update(
  1. String? text
)

Implementation

void update(String? text) {
  if (text == null) return;
  text = NGram.normalizeVi(text);
  NGram gram = NGram();
  for (int i = 0; i < text.length; i++) {
    String ch = text[i];
    gram.addChar(ch);
    for (int n = 1; n <= NGram.nGram; n++) {
      add(gram.get(n));
    }
  }
}