tokenEq static method

bool tokenEq(
  1. String a,
  2. String b
)

Strict token equality: same word, a plural / es form of it, or a number word and its digits. Never a prefix.

Implementation

static bool tokenEq(String a, String b) {
  if (a == b) return true;
  if (a == '${b}s' || b == '${a}s') return true;
  if (a == '${b}es' || b == '${a}es') return true;
  final ad = _numericWords[a];
  if (ad != null && ad == b) return true;
  final bd = _numericWords[b];
  if (bd != null && bd == a) return true;
  return false;
}