@nlpjs/sentiment
Advanced tools
Comparing version 4.1.4 to 4.3.0
{ | ||
"name": "@nlpjs/sentiment", | ||
"version": "4.1.4", | ||
"version": "4.3.0", | ||
"description": "Sentiment Analysis", | ||
@@ -28,7 +28,7 @@ "author": { | ||
"dependencies": { | ||
"@nlpjs/core": "^4.1.4", | ||
"@nlpjs/language-min": "^4.1.2", | ||
"@nlpjs/neural": "^4.1.4" | ||
"@nlpjs/core": "^4.3.0", | ||
"@nlpjs/language-min": "^4.3.0", | ||
"@nlpjs/neural": "^4.3.0" | ||
}, | ||
"gitHead": "99500ae2f3e16666fa5cc08a486664ef5267e810" | ||
"gitHead": "68b063504d4cc94d11de373516114befc7c4e648" | ||
} |
@@ -0,0 +0,0 @@ /* |
@@ -65,11 +65,22 @@ /* | ||
prepare(locale, text, settings) { | ||
const pipeline = | ||
this.getPipeline(`${this.settings.tag}-prepare`) || | ||
this.getPipeline(`nlu-${locale || 'en'}-prepare`); | ||
const input = { | ||
text, | ||
locale, | ||
settings: settings || this.settings, | ||
}; | ||
return this.runPipeline(input, pipeline); | ||
const pipeline = this.getPipeline(`${this.settings.tag}-prepare`); | ||
if (pipeline) { | ||
const input = { | ||
text, | ||
locale, | ||
settings: settings || this.settings, | ||
}; | ||
return this.runPipeline(input, pipeline); | ||
} | ||
const stemmer = | ||
this.container.get(`stemmer-${locale}`) || | ||
this.container.get(`stemmer-en`); | ||
if (stemmer) { | ||
return stemmer.tokenizeAndStem(text); | ||
} | ||
const normalized = text | ||
.normalize('NFD') | ||
.replace(/[\u0300-\u036f]/g, '') | ||
.toLowerCase(); | ||
return normalized.split(/[\s,.!?;:([\]'"¡¿)/]+/).filter((x) => x); | ||
} | ||
@@ -76,0 +87,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8985
212
Updated@nlpjs/core@^4.3.0
Updated@nlpjs/language-min@^4.3.0
Updated@nlpjs/neural@^4.3.0