Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

retext-keywords

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retext-keywords - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

32

index.js
'use strict';
/**
/*
* Module dependencies.

@@ -15,3 +15,3 @@ */

/**
/*
* Constants.

@@ -30,3 +30,2 @@ */

*/
function reverseSort(a, b) {

@@ -46,3 +45,2 @@ return b - a;

*/
function filterResults(results, minimum) {

@@ -108,3 +106,2 @@ var filteredResults,

*/
function isImportant(node) {

@@ -130,3 +127,2 @@ return (

*/
function getImportantWords(node) {

@@ -167,3 +163,2 @@ var importantWords;

*/
function getKeywords(options) {

@@ -184,3 +179,2 @@ var minimum;

*/
function findPhraseInDirection(node, direction) {

@@ -230,3 +224,2 @@ var nodes,

*/
function merge(prev, current, next) {

@@ -242,3 +235,2 @@ return prev.reverse().concat([current], next);

*/
function findPhrase(node) {

@@ -264,3 +256,2 @@ var prev = findPhraseInDirection(node, 'prev'),

*/
function getKeyphrases(options) {

@@ -287,3 +278,3 @@ var stemmedPhrases,

/**
/*
* Iterate over all grouped important words...

@@ -297,3 +288,3 @@ */

/**
/*
* Iterate over every occurence of a certain keyword...

@@ -305,3 +296,3 @@ */

/**
/*
* If we've detected the same stemmed

@@ -314,3 +305,3 @@ * phrase somewhere.

/**
/*
* Add weight per phrase to the score of

@@ -322,3 +313,3 @@ * the phrase.

/**
/*
* If this is the first time we walk over

@@ -341,3 +332,3 @@ * the phrase (exact match but containing

/**
/*
* For every stem in phrase, add its

@@ -365,3 +356,3 @@ * score to score.

/**
/*
* Modify its score to be the rounded result of

@@ -384,5 +375,4 @@ * multiplying it with the number of occurances,

*
* @param {Retext}
* @param {Retext} retext
*/
function keywords(retext) {

@@ -409,3 +399,3 @@ var TextOM,

/**
/*
* Expose `keywords`.

@@ -412,0 +402,0 @@ */

{
"name": "retext-keywords",
"version": "0.1.5",
"version": "0.2.0",
"description": "Keyword extraction with Retext",

@@ -16,3 +16,3 @@ "license": "MIT",

"retext-porter-stemmer": "^0.2.2",
"retext-pos": "^0.1.7",
"retext-pos": "^0.2.0",
"retext-visit": "^0.2.2"

@@ -26,21 +26,24 @@ },

"devDependencies": {
"eslint": "^0.10.0",
"eslint": "^0.12.0",
"istanbul": "^0.3.0",
"jscs": "^1.0.0",
"jscs-jsdoc": "^0.4.0",
"matcha": "^0.6.0",
"mocha": "^2.0.0",
"retext": "^0.5.0-rc.1"
"retext": "^0.5.0"
},
"scripts": {
"test": "node_modules/.bin/_mocha --reporter spec --check-leaks -u exports test.js",
"test-travis": "node_modules/.bin/istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec --check-leaks -u exports test.js",
"coverage": "node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- -- test.js",
"lint-api": "node_modules/.bin/eslint index.js",
"lint-test": "node_modules/.bin/eslint test.js --env mocha",
"lint-benchmark": "node_modules/.bin/eslint benchmark.js --global suite,set,bench,before",
"lint-style": "node_modules/.bin/jscs index.js test.js benchmark.js --reporter=inline",
"lint": "npm run lint-api && npm run lint-test && npm run lint-benchmark && npm run lint-style",
"make": "npm run lint && npm run coverage",
"benchmark": "node_modules/.bin/matcha benchmark.js"
"test-api": "_mocha --check-leaks test.js",
"test-coveralls": "istanbul cover _mocha --report lcovonly -- --check-leaks test.js",
"test-coverage": "istanbul cover _mocha -- --check-leaks test.js",
"test-travis": "npm run test-coveralls",
"test": "npm run test-api",
"lint-api": "eslint index.js",
"lint-benchmark": "eslint --global bench,before,suite,set benchmark.js",
"lint-test": "eslint --env mocha test.js",
"lint-style": "jscs --reporter inline index.js benchmark.js test.js",
"lint": "npm run lint-api && npm run lint-benchmark && npm run lint-test && npm run lint-style",
"make": "npm run lint && npm run test-coverage",
"benchmark": "matcha benchmark.js"
}
}

@@ -7,10 +7,18 @@ # retext-keywords [![Build Status](https://img.shields.io/travis/wooorm/retext-keywords.svg?style=flat)](https://travis-ci.org/wooorm/retext-keywords) [![Coverage Status](https://img.shields.io/coveralls/wooorm/retext-keywords.svg?style=flat)](https://coveralls.io/r/wooorm/retext-keywords?branch=master)

npm:
```sh
[npm](https://docs.npmjs.com/cli/install):
```bash
$ npm install retext-keywords
```
```
[Duo](http://duojs.org/#getting-started):
```javascript
var keywords = require('wooorm/retext-keywords');
```
## Usage
```js
```javascript
var Retext = require('retext');

@@ -61,3 +69,3 @@ var keywords = require('retext-keywords');

tree.keywords();
/**
/*
* Array[5]

@@ -95,3 +103,3 @@ * ├─ 0: Object

```js
```javascript
/* See above for an example, and output. */

@@ -117,3 +125,3 @@

```js
```javascript
tree.keyphrases();

@@ -170,3 +178,3 @@ /*

```
```javascript
A big section (10 paragraphs)

@@ -183,2 +191,2 @@ 4,026 op/s » Finding keywords

MIT © [Titus Wormer](http://wooorm.com)
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc