natural 6.9.1 → 6.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ THE SOFTWARE.
23
23
  'use strict'
24
24
 
25
25
  const stopwords = require('../util/stopwords_nl')
26
- const Tokenizer = require('../tokenizers/aggressive_tokenizer')
26
+ const Tokenizer = require('../tokenizers/aggressive_tokenizer_nl')
27
27
 
28
28
  class Stemmer {
29
29
  stem (token) {
@@ -35,5 +35,10 @@ module.exports = AggressiveTokenizer
35
35
  AggressiveTokenizer.prototype.tokenize = function (text) {
36
36
  // break a string up into an array of tokens by anything non-word
37
37
  // underscore is considered to be non word character
38
- return this.trim(text.split(/[\W|_]+/))
38
+ // Old splitter:
39
+ // return this.trim(text.split(/[\W|_]+/))
40
+ // New splitter:
41
+ // Explicitly mentions which characters make up words.
42
+ // So words may contain hyphen -, single quote ' and slash /
43
+ return this.trim(text.split(/[^a-zA-Z0-9'\-/]+/))
39
44
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "natural",
3
3
  "description": "General natural language (tokenizing, stemming (English, Russian, Spanish), part-of-speech tagging, sentiment analysis, classification, inflection, phonetics, tfidf, WordNet, jaro-winkler, Levenshtein distance, Dice's Coefficient) facilities for node.",
4
- "version": "6.9.1",
4
+ "version": "6.9.2",
5
5
  "homepage": "https://github.com/NaturalNode/natural",
6
6
  "repository": {
7
7
  "type": "git",