Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: NaturalNode/natural
base: 3ef2d8ede5
...
head fork: NaturalNode/natural
compare: 8c48a25b01
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Dec 15, 2012
@egold egold Added methods to add stop words at runtime f1c622b
@egold egold Fix issue with stopwords c0449f2
Commits on Dec 17, 2012
@chrisumbel chrisumbel Merge pull request #81 from egold/master
Added methods to add stopwords to the stemmer at runtime
8c48a25
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 = [];

No commit comments for this range

Something went wrong with that request. Please try again.