natural 5.1.11 → 5.1.12

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.
@@ -48,7 +48,7 @@ jobs:
48
48
  # Run Linter against code base #
49
49
  ################################
50
50
  - name: Lint Code Base
51
- uses: github/super-linter@v3
51
+ uses: github/super-linter@v4
52
52
  env:
53
53
  VALIDATE_ALL_CODEBASE: false
54
54
  DEFAULT_BRANCH: master
@@ -74,6 +74,7 @@ class SentimentAnalyzer {
74
74
  // or in subsequent execution the polarity will be undefined
75
75
  // shallow copy - requires ES6
76
76
  this.vocabulary = Object.assign({}, languageFiles[type][language][0])
77
+ Object.setPrototypeOf(this.vocabulary, null)
77
78
  if (type === 'senticon') {
78
79
  Object.keys(this.vocabulary).forEach(word => {
79
80
  this.vocabulary[word] = this.vocabulary[word].pol
@@ -93,7 +94,7 @@ class SentimentAnalyzer {
93
94
  }
94
95
 
95
96
  if (stemmer) {
96
- const vocaStemmed = {}
97
+ const vocaStemmed = Object.create(null)
97
98
  for (const token in this.vocabulary) {
98
99
  vocaStemmed[stemmer.stem(token)] = this.vocabulary[token]
99
100
  }
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": "5.1.11",
4
+ "version": "5.1.12",
5
5
  "homepage": "https://github.com/NaturalNode/natural",
6
6
  "repository": {
7
7
  "type": "git",