Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

yoastseo

Package Overview
Dependencies
201
Maintainers
5
Versions
166
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.81.0 to 1.82.0-rc.0

src/morphology/arabic/stem.js

13

CHANGELOG.md

@@ -6,2 +6,15 @@ # Change Log

## 1.82.0 September 14th, 2020
### Enhancements
* Adds the following words to the list that's used for the English transition word assessment: 'note that', 'not only', 'initially', 'as opposed to'.
* Improves word tokenization when words are followed by specific Arabic or Urdu punctuation marks.
* Adds passive voice assessment for Arabic, including a check, and a list of Arabic passive verbs with long vowel in their root.
* Adds the consecutive sentences assessment for Arabic.
* Implements the transition words assessment for Arabic.
* Adds the prefixes س and أ to the list of ignored prefixes for Arabic. When the Arabic keyphrase is preceded by س and أ, the basic keyphrase forms will also be created.
* Adds and refactors an external stemmer for Arabic.
### Other
* Sets the threshold for words to be recognized as prominent words from 4 to 2, in case a language has no morphology support. This increases the chance that different word forms are saved, leading to better internal linking suggestions for these languages.
## 1.81.0 August 31st, 2020

@@ -8,0 +21,0 @@ ### Enhancements

9

package.json

@@ -12,3 +12,3 @@ {

"license": "GPL-3.0",
"version": "1.81.0",
"version": "1.82.0-rc.0",
"repository": {

@@ -127,3 +127,6 @@ "type": "git",

"/spec/morphology/polish/stemmerCoverage/goldStandardStems.json",
"/spec/morphology/polish/stemmerCoverage/sampleVocabulary.json"
"/spec/morphology/polish/stemmerCoverage/sampleVocabulary.json",
"/spec/morphology/arabic/stemmerCoverage/generateStems.js",
"/spec/morphology/arabic/stemmerCoverage/goldStandardStems.json",
"/spec/morphology/arabic/stemmerCoverage/sampleVocabulary.json"
],

@@ -145,3 +148,3 @@ "coveragePathIgnorePatterns": [

},
"gitHead": "0d221c3a38ba6a14a685f53ea7b674296b7034ea"
"gitHead": "13bd0e213c37374fd48aced17507c6919ba7c68b"
}

@@ -37,3 +37,3 @@ "use strict";

const availableLanguages = ["en", "de", "fr", "es", "ru", "it", "nl", "pl", "sv", "pt", "id"];
const availableLanguages = ["en", "de", "fr", "es", "ru", "it", "nl", "pl", "sv", "pt", "id", "ar"];

@@ -40,0 +40,0 @@ /**

@@ -33,3 +33,3 @@ "use strict";

const availableLanguages = ["en", "de", "es", "fr", "nl", "it", "ru", "pl", "sv", "pt", "id"];
const availableLanguages = ["en", "de", "es", "fr", "nl", "it", "ru", "pl", "sv", "pt", "id", "ar"];

@@ -36,0 +36,0 @@ /**

@@ -37,3 +37,3 @@ "use strict";

const availableLanguages = ["en", "de", "es", "fr", "nl", "it", "pt", "ru", "ca", "pl", "sv", "hu", "id"];
const availableLanguages = ["en", "de", "es", "fr", "nl", "it", "pt", "ru", "ca", "pl", "sv", "hu", "id", "ar"];

@@ -40,0 +40,0 @@ /**

@@ -12,3 +12,11 @@ "use strict";

// NO-BREAK SPACE.
"\u00a0", " ", ".", ",", "'", "(", ")", "\"", "+", "-", ";", "!", "?", ":", "/", "»", "«", "‹", "›", "<", ">"];
"\u00a0",
// \u06d4 - Urdu full stop
"\u06d4",
// \u061f - Arabic question mark
"\u061f",
// \u060C - Arabic comma
"\u060C",
// \u061B - Arabic semicolon
"\u061B", " ", ".", ",", "'", "(", ")", "\"", "+", "-", ";", "!", "?", ":", "/", "»", "«", "‹", "›", "<", ">"];
};

@@ -15,0 +23,0 @@

@@ -19,3 +19,4 @@ "use strict";

pt: _firstWordExceptions20.default,
id: _firstWordExceptions22.default
id: _firstWordExceptions22.default,
ar: _firstWordExceptions24.default
};

@@ -76,2 +77,6 @@

var _firstWordExceptions23 = require("../researches/arabic/firstWordExceptions.js");
var _firstWordExceptions24 = _interopRequireDefault(_firstWordExceptions23);
var _getLanguage = require("./getLanguage.js");

@@ -78,0 +83,0 @@

@@ -18,3 +18,4 @@ "use strict";

id: _stem12.default,
pl: _stem14.default
pl: _stem14.default,
ar: _stem16.default
};

@@ -57,3 +58,7 @@ };

var _stem15 = require("../morphology/arabic/stem");
var _stem16 = _interopRequireDefault(_stem15);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//# sourceMappingURL=getStemForLanguage.js.map

@@ -69,2 +69,7 @@ "use strict";

};
case "ar":
return {
transitionWords: transitionWordsArabic,
twoPartTransitionWords: _twoPartTransitionWords28.default
};
default:

@@ -187,2 +192,10 @@ case "en":

var _transitionWords27 = require("../researches/arabic/transitionWords.js");
var _transitionWords28 = _interopRequireDefault(_transitionWords27);
var _twoPartTransitionWords27 = require("../researches/arabic/twoPartTransitionWords.js");
var _twoPartTransitionWords28 = _interopRequireDefault(_twoPartTransitionWords27);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -216,2 +229,4 @@

const transitionWordsArabic = (0, _transitionWords28.default)().allWords;
/**

@@ -218,0 +233,0 @@ * Returns transition words for a specific locale.

@@ -15,3 +15,3 @@ "use strict";

function createBasicWordForms(word) {
const prefixes = ["ل", "ب", "ال", "ك", "و", "ف"];
const prefixes = ["ل", "ب", "ال", "ك", "و", "ف", "س", "أ"];
const forms = [];

@@ -18,0 +18,0 @@

@@ -17,4 +17,4 @@ "use strict";

var singleWords = ["accordingly", "additionally", "afterward", "afterwards", "albeit", "also", "although", "altogether", "another", "basically", "because", "before", "besides", "but", "certainly", "chiefly", "comparatively", "concurrently", "consequently", "contrarily", "conversely", "correspondingly", "despite", "doubtedly", "during", "e.g.", "earlier", "emphatically", "equally", "especially", "eventually", "evidently", "explicitly", "finally", "firstly", "following", "formerly", "forthwith", "fourthly", "further", "furthermore", "generally", "hence", "henceforth", "however", "i.e.", "identically", "indeed", "instead", "last", "lastly", "later", "lest", "likewise", "markedly", "meanwhile", "moreover", "nevertheless", "nonetheless", "nor", "notwithstanding", "obviously", "occasionally", "otherwise", "overall", "particularly", "presently", "previously", "rather", "regardless", "secondly", "shortly", "significantly", "similarly", "simultaneously", "since", "so", "soon", "specifically", "still", "straightaway", "subsequently", "surely", "surprisingly", "than", "then", "thereafter", "therefore", "thereupon", "thirdly", "though", "thus", "till", "undeniably", "undoubtedly", "unless", "unlike", "unquestionably", "until", "when", "whenever", "whereas", "while"];
var multipleWords = ["above all", "after all", "after that", "all in all", "all of a sudden", "all things considered", "analogous to", "although this may be true", "analogous to", "another key point", "as a matter of fact", "as a result", "as an illustration", "as can be seen", "as has been noted", "as I have noted", "as I have said", "as I have shown", "as long as", "as much as", "as shown above", "as soon as", "as well as", "at any rate", "at first", "at last", "at least", "at length", "at the present time", "at the same time", "at this instant", "at this point", "at this time", "balanced against", "being that", "by all means", "by and large", "by comparison", "by the same token", "by the time", "compared to", "be that as it may", "coupled with", "different from", "due to", "equally important", "even if", "even more", "even so", "even though", "first thing to remember", "for example", "for fear that", "for instance", "for one thing", "for that reason", "for the most part", "for the purpose of", "for the same reason", "for this purpose", "for this reason", "from time to time", "given that", "given these points", "important to realize", "in a word", "in addition", "in another case", "in any case", "in any event", "in brief", "in case", "in conclusion", "in contrast", "in detail", "in due time", "in effect", "in either case", "in essence", "in fact", "in general", "in light of", "in like fashion", "in like manner", "in order that", "in order to", "in other words", "in particular", "in reality", "in short", "in similar fashion", "in spite of", "in sum", "in summary", "in that case", "in the event that", "in the final analysis", "in the first place", "in the fourth place", "in the hope that", "in the light of", "in the long run", "in the meantime", "in the same fashion", "in the same way", "in the second place", "in the third place", "in this case", "in this situation", "in time", "in truth", "in view of", "inasmuch as", "most compelling evidence", "most important", "must be remembered", "not to mention", "now that", "of course", "on account of", "on balance", "on condition that", "on one hand", "on the condition that", "on the contrary", "on the negative side", "on the other hand", "on the positive side", "on the whole", "on this occasion", "once", "once in a while", "only if", "owing to", "point often overlooked", "prior to", "provided that", "seeing that", "so as to", "so far", "so long as", "so that", "sooner or later", "such as", "summing up", "take the case of", "that is", "that is to say", "then again", "this time", "to be sure", "to begin with", "to clarify", "to conclude", "to demonstrate", "to emphasize", "to enumerate", "to explain", "to illustrate", "to list", "to point out", "to put it another way", "to put it differently", "to repeat", "to rephrase it", "to say nothing of", "to sum up", "to summarize", "to that end", "to the end that", "to this end", "together with", "under those circumstances", "until now", "up against", "up to the present time", "vis a vis", "what's more", "while it may be true", "while this may be true", "with attention to", "with the result that", "with this in mind", "with this intention", "with this purpose in mind", "without a doubt", "without delay", "without doubt", "without reservation"];
var singleWords = ["accordingly", "additionally", "afterward", "afterwards", "albeit", "also", "although", "altogether", "another", "basically", "because", "before", "besides", "but", "certainly", "chiefly", "comparatively", "concurrently", "consequently", "contrarily", "conversely", "correspondingly", "despite", "doubtedly", "during", "e.g.", "earlier", "emphatically", "equally", "especially", "eventually", "evidently", "explicitly", "finally", "firstly", "following", "formerly", "forthwith", "fourthly", "further", "furthermore", "generally", "hence", "henceforth", "however", "i.e.", "identically", "indeed", "initially", "instead", "last", "lastly", "later", "lest", "likewise", "markedly", "meanwhile", "moreover", "nevertheless", "nonetheless", "nor", "notwithstanding", "obviously", "occasionally", "otherwise", "overall", "particularly", "presently", "previously", "rather", "regardless", "secondly", "shortly", "significantly", "similarly", "simultaneously", "since", "so", "soon", "specifically", "still", "straightaway", "subsequently", "surely", "surprisingly", "than", "then", "thereafter", "therefore", "thereupon", "thirdly", "though", "thus", "till", "undeniably", "undoubtedly", "unless", "unlike", "unquestionably", "until", "when", "whenever", "whereas", "while"];
var multipleWords = ["above all", "after all", "after that", "all in all", "all of a sudden", "all things considered", "analogous to", "although this may be true", "analogous to", "another key point", "as a matter of fact", "as a result", "as an illustration", "as can be seen", "as has been noted", "as I have noted", "as I have said", "as I have shown", "as long as", "as much as", "as opposed to", "as shown above", "as soon as", "as well as", "at any rate", "at first", "at last", "at least", "at length", "at the present time", "at the same time", "at this instant", "at this point", "at this time", "balanced against", "being that", "by all means", "by and large", "by comparison", "by the same token", "by the time", "compared to", "be that as it may", "coupled with", "different from", "due to", "equally important", "even if", "even more", "even so", "even though", "first thing to remember", "for example", "for fear that", "for instance", "for one thing", "for that reason", "for the most part", "for the purpose of", "for the same reason", "for this purpose", "for this reason", "from time to time", "given that", "given these points", "important to realize", "in a word", "in addition", "in another case", "in any case", "in any event", "in brief", "in case", "in conclusion", "in contrast", "in detail", "in due time", "in effect", "in either case", "in essence", "in fact", "in general", "in light of", "in like fashion", "in like manner", "in order that", "in order to", "in other words", "in particular", "in reality", "in short", "in similar fashion", "in spite of", "in sum", "in summary", "in that case", "in the event that", "in the final analysis", "in the first place", "in the fourth place", "in the hope that", "in the light of", "in the long run", "in the meantime", "in the same fashion", "in the same way", "in the second place", "in the third place", "in this case", "in this situation", "in time", "in truth", "in view of", "inasmuch as", "most compelling evidence", "most important", "must be remembered", "not only", "not to mention", "note that", "now that", "of course", "on account of", "on balance", "on condition that", "on one hand", "on the condition that", "on the contrary", "on the negative side", "on the other hand", "on the positive side", "on the whole", "on this occasion", "once", "once in a while", "only if", "owing to", "point often overlooked", "prior to", "provided that", "seeing that", "so as to", "so far", "so long as", "so that", "sooner or later", "such as", "summing up", "take the case of", "that is", "that is to say", "then again", "this time", "to be sure", "to begin with", "to clarify", "to conclude", "to demonstrate", "to emphasize", "to enumerate", "to explain", "to illustrate", "to list", "to point out", "to put it another way", "to put it differently", "to repeat", "to rephrase it", "to say nothing of", "to sum up", "to summarize", "to that end", "to the end that", "to this end", "together with", "under those circumstances", "until now", "up against", "up to the present time", "vis a vis", "what's more", "while it may be true", "while this may be true", "with attention to", "with the result that", "with this in mind", "with this intention", "with this purpose in mind", "without a doubt", "without delay", "without doubt", "without reservation"];

@@ -21,0 +21,0 @@ /**

@@ -64,3 +64,3 @@ "use strict";

const morphologicalLanguages = ["ru", "tr", "sv", "id"];
const morphologicalLanguages = ["ru", "tr", "sv", "id", "ar"];
const periphrasticLanguages = ["en", "de", "nl", "fr", "es", "it", "pt", "cn", "pl"];

@@ -67,0 +67,0 @@

@@ -74,9 +74,19 @@ "use strict";

/*
* If morphology data are available for a language, the minimum number of occurrences to consider a word to be prominent is 4.
* This minimum number was chosen in order to avoid premature suggestions of words from the paper attributes.
* These get a times-3 boost and would therefore be prominent with just 1 occurrence.
*
* If morphology data are not available, and therefore word forms are not recognized, the minimum threshold is lowered to 2.
*/
let minimumNumberOfOccurrences = 4;
if (!morphologyData) {
minimumNumberOfOccurrences = 2;
}
/*
* Return the 100 top items from the collapsed and sorted list. The number is picked deliberately to prevent larger
* articles from getting too long of lists.
*
* Minimum required occurrences set to 4 in order to avoid premature suggestions of words from the paper attributes.
* These get a times-3 boost and would therefore be prominent with just 1 occurrence.
*/
result.prominentWords = (0, _lodashEs.take)((0, _determineProminentWords.filterProminentWords)(collapsedWords, 4), 100);
result.prominentWords = (0, _lodashEs.take)((0, _determineProminentWords.filterProminentWords)(collapsedWords, minimumNumberOfOccurrences), 100);

@@ -83,0 +93,0 @@ return result;

@@ -15,2 +15,6 @@ "use strict";

}
if (language === "ar") {
return determineSentenceIsPassiveArabic(sentenceText, language);
}
};

@@ -36,2 +40,6 @@

var _passiveVerbsWithLongVowel = require("../../arabic/passiveVoice/passiveVerbsWithLongVowel");
var _passiveVerbsWithLongVowel2 = _interopRequireDefault(_passiveVerbsWithLongVowel);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -49,2 +57,4 @@

const getPassiveVerbsArabic = (0, _passiveVerbsWithLongVowel2.default)();
/**

@@ -120,2 +130,29 @@ * Matches the sentence against passive verbs.

/**
* Checks the passed sentence to see if it contains Arabic passive verb-forms.
*
* @param {string} sentence The sentence to match against.
* @returns {Boolean} Whether the sentence contains Arabic passive voice.
*/
const determineSentenceIsPassiveArabic = function determineSentenceIsPassiveArabic(sentence) {
const arabicPrepositionalPrefix = "و";
const words = (0, _getWords2.default)(sentence);
const passiveVerbs = [];
for (let word of words) {
// Check if the word starts with prefix و
if (word.startsWith(arabicPrepositionalPrefix)) {
word = word.slice(1);
}
// Check if the first character has a damma or if the word is in the list of Arabic passive verbs
const wordWithDamma = word[1].search("\u064F");
if (wordWithDamma !== -1 || getPassiveVerbsArabic.includes(word)) {
passiveVerbs.push(word);
}
}
return passiveVerbs.length !== 0;
};
/**
* Determines whether a sentence is passive.

@@ -122,0 +159,0 @@ *

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.default = function (matchString, positiveLookAhead = false, extraWordBoundary = "", locale = "") {
var wordBoundary, wordBoundaryStart, wordBoundaryEnd;
var wordBoundary, wordBoundaryStart, wordBoundaryEnd;
if (locale === "id_ID") {
wordBoundary = "[ \\u00a0 \\n\\r\\t\.,\(\)”“〝〞〟‟„\"+;!¡?¿:\/»«‹›" + extraWordBoundary + "<>";
} else {
wordBoundary = "[ \\u00a0 \\n\\r\\t\.,\(\)”“〝〞〟‟„\"+\\-;!¡?¿:\/»«‹›" + extraWordBoundary + "<>";
}
if (locale === "id_ID") {
wordBoundary = "[ \\u00a0 \\n\\r\\t\.,\(\)”“〝〞〟‟„\"+;!¡?¿:\/»«‹›" + extraWordBoundary + "<>";
} else {
/*
* \u00a0 - no-break space
* \u06d4 - Urdu full stop
* \u061f - Arabic question mark
* \u060C - Arabic comma
* \u061B - Arabic semicolon
*/
wordBoundary = "[ \\u00a0\\u06d4\\u061f\\u060C\\u061B \\n\\r\\t\.,\(\)”“〝〞〟‟„\"+\\-;!¡?¿:\/»«‹›" + extraWordBoundary + "<>";
}
wordBoundaryStart = "(^|" + wordBoundary + "'‘’‛`])";
if (positiveLookAhead) {
wordBoundaryEnd = "($|((?=" + wordBoundary + "]))|((['‘’‛`])(" + wordBoundary + "])))";
} else {
wordBoundaryEnd = "($|(" + wordBoundary + "])|((['‘’‛`])(" + wordBoundary + "])))";
}
wordBoundaryStart = "(^|" + wordBoundary + "'‘’‛`])";
if (positiveLookAhead) {
wordBoundaryEnd = "($|((?=" + wordBoundary + "]))|((['‘’‛`])(" + wordBoundary + "])))";
} else {
wordBoundaryEnd = "($|(" + wordBoundary + "])|((['‘’‛`])(" + wordBoundary + "])))";
}
return wordBoundaryStart + matchString + wordBoundaryEnd;
return wordBoundaryStart + matchString + wordBoundaryEnd;
};
//# sourceMappingURL=addWordboundary.js.map

@@ -14,4 +14,13 @@ "use strict";

// Replace all other punctuation characters at the beginning or at the end of a word.
var punctuationRegexString = "[\\–\\-\\(\\)_\\[\\]’“”\"'.?!:;,¿¡«»‹›\u2014\u00d7\u002b\u0026\<\>]+";
/*
* \u2014 - em-dash
* \u00d7 - multiplication sign
* \u002b - plus sign
* \u0026 - ampersand
* \u06d4 - Urdu full stop
* \u061f - Arabic question mark
* \u060C - Arabic comma
* \u061B - Arabic semicolon
*/
var punctuationRegexString = "[\\–\\-\\(\\)_\\[\\]’“”\"'.?!:;,¿¡«»‹›\u2014\u00d7\u002b\u0026\u06d4\u061f\u060C\u061B\\<\>]+";
var punctuationRegexStart = new RegExp("^" + punctuationRegexString);

@@ -18,0 +27,0 @@ var punctuationRegexEnd = new RegExp(punctuationRegexString + "$");

@@ -6,3 +6,10 @@ "use strict";

});
const wordBoundary = "[ \\u00a0 \\n\\r\\t.,'()\"+\\-;!?:/»«‹›<>]";
/*
* \u00a0 - No-break space
* \u06d4 - Urdu full stop
* \u061f - Arabic question mark
* \u060C - Arabic comma
* \u061B - Arabic semicolon
*/
const wordBoundary = "[ \\u00a0\\u06d4\\u061f\\u060C\\u061B \\n\\r\\t.,'()\"+\\-;!?:/»«‹›<>]";
const wordBoundaryStart = new RegExp("^(" + wordBoundary + "+)", "ig");

@@ -9,0 +16,0 @@ const wordBoundaryEnd = new RegExp("(" + wordBoundary + "+$)", "ig");

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc