From e99431ba9fc5f34b96d2968018f310e027b61875 Mon Sep 17 00:00:00 2001 From: Mike Amaral Date: Thu, 30 Apr 2015 11:29:23 -0400 Subject: [PATCH] Added test to ensure that if a true flag is passed in indicating we want to keep stopwords, that they are properly stemmed and included in the output. --- spec/porter_stemmer_spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/porter_stemmer_spec.js b/spec/porter_stemmer_spec.js index 37592a53a..a2c90bdb9 100644 --- a/spec/porter_stemmer_spec.js +++ b/spec/porter_stemmer_spec.js @@ -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']); + }); });