Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added methods to add stopwords to the stemmer at runtime #81

Merged
merged 2 commits into from

2 participants

@egold

No description provided.

@chrisumbel
Owner

thank you!

@chrisumbel chrisumbel merged commit 8c48a25 into NaturalNode:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 15, 2012
  1. @egold
  2. @egold

    Fix issue with stopwords

    egold authored
This page is out of date. Refresh to see the latest.
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 = [];
Something went wrong with that request. Please try again.