Giter Site home page Giter Site logo

readability's Introduction

readability's People

Contributors

michaelchambers avatar sreyemnayr avatar wooorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

readability's Issues

It looks like you mixed up Dale-Chall and Spache

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 has bug

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.

SMOG - SmogToAge

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.

Page not loading correctly

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?

Mean is NAN if DaleChall not familiar

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.