Socket
Socket
Sign inDemoInstall

dale-chall-formula

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

34

index.js

@@ -1,17 +0,6 @@

/**
* @author Titus Wormer
* @copyright 2014 Titus Wormer
* @license MIT
* @module dale-chall-formula
* @fileoverview Detect ease of reading according to the
* the (revised) Dale-Chall Readability Formula (1995).
*/
'use strict';
/* Expose. */
module.exports = exports = daleChall;
exports.gradeLevel = daleChallGradeLevel;
module.exports = daleChall;
daleChall.gradeLevel = daleChallGradeLevel;
/* The constants as defined by the Dale--Chall Readability Formula. */
var DIFFICULT_WORD_WEIGHT = 0.1579;

@@ -23,3 +12,3 @@ var WORD_WEIGHT = 0.0496;

/* The grade map associated with the scores. */
/* Grade map associated with the scores. */
var GRADE_MAP = {

@@ -36,15 +25,2 @@ 4: [0, 4],

/**
* Get the grade level of a given value according to the
* Dale--Chall Readability Formula. More information is
* available at WikiPedia:
*
* http://en.wikipedia.org/wiki/Dale–Chall_readability_formula
*
* @param {Object} counts
* @param {number} counts.word - Number of words.
* @param {number} counts.sentence - Number of sentences.
* @param {number} counts.difficultWord - Number of difficult words.
* @return {number}
*/
function daleChall(counts) {

@@ -70,5 +46,3 @@ var percentageOfDifficultWords;

/**
* Simple mapping between a dale-chall score and a U.S. grade level.
*/
/* Mapping between a dale-chall score and a U.S. grade level. */
function daleChallGradeLevel(score) {

@@ -75,0 +49,0 @@ score = Math.floor(score);

42

package.json
{
"name": "dale-chall-formula",
"version": "1.0.0",
"version": "1.0.1",
"description": "Formula to detect the grade level of text according to the (revised) Dale-Chall Readability Formula (1995)",

@@ -12,5 +12,2 @@ "license": "MIT",

],
"files": [
"index.js"
],
"repository": "https://github.com/wooorm/dale-chall-formula",

@@ -22,18 +19,18 @@ "bugs": "https://github.com/wooorm/dale-chall-formula/issues",

],
"files": [
"index.js"
],
"dependencies": {},
"devDependencies": {
"browserify": "^13.0.1",
"browserify": "^14.0.0",
"esmangle": "^1.0.1",
"is-nan": "^1.2.1",
"nyc": "^7.0.0",
"remark-cli": "^1.0.0",
"remark-comment-config": "^4.0.0",
"remark-github": "^5.0.0",
"remark-lint": "^4.0.0",
"remark-validate-links": "^4.0.0",
"nyc": "^11.0.0",
"remark-cli": "^3.0.0",
"remark-preset-wooorm": "^3.0.0",
"tape": "^4.0.0",
"xo": "^0.16.0"
"xo": "^0.18.0"
},
"scripts": {
"build-md": "remark . --quiet --frail",
"build-md": "remark . -qfo",
"build-bundle": "browserify index.js --bare -s daleChallFormula > dale-chall-formula.js",

@@ -49,21 +46,12 @@ "build-mangle": "esmangle dale-chall-formula.js > dale-chall-formula.min.js",

"space": true,
"esnext": false,
"ignores": [
"dale-chall-formula.js",
"dale-chall-formula.min.js"
"dale-chall-formula.js"
]
},
"remarkConfig": {
"output": true,
"plugins": {
"comment-config": null,
"github": null,
"lint": {
"list-item-spacing": false
},
"validate-links": null
},
"settings": {
"bullet": "*"
}
"plugins": [
"preset-wooorm"
]
}
}

@@ -10,3 +10,3 @@ # dale-chall-formula [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]

[npm][npm-install]:
[npm][]:

@@ -65,15 +65,15 @@ ```bash

* [`automated-readability`](https://github.com/wooorm/automated-readability)
— Uses character count instead of error-prone syllable parser;
— Uses character count instead of error-prone syllable parser
* [`coleman-liau`](https://github.com/wooorm/coleman-liau)
— Uses letter count instead of an error-prone syllable parser;
— Uses letter count instead of an error-prone syllable parser
* [`flesch`](https://github.com/wooorm/flesch)
— Uses syllable count;
— Uses syllable count
* [`flesch-kincaid`](https://github.com/wooorm/flesch-kincaid)
— Like `flesch-formula`; returns U.S. grade levels;
— Like `flesch-formula`, returns U.S. grade levels
* [`gunning-fog`](https://github.com/wooorm/gunning-fog)
— Uses syllable count; needs POS-tagging and NER;
— Uses syllable count, needs POS-tagging and NER
* [`smog-formula`](https://github.com/wooorm/smog-formula)
— Like `gunning-fog-index`; without needing advanced NLP;
— Like `gunning-fog-index`, without needing advanced NLP
* [`spache-formula`](https://github.com/wooorm/spache-formula)
— Uses a dictionary; suited for lower reading levels.
— Uses a dictionary, suited for lower reading levels

@@ -94,3 +94,3 @@ ## License

[npm-install]: https://docs.npmjs.com/cli/install
[npm]: https://docs.npmjs.com/cli/install

@@ -97,0 +97,0 @@ [license]: LICENSE

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc