endsWithShortSyllable property

bool get endsWithShortSyllable

Returns true if the String's last syllable:

  • is a vowel followed by a non-vowel other than w, x or Y and preceded by a non-vowel, or
  • is a vowel at the beginning of the word followed by a non-vowel.

Implementation

bool get endsWithShortSyllable =>
    RegExp('(?<=${Porter2StemmerConstants.rNotVowels})${Porter2StemmerConstants.rVowels}(?=[^aeiouywxY]\$)')
        .allMatches(this)
        .isNotEmpty ||
    RegExp('^${Porter2StemmerConstants.rVowels}(?=[^aeiouy]\$)')
        .allMatches(this)
        .isNotEmpty;