Comparing version 0.0.2 to 0.0.3
@@ -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 @@ }), |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
38941
811