Count Syllables

Estimate the number of syllables in an English word.

Code

General
const w = word.toLowerCase().replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, '').match(/[aeiouy]{1,2}/g);
return w ? w.length : 1;

Parameters

Word to count syllables in

Browser·fetch() may be limited by CORS

More JavaScript Snippets