wordsmith-js
v0.1.0
Published
Readability Algorithms in Javascript
Downloads
12
Maintainers
Readme
readability-js
Hello, there! I thought it would be interesting to implement some readability algorithms in javascript.
Documentation
Everything is written in ES6, transpiled by Babel, and bundled using Browserify. Tests are written with Mocha.
All of the functionality is found in the Wordsmith
object. Here is an overview of its methods:
Wordsmith.syllableCount(data)
: wheredata
can be a string or an array of strings. Returns the total number of syllables found in the string or null if you input an invalid value.Wordsmith.sentenceCount(string)
: returns the number of sentences found in the string by using the delimiter/[\.?!]/
Wordsmith.wordCount(string)
: returns the number of words found in the string.Wordsmith.removePuctuation(string)
: removes everything except spaces and A-z characters.
These methods are used to implement these readability algorithms:
Wordsmith.fleschKincaidGradeLevel(string)
: returns the Flesch-Kincaid Grade Level of the input string.Wordsmith.fleschReadingEaseScore(string)
: returns the Flesch Reading Ease Score of the input string.
Building
Just run npm run build
. This will place readability.min.js
into the dist/
directory.
Running Tests
Just run npm run test