splitByBigram method

List<String> splitByBigram()

Splits the text using the bigram algorithm.

It is used for searching.

Implementation

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