syllable
Syllable count in JavaScript.
Install
npm:
npm install syllable
API
var syllable = require('syllable')
syllable('syllable')
syllable('unicorn')
syllable('hi')
syllable('hihi')
syllable('mmmmmmmmmmmmmmmm')
syllable('wine')
syllable('bottle')
syllable('wine-bottle')
syllable('Åland')
CLI
Usage: syllable [options] <words...>
Syllable count in an English word
Options:
-h, --help output usage information
-v, --version output version number
Usage:
# output syllables
$ syllable syllable unicorn
# 6
# output syllables from stdin
$ echo "syllable unicorn banana" | syllable
# 9
Inspiration
Based on the syllable functionality found in Text-Statistics
(PHP),
in turn inspired by Lingua::EN::Syllable
(Perl).
Support for word-breaks, non-ASCII characters, and many fixes added later.
License
MIT © Titus Wormer