PastEncoder constructor

PastEncoder()

Implementation

PastEncoder() {
  irregularPastVerbs.forEach((String presentOrParticiple, String past) {
    addIrregularInflectionRule(presentOrParticiple, past);
  });
  [
    [r'.+', (Match m) => '${m[0]}ed'],
    [r'([^aeiou])y$', (Match m) => '${m[1]}ied'],
    [r'([aeiou]e)$', (Match m) => '${m[1]}d'],
    [r'[aeiou][^aeiou]e$', (Match m) => '${m[0]}d']
  ]
      .reversed
      .forEach((rule) => addInflectionRule(rule.first as String, rule.last));
}