Skip to content
Browse files

Merge pull request #81 from egold/master

Added methods to add stopwords to the stemmer at runtime
  • Loading branch information...
2 parents 3ef2d8e + c0449f2 commit 8c48a25b018c9cc83697ad28ec93cf1a35104d42 @chrisumbel chrisumbel committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/natural/stemmers/stemmer.js
View
8 lib/natural/stemmers/stemmer.js
@@ -30,6 +30,14 @@ module.exports = function() {
return token;
};
+ stemmer.addStopWord = function(stopWord) {
+ stopwords.words.push(stopWord);
+ };
+
+ stemmer.addStopWords = function(moreStopWords) {
+ stopwords.words = stopwords.words.concat(moreStopWords);
+ };
+
stemmer.tokenizeAndStem = function(text, keepStops) {
var stemmedTokens = [];

0 comments on commit 8c48a25

Please sign in to comment.
Something went wrong with that request. Please try again.