wooorm / readability Goto Github PK
View Code? Open in Web Editor NEWvisualise readability
Home Page: https://wooorm.com/readability/
License: MIT License
visualise readability
Home Page: https://wooorm.com/readability/
License: MIT License
So I think you mixed up the measures for easy words and familiar words in index.js around line 380.
From https://github.com/wooorm/readability/blob/src/src/index.js#L383-L398 :
// Find unique unfamiliar words for spache.
if (
spache.indexOf(normalized) !== -1 &&
familiarWords[normalized] !== true
) {
familiarWords[normalized] = true
familiarWordCount++
}
// Find unique difficult words for dale-chall.
if (daleChall.indexOf(normalized) !== -1 && easyWord[normalized] !== true) {
easyWord[normalized] = true
easyWordCount++
}
}
}
The docs for Dale-chall describe it as "List of familiar American-English words: The New Dale-Chall (1995)."
The docs for Spache describe it as a "List of easy American-English words: Revised Spache (1974)."
So I think you just have to switch the counts.
compute-mode doesn't work. There was a bug fix merged into the devel branch in 2015: compute-io/mode@facc6aa
But that fix never made it to master or the npm package. As they haven't touched the package in 6 years, I think it probably isn't safe to use.
Your SMOG formula matches the values in https://en.wikipedia.org/wiki/SMOG, which you refer to.
That site says the result is a grade.
Your smog-formula returns 11.2 for the Gettysburg Address, which is an appropriate grade level based on the other tests' scores.
But your smogToAge method must have been based on something else, and is returning age 6 as the result for an 11.2 score. I think you just want it to be the same gradeToAge call you have for the other tests.
do it
How can I make this work for other language? Russian, f.e.
In index.html I see on line 49 and 50
<script type=module src=index.module.js></script>
<script nomodule src=index.nomodule.js></script>
But in /src I only see index.js. Chrome throws the error "readability/index.module.js net::ERR_ABORTED 404 (Not Found)" telling me line 49 of index.html is where the error occurs.
Have I done something incorrectly?
Since dale-chall-formula's gradeMap has
10: [16, Infinity]
and readability has:
daleChallFormula.gradeLevel(daleChallFormula(counts))[1]
Then when Dale-Chall does not recognize the word, Mean tries to calculate including a value of infinity and so becomes NAN.
Perhaps Dale-Chall should be counted as 17 in that case, instead of Infinity.
It could either be changed in dale-chall-formula or in readability when doing math with the scores - I'm not sure which would be better.
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.