syllable
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");
CLI
Install:
$ npm install --global syllable
Use:
Usage: syllable [options] words...
Syllable count in an English word
Options:
-h, --help output usage information
-v, --version output version number
Usage:
# output syllables for words
$ syllable syllable unicorn
# 6
# output syllables for words from stdin
$ echo "syllable unicorn banana" | syllable
# 9
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