Please open an issue on Github if you want to ask me more about this. I really would like to know if others like the idea of this package and find it useful. This tests the readability of a text, and will soon also provide suggestions for improvement. It heirarchically calculates the readability of an article of a text as a whole, then separate paragraphs, then sentences, then words. When checking the readability of words it counts the syllables in a word and if the word has more syllables than specificed threshold it looks up the dictionary.com api to check for synonyms that are shorter.
I searched for a name available on npm, which described the project and was easy enough to remember. Readability was the obvious choice, but that name is taken by the mozilla reading addon. I found that readeasy was available on npm, and thought this was brilliant due to how close it sounds to a speakeasy, which were drinking establishments where individuals were forced to speak softly in order to not offend the authorities with the awful practice of drinking.
Lacking the inordinate reverence for authority, whilst simultaneously admiring both the apt description and the sonorous sound of readeasy, I thought it to be a most appropriate name for this project.
npm i readeasy --save
const readeasy =let text = "Always use a shorter word where possible!"let readability =console
The below is a simplifed output of a test paragraph. Notice the heirarchical structure. The text is tested on the whole for readability but also has more readability for each paragraph(separated by a new line), each sentence(separated by a period) and every word(separted by a space).
You can get more fine grained information by subsetting the object such as in the examples below.
const readeasy =let text = "Always use a shorter word where possible!"let readability =// The overall readability of the input textconsole// The readability of the second paragraphconsole// The approximate schoolLevel of the third sentence of the first paragraphconsole// The number of syllables of the fourth word of the second sentence of the first paragraphconsole
In the future I plan to
- Implement syntax parsing using SyntaxNet so that grammatical suggestions can also be made.
- Integrate vocab statistics to get more intelligent data about word usage and make smarter vocabulary suggestions.
- Improve readability metrics.