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

stopword

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stopword - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

8

lib/stopword.js

@@ -18,10 +18,12 @@ var _ = require('lodash');

exports.getStopwords = function(languageCode) {
exports.getStopwords = function(lang) {
var defaultLang = 'en';
lang = lang || defaultLang;
try {
return require('./stopwords_' + languageCode + '.js').words;
return require('./stopwords_' + lang + '.js').words;
}
catch(e) {
throw new Error('no list for ' + languageCode +
throw new Error('no list for ' + lang +
' getStopwords has lists for en, es, fa, fr, it, ja, nl, no, pl, pt, ru, zh');
}
}
{
"name": "stopword",
"version": "0.0.2",
"version": "0.0.3",
"description": "A module for node.js that takes in text and returns text that is stripped of stopwords",

@@ -5,0 +5,0 @@ "main": "lib/stopword.js",

@@ -50,2 +50,8 @@ //force travis build

newString.should.be.exactly('tekst nørske tegn øæåø øæåø æææ');
}),
it('getStopwords should default to "en"', function(){
var swDict = sw.getStopwords();
swDict[0].should.be.exactly('about');
swDict[1].should.be.exactly('after');
swDict[2].should.be.exactly('all');
})

@@ -52,0 +58,0 @@ }),

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