Count syllables in an English word.
- What is this?
- When should I use this?
- Install
- Use
- API
- CLI
- Types
- Compatibility
- Related
- Contribute
- Security
- Notice
- License
This package estimates how many syllables are in an English word.
Use this when you want to do fun things with natural language, like rhyming, detecting reading ease, etc.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
npm install syllableIn Deno with esm.sh:
import {syllable} from 'https://esm.sh/syllable@5'In browsers with esm.sh:
<script type="module">
import {syllable} from 'https://esm.sh/syllable@5?bundle'
</script>import {syllable} from 'syllable'
syllable('syllable') // 3
syllable('unicorn') // 3
syllable('hi') // 1
syllable('hihi') // 2
syllable('mmmmmmmmmmmmmmmm') // 1
syllable('wine') // 1
syllable('bottle') // 2
syllable('wine-bottle') // 3
syllable('Γ
land') // 2This package exports the identifier syllable.
There is no default export.
Get the number of syllables in value.
Value to check (string, required).
Syllables in value (number).
Usage: syllable [options] <words...>
Count syllables in English words
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
# 9This package is fully typed with TypeScript. It exports no additional types.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
automated-readabilityβ formula to detect ease of reading according to the Automated Readability Index (1967)buzzwordsβ list of buzzwordscoleman-liauβ formula to detect the ease of reading a text according to the Coleman-Liau index (1975)cussβ map of profane words to a rating of surenessdale-challβ list of easy American-English words: The New Dale-Chall (1995)dale-chall-formulaβ formula to find the grade level according to the (revised) DaleβChall Readability Formula (1995)fillersβ list of filler wordsfleschβ formula to detect the ease of reading a text according to Flesch Reading Ease (1975)flesch-kincaidβ formula to detect the grade level of text according to FleschβKincaid Grade Level (1975)gunning-fogβ formula to detect the ease of reading a text according to the Gunning fog index (1952)hedgesβ list of hedge wordsprofanitiesβ list of profane wordssmog-formulaβ formula to detect the ease of reading a text according to the SMOG (Simple Measure of Gobbledygook) formula (1969)spacheβ list of familiar American-English words (1974)spache-formulaβ uses a dictionary, suited for lower reading levelsweaselsβ formula to detect the grade level of text according to the (revised) Spache Readability Formula (1974)
Yes please! See How to Contribute to Open Source.
This package is safe.
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.
MIT Β© Titus Wormer