natural 8.2.1 → 8.2.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.
@@ -29,7 +29,9 @@ class SoundEx extends Phonetic {
29
29
  token = token.toLowerCase()
30
30
  let transformed = this.condense(this.transform(token.substr(1, token.length - 1))) // anything that isn't a digit goes
31
31
  // deal with duplicate INITIAL consonant SOUNDS
32
- transformed = transformed.replace(new RegExp('^' + this.transform(token.charAt(0))), '')
32
+ if (transformed.charAt(0) === this.transform(token.charAt(0))) {
33
+ transformed = transformed.slice(1)
34
+ }
33
35
  return token.charAt(0).toUpperCase() + this.padRight0(transformed.replace(/\D/g, '')).substr(0, (maxLength && maxLength - 1) || 3)
34
36
  }
35
37
 
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": "8.2.1",
4
+ "version": "8.2.2",
5
5
  "homepage": "https://github.com/NaturalNode/natural",
6
6
  "repository": {
7
7
  "type": "git",