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

retext-porter-stemmer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retext-porter-stemmer - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

13

package.json
{
"name": "retext-porter-stemmer",
"version": "0.2.2",
"version": "0.2.3",
"description": "Retext implementation of the Porter Stemmer",

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

"dependencies": {
"stemmer": "^0.1.2"
"stemmer": "^0.1.1"
},

@@ -19,6 +19,7 @@ "author": "Titus Wormer <tituswormer@gmail.com>",

"istanbul": "^0.3.0",
"jscs": "^1.7.0",
"jscs": "^1.0.0",
"mocha": "^2.0.0",
"retext": "^0.3.0-rc.2",
"retext": "^0.4.0",
"retext-content": "^0.2.5",
"retext-inspect": "^0.4.0",
"retext-visit": "^0.2.2"

@@ -33,9 +34,9 @@ },

"test-travis": "node_modules/.bin/istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec --check-leaks -u exports test.js",
"lint": "npm run lint-api && npm run lint-test && npm run lint-style",
"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-style": "node_modules/.bin/jscs index.js test.js --reporter=inline",
"coverage": "node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- -- test.js",
"lint": "npm run lint-api && npm run lint-test && npm run lint-style",
"make": "npm run lint && npm run coverage"
}
}

@@ -1,2 +0,2 @@

# retext-porter-stemmer [![Build Status](https://travis-ci.org/wooorm/retext-porter-stemmer.svg?branch=master)](https://travis-ci.org/wooorm/retext-porter-stemmer) [![Coverage Status](https://img.shields.io/coveralls/wooorm/retext-porter-stemmer.svg)](https://coveralls.io/r/wooorm/retext-porter-stemmer?branch=master)
# retext-porter-stemmer [![Build Status](https://img.shields.io/travis/wooorm/retext-porter-stemmer.svg?style=flat)](https://travis-ci.org/wooorm/retext-porter-stemmer) [![Coverage Status](https://img.shields.io/coveralls/wooorm/retext-porter-stemmer.svg?style=flat)](https://coveralls.io/r/wooorm/retext-porter-stemmer?branch=master)

@@ -25,8 +25,9 @@ **[retext](https://github.com/wooorm/retext "Retext")** implementation of the [Porter stemming algorithm](http://tartarus.org/martin/PorterStemmer/).

```js
var Retext = require('retext'),
visit = require('retext-visit'),
porterStemmer = require('retext-porter-stemmer'),
retext;
var Retext = require('retext');
var visit = require('retext-visit');
var inspect = require('retext-inspect');
var porterStemmer = require('retext-porter-stemmer');
retext = new Retext()
var retext = new Retext()
.use(inspect)
.use(visit)

@@ -36,10 +37,14 @@ .use(porterStemmer)

retext.parse('A simple english sentence.', function (err, tree) {
tree.visitType(root.WORD_NODE, function (node) {
console.log(node.toString(), node.data.stem);
tree.visit(tree.WORD_NODE, function (node) {
console.log(node);
});
/**
* 'A', 'A'
* 'simple', 'simpl'
* 'english', 'english'
* 'sentence', 'sentenc'
* WordNode[1] [data={"stem":"a"}]
* └─ TextNode: 'A'
* WordNode[1] [data={"stem":"simpl"}]
* └─ TextNode: 'simple'
* WordNode[1] [data={"stem":"english"}]
* └─ TextNode: 'english'
* WordNode[1] [data={"stem":"sentenc"}]
* └─ TextNode: 'sentence'
*/

@@ -49,7 +54,5 @@ });

The above example uses retext 0.2.0, which is currently in beta. For an example with the stable retext, see [retext-porter-stemmer@0.1.0](https://github.com/wooorm/retext-porter-stemmer/tree/0.1.0).
## API
None, the plugin automatically stems each word (using [wooorm/stemmer](https://github.com/wooorm/stemmer)) when it’s created or changed, and stores the stem in `wordNode.data.stem`.
None, the plugin automatically stems each word (using [wooorm/stemmer](https://github.com/wooorm/stemmer)), and stores the stem in `wordNode.data.stem`.

@@ -56,0 +59,0 @@ ## Related

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