axyseo 2.0.0-alpha.0.0.53 → 2.0.0-alpha.0.0.54
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.
|
@@ -37,7 +37,7 @@ export default class RelatedKeywordsAssessment extends Assessment {
|
|
|
37
37
|
* @param data
|
|
38
38
|
* @param relatedKeywords
|
|
39
39
|
* @param i18n
|
|
40
|
-
* @returns {{score: number,
|
|
40
|
+
* @returns {{score: number, status: string, words}}
|
|
41
41
|
*/
|
|
42
42
|
calculateResult(data, relatedKeywords, i18n) {
|
|
43
43
|
const {
|
|
@@ -80,6 +80,7 @@ export default class RelatedKeywordsAssessment extends Assessment {
|
|
|
80
80
|
});
|
|
81
81
|
assessmentResult.setScore(result.score);
|
|
82
82
|
assessmentResult.setStatus(result.status);
|
|
83
|
+
assessmentResult.setBody(result.words);
|
|
83
84
|
return assessmentResult;
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedKeywordsAssessment.js","names":["merge","AssessmentResult","Assessment","RelatedKeywordsAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","calculateResult","data","relatedKeywords","i18n","totalWordUsed","words","isWordUsedExceeding","status","related_keywords","length","score","getScore","getResult","paper","researcher","getResearch","getData","result","assessmentResult","setScore","setStatus","isApplicable","hasRelatedKeywords"],"sources":["../../../../src/scoring/assessments/readability/RelatedKeywordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'relatedKeywords',\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#duplicate-title',\n priority: 'high',\n title: 'Related keywords',\n content: {\n good: 'Related keyword density is optimized',\n bad:\n 'Consider using at least a related keyword in your page to establish topical relevance.',\n improve: 'Too high related keyword density. Keep related keyword density from 0.5% - 1%.'\n }\n };\n\n this.identifier = 'relatedKeywords';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param i18n\n * @returns {{score: number,
|
|
1
|
+
{"version":3,"file":"RelatedKeywordsAssessment.js","names":["merge","AssessmentResult","Assessment","RelatedKeywordsAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","calculateResult","data","relatedKeywords","i18n","totalWordUsed","words","isWordUsedExceeding","status","related_keywords","length","score","getScore","getResult","paper","researcher","getResearch","getData","result","assessmentResult","setScore","setStatus","setBody","isApplicable","hasRelatedKeywords"],"sources":["../../../../src/scoring/assessments/readability/RelatedKeywordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'relatedKeywords',\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#duplicate-title',\n priority: 'high',\n title: 'Related keywords',\n content: {\n good: 'Related keyword density is optimized',\n bad:\n 'Consider using at least a related keyword in your page to establish topical relevance.',\n improve: 'Too high related keyword density. Keep related keyword density from 0.5% - 1%.'\n }\n };\n\n this.identifier = 'relatedKeywords';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param i18n\n * @returns {{score: number, status: string, words}}\n */\n calculateResult(data, relatedKeywords, i18n) {\n const {totalWordUsed, words, isWordUsedExceeding} = relatedKeywords;\n let status = 'good';\n if (!data?.related_keywords?.length || totalWordUsed <= 0) {\n status = 'bad';\n }\n\n if (isWordUsedExceeding) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n words\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param i18n\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher, i18n}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n\n const result = this.calculateResult(data, relatedKeywords, i18n);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\n assessmentResult.setBody(result.words);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return paper.hasRelatedKeywords();\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;;AAEjB;AACA;AACA;AACA,eAAe,MAAMC,yBAAyB,SAASD,UAAU,CAAC;EAChE;AACF;AACA;AACA;AACA;AACA;AACA;EACEE,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,iBAAiB;MACrBC,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,6FAA6F;MAC/FC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,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