countNumSyllables static method

int countNumSyllables(
  1. String value
)

counts the number of syllables in a text line

Implementation

static int countNumSyllables(String value) {
  return RegExp('[aouei]{1,2}').allMatches(value).length;
}