synonym-optimizer
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -14,4 +14,3 @@ "use strict"; | ||
stream.write(`:page-partial:\n\n`); | ||
for (let i = 0; i < languages.length; i++) { | ||
const language = languages[i]; | ||
for (const language of languages) { | ||
stream.write(`== ${language}\n\n`); | ||
@@ -18,0 +17,0 @@ const languageSyn = helper_1.buildLanguageSyn(helper_1.getIso2fromLocale(language)); |
@@ -39,6 +39,3 @@ "use strict"; | ||
scoreAlternative(alternative, stopWordsToAdd, stopWordsToRemove, stopWordsOverride, identicals, debugHolder) { | ||
// console.log(stemmer.stemWord("baby")); | ||
// console.log(stopWordsToAdd); | ||
const stopwords = this.getStopWords(stopWordsToAdd, stopWordsToRemove, stopWordsOverride); | ||
// console.log(stopwords); | ||
const filteredAlt = this.getStemmedWords(alternative, stopwords); | ||
@@ -59,3 +56,2 @@ if (debugHolder) { | ||
} | ||
// console.log(wordsWithPos); | ||
// score | ||
@@ -67,6 +63,4 @@ const score = this.getScore(wordsWithPos); | ||
return score; | ||
// console.log(score); | ||
} | ||
getStemmedWords(text, stopwords) { | ||
// console.log(`getStemmedWords: ${text}`); | ||
const res = this.languageSyn | ||
@@ -83,3 +77,2 @@ .extractWords(text) | ||
}); | ||
// console.log(`getStemmedWords result: ${res}`); | ||
return res; | ||
@@ -108,4 +101,2 @@ } | ||
if (this.languageSyn.stemmer) { | ||
//console.log(`ok ${lang} is valid`); | ||
//console.log(`orig: ${word}, stemmed: ${stemmersCache[lang].stemWord(word)}`); | ||
return this.languageSyn.stemmer.stemWord(word); | ||
@@ -112,0 +103,0 @@ } |
{ | ||
"name": "synonym-optimizer", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "Finds the text which has the least number of repetitions", | ||
@@ -55,3 +55,3 @@ "main": "dist/index.js", | ||
"@types/wink-tokenizer": "^4.0.1", | ||
"rosaenlg-filter": "5.0.0", | ||
"rosaenlg-filter": "5.1.0", | ||
"snowball-stemmer.jsx": "^0.2.3", | ||
@@ -69,3 +69,3 @@ "stopwords-de": "^0.3.0", | ||
}, | ||
"gitHead": "f29cc6f345687b2901f66077f413cecb0ba0d6d7" | ||
"gitHead": "11645a24749c02832b29d6ef71cdf943f89ea81a" | ||
} |
@@ -77,6 +77,10 @@ <!-- | ||
## dependencies and licences | ||
## Misc | ||
The build writes stopwords a asciidoc in the `rosaenlg-doc` module. | ||
## Dependencies and licences | ||
* `wink-tokenizer` to tokenize sentences in multiple languages (MIT). | ||
* `stopwords-en/de/fs/it/es` for standard stopwords lists per language (MIT). | ||
* `snowball-stemmer` to stem words per language (MIT). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
86
44236
526
+ Addedenglish-a-an@3.1.0(transitive)
+ Addedenglish-a-an-list@3.1.0(transitive)
+ Addedfrench-contractions@5.1.0(transitive)
+ Addedrosaenlg-commons@3.1.0(transitive)
+ Addedrosaenlg-filter@5.1.0(transitive)
- Removedenglish-a-an@3.0.0(transitive)
- Removedenglish-a-an-list@3.0.0(transitive)
- Removedfrench-contractions@5.0.0(transitive)
- Removedrosaenlg-commons@3.0.0(transitive)
- Removedrosaenlg-filter@5.0.0(transitive)
Updatedrosaenlg-filter@5.1.0