splitByTrigram method

List<String> splitByTrigram()

Splits the text using the trigram algorithm.

It is used for searching.

Implementation

List<String> splitByTrigram() {
  if (isEmpty) {
    return [];
  }
  if (length <= 3) {
    return [this];
  }
  final tmp = <String>[];
  for (int i = 0; i < length - 2; i++) {
    tmp.add(substring(i, min(i + 3, length)));
  }
  return tmp;
}