+1
-26
@@ -1,16 +0,5 @@ | ||
| /** | ||
| * @author Titus Wormer | ||
| * @copyright 2014 Titus Wormer | ||
| * @license MIT | ||
| * @module flesch | ||
| * @fileoverview Detect ease of reading according to the | ||
| * the Flesch Reading Ease Formula. | ||
| */ | ||
| 'use strict'; | ||
| /* Expose. */ | ||
| module.exports = exports = flesch; | ||
| module.exports = flesch; | ||
| /* Constants. */ | ||
| var SENTENCE_WEIGHT = 1.015; | ||
@@ -20,16 +9,2 @@ var WORD_WEIGHT = 84.6; | ||
| /** | ||
| * Get the grade level of a given value according to the | ||
| * Flesch Reading Ease Formula. More information is available | ||
| * at WikiPedia: | ||
| * | ||
| * http://en.wikipedia.org/wiki/ | ||
| * Flesch–Kincaid_readability_tests#Flesch_Reading_Ease | ||
| * | ||
| * @param {Object} counts | ||
| * @param {number} counts.word - Number of words. | ||
| * @param {number} counts.sentence - Number of sentences. | ||
| * @param {number} counts.syllable - Number of syllables. | ||
| * @return {number} | ||
| */ | ||
| function flesch(counts) { | ||
@@ -36,0 +11,0 @@ if (!counts || !counts.sentence || !counts.word || !counts.syllable) { |
+15
-27
| { | ||
| "name": "flesch", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Formula to detect the ease of reading a text according to Flesch Reading Ease (1975)", | ||
@@ -11,5 +11,2 @@ "license": "MIT", | ||
| ], | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "repository": "https://github.com/wooorm/flesch", | ||
@@ -21,18 +18,18 @@ "bugs": "https://github.com/wooorm/flesch/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 flesch > flesch.js", | ||
@@ -48,21 +45,12 @@ "build-mangle": "esmangle flesch.js > flesch.min.js", | ||
| "space": true, | ||
| "esnext": false, | ||
| "ignores": [ | ||
| "flesch.js", | ||
| "flesch.min.js" | ||
| "flesch.js" | ||
| ] | ||
| }, | ||
| "remarkConfig": { | ||
| "output": true, | ||
| "plugins": { | ||
| "comment-config": null, | ||
| "github": null, | ||
| "lint": { | ||
| "list-item-spacing": false | ||
| }, | ||
| "validate-links": null | ||
| }, | ||
| "settings": { | ||
| "bullet": "*" | ||
| } | ||
| "plugins": [ | ||
| "preset-wooorm" | ||
| ] | ||
| } | ||
| } |
+14
-14
@@ -10,3 +10,3 @@ # flesch [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
| [npm][npm-install]: | ||
| [npm][]: | ||
@@ -32,10 +32,10 @@ ```bash | ||
| /* For “The Australian platypus is seemingly a hybrid of | ||
| * mammal and reptilian creature.” (1 sentence, 13 words, | ||
| * 26 syllables). */ | ||
| * mammal and reptilian creature.” (1 sentence, 12 words, | ||
| * 23 syllables). */ | ||
| flesch({ | ||
| sentence: 1, | ||
| word: 13, | ||
| syllable: 26 | ||
| word: 12, | ||
| syllable: 23 | ||
| }); | ||
| // 24.440000000000026 | ||
| // 32.504999999999995 | ||
| ``` | ||
@@ -65,15 +65,15 @@ | ||
| * [`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 | ||
| * [`dale-chall-formula`](https://github.com/wooorm/dale-chall-formula) | ||
| — Uses a dictionary; suited for higher reading levels; | ||
| — Uses a dictionary, suited for higher reading levels | ||
| * [`flesch-kincaid`](https://github.com/wooorm/flesch-kincaid) | ||
| — Like `flesch`; returns U.S. grade levels; | ||
| — Like `flesch`, 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 |
| <!--remark setext--> | ||
| <!--lint disable no-multiple-toplevel-headings--> | ||
| 1.0.0 / 2016-07-24 | ||
| ================== |
8
-27.27%5789
-16.28%4
-20%13
-64.86%