Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tkn

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tkn - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

4

lib/tkn.js

@@ -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']
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc