natural 6.1.3 → 6.2.0
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.
|
@@ -27,6 +27,11 @@ const englishAfinnVoca = require('afinn-165')
|
|
|
27
27
|
const spanishAfinnVoca = require('./Spanish/afinnShortSortedSpanish.json')
|
|
28
28
|
const portugueseAfinnVoca = require('./Portuguese/afinnShortSortedPortuguese.json')
|
|
29
29
|
|
|
30
|
+
// Afinn Financial Market News
|
|
31
|
+
// const englishAfinnFinancialMarketNewsVoca = require('afinn-165-financialmarketnews')
|
|
32
|
+
// Use ESM syntax
|
|
33
|
+
const englishAfinnFinancialMarketNewsVoca = require('afinn-165-financialmarketnews').afinnFinancialMarketNews
|
|
34
|
+
|
|
30
35
|
// Senticon
|
|
31
36
|
const spanishSenticonVoca = require('./Spanish/senticon_es.json')
|
|
32
37
|
const englishSenticonVoca = require('./English/senticon_en.json')
|
|
@@ -53,6 +58,9 @@ const languageFiles = {
|
|
|
53
58
|
Spanish: [spanishAfinnVoca, spanishNegations],
|
|
54
59
|
Portuguese: [portugueseAfinnVoca, portugueseNegations]
|
|
55
60
|
},
|
|
61
|
+
afinnFinancialMarketNews: {
|
|
62
|
+
English: [englishAfinnFinancialMarketNewsVoca, englishNegations]
|
|
63
|
+
},
|
|
56
64
|
senticon: {
|
|
57
65
|
Spanish: [spanishSenticonVoca, spanishNegations],
|
|
58
66
|
English: [englishSenticonVoca, englishNegations],
|
|
@@ -37,7 +37,7 @@ export interface RegexTokenizerOptions {
|
|
|
37
37
|
}
|
|
38
38
|
export declare class RegexpTokenizer implements Tokenizer {
|
|
39
39
|
constructor (options: RegexTokenizerOptions)
|
|
40
|
-
tokenize (text: string): string[]
|
|
40
|
+
tokenize (text: string): string[]
|
|
41
41
|
}
|
|
42
42
|
export declare class OrthographyTokenizer implements Tokenizer {
|
|
43
43
|
constructor (options: RegexTokenizerOptions & { language: string })
|
|
@@ -100,7 +100,7 @@ exports.WordTokenizer = WordTokenizer
|
|
|
100
100
|
*
|
|
101
101
|
*/
|
|
102
102
|
const WordPunctTokenizer = function (options) {
|
|
103
|
-
this._pattern = /([A-zÀ-ÿ-]+|[0-9._]+|.|!|\?|'|"|:|;|,|-)/i
|
|
103
|
+
this._pattern = /([A-Za-zÀ-ÿ-]+|[0-9._]+|.|!|\?|'|"|:|;|,|-)/i
|
|
104
104
|
RegexpTokenizer.call(this, options)
|
|
105
105
|
}
|
|
106
106
|
|
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.
|
|
4
|
+
"version": "6.2.0",
|
|
5
5
|
"homepage": "https://github.com/NaturalNode/natural",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"afinn-165": "^1.0.2",
|
|
15
|
+
"afinn-165-financialmarketnews": "^3.0.0",
|
|
15
16
|
"apparatus": "^0.0.10",
|
|
16
17
|
"safe-stable-stringify": "^2.2.0",
|
|
17
18
|
"stopwords-iso": "^1.1.0",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"rimraf": "^2.6.3",
|
|
34
35
|
"sinon": "^1.12.2",
|
|
35
36
|
"standard": "^16.0.3",
|
|
37
|
+
"ts-standard": "^12.0.2",
|
|
36
38
|
"typescript": "^4.9.3",
|
|
37
39
|
"uubench": "^0.0.1",
|
|
38
40
|
"webpack": "^4.29.0",
|
|
@@ -60,7 +62,8 @@
|
|
|
60
62
|
"coverage": "nyc --reporter=lcov npm test",
|
|
61
63
|
"test_io": "NODE_PATH=. node ./node_modules/jasmine/bin/jasmine.js --random=false io_spec/*_spec.js",
|
|
62
64
|
"test_browser": "NODE_PATH=. node ./node_modules/gulp/bin/gulp.js",
|
|
63
|
-
"lint": "eslint . --ext .ts"
|
|
65
|
+
"lint": "eslint . --ext .ts",
|
|
66
|
+
"lint-ts": "ts-standard **/*.ts"
|
|
64
67
|
},
|
|
65
68
|
"license": "MIT",
|
|
66
69
|
"author": "Chris Umbel <chris@chrisumbel.com>",
|