syllable
Get syllable count in JavaScript.
Installation
npm:
$ npm install syllable
Component:
$ component install wooorm/syllable
Bower:
$ bower install syllable
Usage
var syllable = require('syllable');
syllable("syllable");
syllable("unicorn");
syllable("hi");
syllable("hihi");
syllable("mmmmmmmmmmmmmmmm");
Benchmark
On a MacBook Air, it runs about 57,000 words per second.
syllable — this module
57 op/s » op/s * 1,000
syllablistic
37 op/s » op/s * 1,000
text-statistics
51 op/s » op/s * 1,000
Inspiration
Based on the syllable functionality found in Text-Statistics (PHP), in turn inspired by Lingua-EN-Syllable (Perl).
License
MIT © Titus Wormer