retext-keywords
Advanced tools
Comparing version 1.0.1 to 2.0.0
115
history.md
@@ -1,7 +0,12 @@ | ||
<!--mdast setext--> | ||
<!--remark setext--> | ||
<!--lint disable no-multiple-toplevel-headings--> | ||
<!--lint disable maximum-line-length--> | ||
2.0.0 / 2016-06-06 | ||
================== | ||
* Update dev-dependencies ([`a6315d7`](https://github.com/wooorm/retext-keywords/commit/a6315d7)) | ||
* Remove support for Bower, Component, Duo ([`e2343ec`](https://github.com/wooorm/retext-keywords/commit/e2343ec)) | ||
* Fix prototypal properties ([`c36ca4e`](https://github.com/wooorm/retext-keywords/commit/c36ca4e)) | ||
1.0.1 / 2015-08-26 | ||
@@ -15,107 +20,1 @@ ================== | ||
================== | ||
* Refactor for changes in retext@1.0.0 ([1993b8b](https://github.com/wooorm/retext-keywords/commit/1993b8b)) | ||
0.2.1 / 2015-01-18 | ||
================== | ||
* Update changelog for 0.2.1 ([3c2d4ba](https://github.com/wooorm/retext-keywords/commit/3c2d4ba)) | ||
* Add Bower as an installation method in `Readme.md` ([8139304](https://github.com/wooorm/retext-keywords/commit/8139304)) | ||
* Update `.gitignore` for bower ([1ac1b78](https://github.com/wooorm/retext-keywords/commit/1ac1b78)) | ||
* Update `.npmignore` for bower ([af65cfe](https://github.com/wooorm/retext-keywords/commit/af65cfe)) | ||
* Add `bower.json` ([7de4d58](https://github.com/wooorm/retext-keywords/commit/7de4d58)) | ||
* Add Component as an instalation method in `Readme.md` ([e36f1e7](https://github.com/wooorm/retext-keywords/commit/e36f1e7)) | ||
* Update `.npmignore` for component ([107eded](https://github.com/wooorm/retext-keywords/commit/107eded)) | ||
* Update `.gitignore` for component ([c640a89](https://github.com/wooorm/retext-keywords/commit/c640a89)) | ||
* Add `component.json` ([71ea07e](https://github.com/wooorm/retext-keywords/commit/71ea07e)) | ||
* Update retext-pos ([bd20084](https://github.com/wooorm/retext-keywords/commit/bd20084)) | ||
* Fix malformed markdown in `Readme.md` ([6adfd50](https://github.com/wooorm/retext-keywords/commit/6adfd50)) | ||
0.2.0 / 2015-01-18 | ||
================== | ||
* Update changelog for 0.2.0 ([db6e405](https://github.com/wooorm/retext-keywords/commit/db6e405)) | ||
* Update copyright notice in `LICENSE` to include 2015 ([375d5ce](https://github.com/wooorm/retext-keywords/commit/375d5ce)) | ||
* Add link to whole license in `Readme.md` ([60f3c0e](https://github.com/wooorm/retext-keywords/commit/60f3c0e)) | ||
* Add Duo as an instalation method in `Readme.md` ([1e6d952](https://github.com/wooorm/retext-keywords/commit/1e6d952)) | ||
* Add link to installation method in `Readme.md` ([493e62b](https://github.com/wooorm/retext-keywords/commit/493e62b)) | ||
* Refactor fenced code blocks in `Readme.md` ([4f8ed72](https://github.com/wooorm/retext-keywords/commit/4f8ed72)) | ||
* Refactor to adhere to strict jsdoc style ([77f1a6f](https://github.com/wooorm/retext-keywords/commit/77f1a6f)) | ||
* Add jscs-jsdoc configuration to `.jscs.json` ([cf01da0](https://github.com/wooorm/retext-keywords/commit/cf01da0)) | ||
* Add jscs-jsdoc as a dev-dependency ([172ef94](https://github.com/wooorm/retext-keywords/commit/172ef94)) | ||
* Refactor npm scripts for changes in npm ([3699912](https://github.com/wooorm/retext-keywords/commit/3699912)) | ||
* Update retext-pos ([d112943](https://github.com/wooorm/retext-keywords/commit/d112943)) | ||
* Update eslint ([c847043](https://github.com/wooorm/retext-keywords/commit/c847043)) | ||
* Update retext ([f51278d](https://github.com/wooorm/retext-keywords/commit/f51278d)) | ||
0.1.5 / 2014-12-06 | ||
================== | ||
* Update changelog for 0.1.5 ([6400d33](https://github.com/wooorm/retext-keywords/commit/6400d33)) | ||
* Update benchmark results in `Readme.md` ([aa4c784](https://github.com/wooorm/retext-keywords/commit/aa4c784)) | ||
* Fix wording in `Readme.md` ([09f50db](https://github.com/wooorm/retext-keywords/commit/09f50db)) | ||
* Refactor npm script targets in `package.json` ([bf95ced](https://github.com/wooorm/retext-keywords/commit/bf95ced)) | ||
* Add link to personal website to copyright in `Readme.md` ([45af946](https://github.com/wooorm/retext-keywords/commit/45af946)) | ||
* Update eslint, retext ([d2b0454](https://github.com/wooorm/retext-keywords/commit/d2b0454)) | ||
0.1.4 / 2014-11-21 | ||
================== | ||
* Update changelog for 0.1.4 ([ae5975a](https://github.com/wooorm/retext-keywords/commit/ae5975a)) | ||
* Refactor `Readme.md` ([d35d20b](https://github.com/wooorm/retext-keywords/commit/d35d20b)) | ||
* Add flat badges to `Readme.md` ([419be6b](https://github.com/wooorm/retext-keywords/commit/419be6b)) | ||
* Fix incorrect executive rights on `test.js` ([d3f125e](https://github.com/wooorm/retext-keywords/commit/d3f125e)) | ||
* Refactor npm script targets in `package.json` ([78782b8](https://github.com/wooorm/retext-keywords/commit/78782b8)) | ||
* Update matcha, retext ([6d68d64](https://github.com/wooorm/retext-keywords/commit/6d68d64)) | ||
0.1.3 / 2014-10-28 | ||
================== | ||
* Update changelog for 0.1.3 ([ec70a40](https://github.com/wooorm/retext-keywords/commit/ec70a40)) | ||
* Add `.eslintrc` ([06bd57a](https://github.com/wooorm/retext-keywords/commit/06bd57a)) | ||
* Refactor to disallow space after object keys ([f117d25](https://github.com/wooorm/retext-keywords/commit/f117d25)) | ||
* Refactor for changes in retext ([486dd58](https://github.com/wooorm/retext-keywords/commit/486dd58)) | ||
* Update eslint, mocha, retext, retext-visit, retext-porter-stemmer, retext-pos ([6cd8492](https://github.com/wooorm/retext-keywords/commit/6cd8492)) | ||
0.1.2 / 2014-10-21 | ||
================== | ||
* Update changelog for 0.1.2 ([f3b7d65](https://github.com/wooorm/retext-keywords/commit/f3b7d65)) | ||
* Refactor test ([77c9a84](https://github.com/wooorm/retext-keywords/commit/77c9a84)) | ||
* Refactor .jscs.json ([b219a45](https://github.com/wooorm/retext-keywords/commit/b219a45)) | ||
* Update retext ([76e5ec0](https://github.com/wooorm/retext-keywords/commit/76e5ec0)) | ||
0.1.1 / 2014-10-15 | ||
================== | ||
* Update changelog for 0.1.1 ([62d595a](https://github.com/wooorm/retext-keywords/commit/62d595a)) | ||
* Update API for changes to retext-visit ([d228300](https://github.com/wooorm/retext-keywords/commit/d228300)) | ||
* Update retext-porter-stemmer, retext-pos, retext-visit, jscs, retext ([e8c50c7](https://github.com/wooorm/retext-keywords/commit/e8c50c7)) | ||
* Update .gitignore, .npmignore ([4b77b57](https://github.com/wooorm/retext-keywords/commit/4b77b57)) | ||
* Move benchmark to benchmark.js ([11e934f](https://github.com/wooorm/retext-keywords/commit/11e934f)) | ||
* Move spec to test.js ([05177d9](https://github.com/wooorm/retext-keywords/commit/05177d9)) | ||
0.1.0 / 2014-09-25 | ||
================== | ||
* Update changelog for 0.1.0 ([2851ba2](https://github.com/wooorm/retext-keywords/commit/2851ba2)) | ||
* Refactor Readme.md ([3658426](https://github.com/wooorm/retext-keywords/commit/3658426)) | ||
* Update benchmarks in Readme.md ([8e55c48](https://github.com/wooorm/retext-keywords/commit/8e55c48)) | ||
* Refactor benchmark ([3d00f81](https://github.com/wooorm/retext-keywords/commit/3d00f81)) | ||
* Refactor API ([98dc488](https://github.com/wooorm/retext-keywords/commit/98dc488)) | ||
* Add npm deployment to travis ([5229060](https://github.com/wooorm/retext-keywords/commit/5229060)) | ||
* Remove `npm update` from travis ([75728ce](https://github.com/wooorm/retext-keywords/commit/75728ce)) | ||
* Remove browser test ([ab7d5d9](https://github.com/wooorm/retext-keywords/commit/ab7d5d9)) | ||
* Update .gitignore, .npmignore ([7a469bb](https://github.com/wooorm/retext-keywords/commit/7a469bb)) | ||
* Update Installation in docs ([c0b91bc](https://github.com/wooorm/retext-keywords/commit/c0b91bc)) | ||
* Fix property order in package.json ([0b76566](https://github.com/wooorm/retext-keywords/commit/0b76566)) | ||
* Update copyright in Readme.md ([a02f5c5](https://github.com/wooorm/retext-keywords/commit/a02f5c5)) | ||
* Remove testling ([89eb9ec](https://github.com/wooorm/retext-keywords/commit/89eb9ec)) | ||
* Refactor spec ([13f4fdd](https://github.com/wooorm/retext-keywords/commit/13f4fdd)) | ||
* Update dependencies ([f6cbd85](https://github.com/wooorm/retext-keywords/commit/f6cbd85)) | ||
* Removed retext from peer-dependencies ([9ecb59b](https://github.com/wooorm/retext-keywords/commit/9ecb59b)) | ||
* Add retext as a peer dependency ([0d463f9](https://github.com/wooorm/retext-keywords/commit/0d463f9)) | ||
* Update mocha ([65b91fc](https://github.com/wooorm/retext-keywords/commit/65b91fc)) | ||
0.0.1 / 2014-07-16 | ||
================== |
18
index.js
/** | ||
* @author Titus Wormer | ||
* @copyright 2014-2015 Titus Wormer | ||
* @copyright 2014-2016 Titus Wormer | ||
* @license MIT | ||
@@ -11,2 +11,4 @@ * @module retext:keywords | ||
/* eslint-env commonjs */ | ||
/* | ||
@@ -77,3 +79,3 @@ * Dependencies. | ||
* @param {Node} node - Parent to search in. | ||
* @return {Array.<Object>} | ||
* @return {Array.<Object>} - Important words. | ||
*/ | ||
@@ -95,3 +97,3 @@ function getImportantWords(node) { | ||
if (!words[stem]) { | ||
if (!(stem in words)) { | ||
words[stem] = { | ||
@@ -120,3 +122,3 @@ 'matches': [match], | ||
* results. | ||
* @return {Array.<Object>} | ||
* @return {Array.<Object>} - Results. | ||
*/ | ||
@@ -181,3 +183,3 @@ function filterResults(results, maximum) { | ||
* when iterating backwards, `1` when iterating forwards. | ||
* @return {Object} | ||
* @return {Object} - Phrase. | ||
*/ | ||
@@ -221,3 +223,3 @@ function findPhraseInDirection(node, index, parent, offset) { | ||
* @param {Array.<*>} next - Things after `current`. | ||
* @return {Array.<*>} | ||
* @return {Array.<*>} - Result. | ||
*/ | ||
@@ -232,3 +234,3 @@ function merge(prev, current, next) { | ||
* @param {Object} match - Single match. | ||
* @return {Object} | ||
* @return {Object} - One phrase. | ||
*/ | ||
@@ -256,3 +258,3 @@ function findPhrase(match) { | ||
* results. | ||
* @return {Array.<Object>} | ||
* @return {Array.<Object>} - Keyphrases. | ||
*/ | ||
@@ -259,0 +261,0 @@ function getKeyphrases(results, maximum) { |
{ | ||
"name": "retext-keywords", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Keyword extraction with Retext", | ||
@@ -27,34 +27,35 @@ "license": "MIT", | ||
}, | ||
"author": "Titus Wormer <tituswormer@gmail.com>", | ||
"bugs": "https://github.com/wooorm/retext-keywords/issues", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"contributors": [ | ||
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"Vladimir Starkov <iamstarkov@gmail.com>" | ||
], | ||
"devDependencies": { | ||
"browserify": "^11.0.1", | ||
"chalk": "^1.0.0", | ||
"eslint": "^1.0.0", | ||
"browserify": "^13.0.1", | ||
"eslint": "^2.0.0", | ||
"esmangle": "^1.0.1", | ||
"istanbul": "^0.3.0", | ||
"jscs": "^2.0.0", | ||
"jscs-jsdoc": "^1.0.0", | ||
"mdast": "^1.0.0", | ||
"mdast-comment-config": "^1.0.0", | ||
"mdast-github": "^1.0.0", | ||
"mdast-lint": "^1.0.0", | ||
"mdast-slug": "^1.0.0", | ||
"mdast-validate-links": "^1.0.0", | ||
"istanbul": "^0.4.0", | ||
"jscs": "^3.0.0", | ||
"jscs-jsdoc": "^2.0.0", | ||
"remark": "^4.0.0", | ||
"remark-comment-config": "^3.0.0", | ||
"remark-github": "^4.0.1", | ||
"remark-lint": "^4.0.0", | ||
"remark-validate-links": "^3.0.0", | ||
"mocha": "^2.0.0", | ||
"retext": "^1.0.0-rc.2" | ||
"retext": "^2.0.0" | ||
}, | ||
"scripts": { | ||
"test-api": "mocha --check-leaks test.js", | ||
"test-coverage": "istanbul cover _mocha -- test.js", | ||
"test-travis": "npm run test-coverage", | ||
"test": "npm run test-api", | ||
"build-md": "remark . --quiet --frail", | ||
"build-bundle": "browserify index.js --ignore-missing --no-builtins --standalone retextKeywords > retext-keywords.js", | ||
"build-mangle": "esmangle retext-keywords.js > retext-keywords.min.js", | ||
"build": "npm run build-bundle && npm run build-md && npm run build-mangle", | ||
"lint-api": "eslint .", | ||
"lint-style": "jscs --reporter inline .", | ||
"lint": "npm run lint-api && npm run lint-style", | ||
"make": "npm run lint && npm run test-coverage", | ||
"build-bundle": "browserify index.js --ignore-missing --no-builtins --standalone retextPOS > retext-keywords.js", | ||
"postbuild-bundle": "esmangle retext-keywords.js > retext-keywords.min.js", | ||
"build-md": "mdast . --quiet", | ||
"build": "npm run build-bundle && npm run build-md" | ||
"test-api": "mocha --check-leaks test.js", | ||
"test-coverage": "istanbul cover _mocha -- test.js", | ||
"test": "npm run build && npm run lint && npm run test-coverage" | ||
} | ||
} |
@@ -1,8 +0,10 @@ | ||
# retext-keywords [![Build Status](https://img.shields.io/travis/wooorm/retext-keywords.svg)](https://travis-ci.org/wooorm/retext-keywords) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/retext-keywords.svg)](https://codecov.io/github/wooorm/retext-keywords) | ||
# retext-keywords [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
Keyword extraction with [**retext**](https://github.com/wooorm/retext). | ||
<!-- lint disable heading-increment --> | ||
Keyword extraction with [**retext**][retext]. | ||
## Installation | ||
[npm](https://docs.npmjs.com/cli/install): | ||
[npm][npm-install]: | ||
@@ -13,8 +15,2 @@ ```bash | ||
**retext-keywords** is also available for [bower](http://bower.io/#install-packages), | ||
[component](https://github.com/componentjs/component), and | ||
[duo](http://duojs.org/#getting-started), and as an AMD, CommonJS, and globals | ||
module, [uncompressed](retext-keywords.js) and | ||
[compressed](retext-keywords.min.js). | ||
## Usage | ||
@@ -104,14 +100,12 @@ | ||
### [retext](https://github.com/wooorm/retext#api)\.[use](https://github.com/wooorm/retext#retextuseplugin-options)([keywords](#api)\[, options\]) | ||
### `retext.use(keywords[, options])` | ||
Extract keywords and key-phrases from the document. | ||
**Parameters**: | ||
[Read more about `use` »][use] | ||
* `keywords` — This module; | ||
###### Options | ||
* `options` (`Object`, optional): | ||
* `maximum` (default: 5) — Try to detect `words` and `phrases` words; | ||
* `maximum` (default: 5) — Try to detect `words` and `phrases` words; | ||
Note that actual counts may differ. For example, when two words | ||
@@ -156,2 +150,22 @@ have the same score, both will be returned. Or when too few words | ||
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com) | ||
[MIT][license] © [Titus Wormer][author] | ||
<!-- Definitions --> | ||
[travis-badge]: https://img.shields.io/travis/wooorm/retext-keywords.svg | ||
[travis]: https://travis-ci.org/wooorm/retext-keywords | ||
[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/retext-keywords.svg | ||
[codecov]: https://codecov.io/github/wooorm/retext-keywords | ||
[npm-install]: https://docs.npmjs.com/cli/install | ||
[license]: LICENSE | ||
[author]: http://wooorm.com | ||
[retext]: https://github.com/wooorm/retext | ||
[use]: https://github.com/wooorm/retext#retextuseplugin-options |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
13
358
169
17510
4