Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/EndaHallahan/syllabificate
Syllable and polysyllable counts in Javascript.
https://github.com/EndaHallahan/syllabificate
polysyllables syllable syllable-count
Last synced: about 2 months ago
JSON representation
Syllable and polysyllable counts in Javascript.
- Host: GitHub
- URL: https://github.com/EndaHallahan/syllabificate
- Owner: EndaHallahan
- License: mit
- Created: 2018-07-22T00:23:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-28T20:32:39.000Z (over 5 years ago)
- Last Synced: 2024-03-15T00:22:25.094Z (6 months ago)
- Topics: polysyllables, syllable, syllable-count
- Language: JavaScript
- Homepage: https://endahallahan.github.io/syllabificate/syllabificateTester.html
- Size: 61.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Syllabificate [![Build Status](https://travis-ci.com/EndaHallahan/syllabificate.svg?branch=master)](https://travis-ci.com/EndaHallahan/syllabificate)
Syllable counts and polysyllable counts in Javascript. Try the demo [here!](https://endahallahan.github.io/syllabificate/syllabificateTester.html)
Syllable counts are an important part of calculating many readability metrics, such as the Flesch-Kincaid score and the SMOG grade. Syllabificate was created to facilitate faster and more accurate measurements for these calculations.
*Note: Syllabificate is an English language syllable counter. It may not be accurate in other languages.*
## Installation (Node)
```npm install syllabificate```
## Usage
```javacript
const syl = require('syllabificate');
```
### countSyllables(*string*)
Returns the total number of syllables in a string.
```javascript
syl.countSyllables("Electric slide."); //4
```
### countPolys(*string*)
Returns the total number of polysyllables (words with 3 or more syllables) in a string.
```javascript
syl.countPolys("Electric slide."); //1
```
### countSyllablesAndPolys(*string*)
Returns both the total number of syllables and the total number of polysyllables as an array: `[syllables, polysyllables]`. This can be useful if you are calculating multiple metrics.
```javascript
syl.countSyllablesAndPolys("Electric slide."); //[4, 1]
```