Socket
Socket
Sign inDemoInstall

stm

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stm

Takes in a document, spits out a tokenised and stemmed array of terms.


Version published
Weekly downloads
53
decreased by-39.77%
Maintainers
1
Weekly downloads
 
Created
Source

stm

Takes in a document, spits out a tokenised and stemmed array of terms. Using Porter's Algorithm.

Usage

stm.stem(text, noStopWords). Returns an array of terms, stemmed and without punctuation.

  • text is the string (text document) in which the calculations are to be performed on.
  • noStopWords defaults to true. Set to false if you want to include stop words–e.g words such as "I" and "the".

Note: This is basically a wrapper around the stem-porter library by kastor.

var stm = require('stm');

var str = "you're simply a simplistic house, made for housing";
var stemmed = stm.stem(str); // noStopWords -> `true`
>> ["simpli", "simplist", "hous", "hous"]

var withStopWords = stm.stem(str, false); // turn off the removal of stop words
>> [ 'you', 're', 'simpli', 'a', 'simplist', 'hous', 'made', 'for', 'hous'];

Keywords

FAQs

Package last updated on 18 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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