Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added methods to add stop words at runtime

  • Loading branch information...
commit f1c622b360378ec7980fab0429c9c60ad446ada6 1 parent 3ef2d8e
@egold egold authored
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.push(stopWord);
+ };
+
+ stemmer.addStopWords = function(moreStopWords) {
+ stopwords = stopwords.concat(moreStopWords);
+ };
+
stemmer.tokenizeAndStem = function(text, keepStops) {
var stemmedTokens = [];
Please sign in to comment.
Something went wrong with that request. Please try again.