Skip to content

Commit

Permalink
Added test to ensure that if a true flag is passed in indicating we w…
Browse files Browse the repository at this point in the history
…ant to keep stopwords, that they are properly stemmed and included in the output.
  • Loading branch information
Mike Amaral committed Apr 30, 2015
1 parent 6eedbb1 commit e99431b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/porter_stemmer_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,8 @@ describe('porter_stemmer', function() {
var allCapitalStopwords = stopwords.words.join(' ').toUpperCase();
expect(allCapitalStopwords.tokenizeAndStem()).toEqual([]);
});

it('should tokenize and stem including stopwords', function() {
expect('My dog is very fun TO play with And another thing, he is A poodle.'.tokenizeAndStem(true)).toEqual(['my', 'dog', 'is', 'veri', 'fun', 'to', 'plai', 'with', 'and', 'anoth', 'thing', 'he', 'is', 'a', 'poodl']);
});
});

0 comments on commit e99431b

Please sign in to comment.