SingularVerbEncoder constructor

SingularVerbEncoder()

Implementation

SingularVerbEncoder() {
  irregularPluralVerbs.forEach((singular, plural) {
    addInflectionRule(plural, (Match m) => singular);
  });

  [
    [r'$', (Match m) => 's'],
    [r'([^aeiou])y$', (Match m) => '${m[1]}ies'],
    [r'(z)$', (Match m) => '${m[1]}es'],
    [r'(ss|zz|x|h|o|us)$', (Match m) => '${m[1]}es'],
    [r'(ed)$', (Match m) => '${m[1]}']
  ]
      .reversed
      .forEach((rule) => addInflectionRule(rule.first as String, rule.last));
}