Comparing version 0.1.1 to 0.1.2
@@ -5,12 +5,9 @@ const defaultStopwords = require('./stopwords_en.js').words | ||
stopwords = stopwords || defaultStopwords | ||
if (( Object.prototype.toString.call(tokens) !== '[object Array]' ) | ||
|| ( Object.prototype.toString.call(stopwords) !== '[object Array]' )) { | ||
if (typeof tokens !== 'object' || typeof stopwords != 'object'){ | ||
throw new Error ('expected Arrays try: removeStopwords(Array[, Array])') | ||
} | ||
return tokens.filter(function (value) { | ||
if (stopwords.indexOf(value.toLowerCase()) === -1) | ||
return value | ||
}) | ||
return tokens.filter(value => stopwords.indexOf(value.toLowerCase()) === -1); | ||
} | ||
exports.ar = require('./stopwords_ar.js').words | ||
exports.da = require('./stopwords_da.js').words | ||
@@ -21,2 +18,3 @@ exports.en = require('./stopwords_en.js').words | ||
exports.fr = require('./stopwords_fr.js').words | ||
exports.hi = require('./stopwords_hi.js').words | ||
exports.it = require('./stopwords_it.js').words | ||
@@ -23,0 +21,0 @@ exports.ja = require('./stopwords_ja.js').words |
@@ -59,2 +59,2 @@ // Original copyright: | ||
// tell the world about the noise words. | ||
module.exports = words | ||
exports.words = words |
{ | ||
"name": "stopword", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"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", |
@@ -40,3 +40,3 @@ # stopword | ||
Arrays of stopwords for the following languages are supplied: da, en, es, fa, fr, it, ja, nl, no, pl, pt, ru, sv, zh | ||
Arrays of stopwords for the following languages are supplied: ar, da, en, es, fa, fr, it, ja, nl, no, pl, pt, ru, sv, zh | ||
@@ -43,0 +43,0 @@ ```javascript |
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
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
50291
21
882