clearnote01 / readability Goto Github PK
View Code? Open in Web Editor NEWnpm package to calculate readability statistics of a text object - paragraphs, sentences, articles.
License: MIT License
npm package to calculate readability statistics of a text object - paragraphs, sentences, articles.
License: MIT License
The function sentenceCount
uses this regular expression to calculate total sentences: (/ *[.?!]['")\]]*[ |\n](?=[A-Z])/g)
It works well when we have text separated by single \n
but when there are multiple new lines in between the text, it does not split them properly.
I suggest a fix: After getting sentences from regular expression mentioned above, we should split each by \n
and consider each splitted string as new sentence if it's word count is greater than 3.
I was matching text-readability
fleschReadingEase score with some other tools like https://www.webfx.com/tools/read-able and https://charactercalculator.com/flesch-reading-ease/
There was a big difference in both scores, so I decided to look into library and found this issue in sentence counting part.
I would love to contribute and fix this, please assign me.
The fix for #2 has not made it's way into the published NPM package at https://www.npmjs.com/package/text-readability - the latest version there was published a year ago. Please can this be published as I would love to use this package, but at the moment the bug from that issue is preventing me.
Hey there,
First off, thanks for this awesome repo. I have a feat. request, as described in the title, which I'd like to directly use in one of my projects.
A function in which we can provide a Readability Consensus score (based upon all tests), and return the estimated school grade.
Building a grammar correction bot, and need to create an "average value" of its performance on multiple grammar fixes, and after that I want to describe the estimated school grade level needed to read the text.
Example:
On average, the **readability score** of your original documentation is **3.81** ("Fairly Difficult").
To keep it simple; a student between ${<<insert value here, e.g. "9th and 10th grade">>} can understand your documentation.
Hi,
I find no way to use it in a simpe html page (index.html)... no React, vo Vues. That's because my very low experience with es modules and how to use them in a browser.
Is there any example I can find somewhere?
Thank you!!!
I believe one further change is needed from the fix that was merged at #3
I installed the text-readability
package direct from this repo, as the package was not up to date. I now see the following issue:
ERROR in ./node_modules/text-readability/main.js
Module not found: Error: Can't resolve 'fs' in '/Users/helen/repos/mq-take-part-research/node_modules/text-readability'
I believe the first line of main.js
- const fs = require('fs')
needs to be removed.
Hi,
Thank you for this amazing library. I am trying to use it in React (in browser) to analyze some text. Unfortunately filesystem doesn't work in browser so I get this error:
TypeError: fs.readFileSync is not a function
12 |
13 | var punctuationRE = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~]/g;
14 | var easyWordsPath = path.join(__dirname, 'easy_words.txt');
> 15 | var easyWords = fs.readFileSync(easyWordsPath, 'utf-8');
16 | var easyWordSet = new Set(easyWords.split(/\n/g)); // extends Math object
17 |
18 | Math.copySign = function (x, y) {
I want to use you package in Create-react-app. How can I Use it?
(see formula in wiki: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests)
Hello!
Can you please publish a new release of the package with the updated dependencies?
syllable
's old version has a security vulnerability in the trim
package it uses.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.