Permalink
Browse files

Added methods to add stop words at runtime

  • Loading branch information...
1 parent 3ef2d8e commit f1c622b360378ec7980fab0429c9c60ad446ada6 @egold egold committed Dec 15, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/natural/stemmers/stemmer.js
@@ -30,6 +30,14 @@ module.exports = function() {
return token;
};
+ stemmer.addStopWord = function(stopWord) {
+ stopwords.push(stopWord);
+ };
+
+ stemmer.addStopWords = function(moreStopWords) {
+ stopwords = stopwords.concat(moreStopWords);
+ };
+
stemmer.tokenizeAndStem = function(text, keepStops) {
var stemmedTokens = [];

0 comments on commit f1c622b

Please sign in to comment.