Comparing version 0.0.3 to 0.0.4
@@ -25,6 +25,6 @@ var stopwords = require('stopwords').english; /* Dependency. List of english stop words. */ | ||
noStopWords = (typeof noStopWords === 'undefined') ? true : noStopWords; // set default to `true` | ||
text = text.match(regex); // breaking text word-by-word | ||
text = text.toLowerCase().match(regex); // breaking text word-by-word | ||
if (noStopWords) text = text.filter(isStopWord); // removing stopwords | ||
return text; | ||
} | ||
} | ||
} |
{ | ||
"name": "tkn", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Simple word tokeniser that ignores punctuation.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,1 +5,14 @@ tkn | ||
Simple word tokeniser that ignores punctuation. Returning an `Array` of words. | ||
### Usage | ||
`tokenise(text, noStopWords)`. Simply returns an array of terms, without punctuation. | ||
* `text` is the string (text document) in which the calculations are to be performed on. | ||
* `noStopWords` defaults to `true`. Set to `false` if you want to include stop words–e.g words such as "I" and "the". | ||
```javascript | ||
var tkn = require('tkn'); | ||
var str = "you're simply a test, a mere test"; | ||
var tokenised = tkn.tokenise(str); | ||
>> ['simply', 'test', 'mere', 'test'] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3503
66
18