-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
101 changed files
with
996 additions
and
8,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
apps/content-analysis/src/utils/registerPremiumAssessments.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { getLanguagesWithWordComplexity } from "yoastseo/src/helpers/getLanguagesWithWordComplexity"; | ||
|
||
// Configs for the supported languages. | ||
import wordComplexityConfigEnglish from "yoastseo/src/languageProcessing/languages/en/config/wordComplexity"; | ||
import wordComplexityConfigGerman from "yoastseo/src/languageProcessing/languages/de/config/wordComplexity"; | ||
import wordComplexityConfigSpanish from "yoastseo/src/languageProcessing/languages/es/config/wordComplexity"; | ||
import wordComplexityConfigFrench from "yoastseo/src/languageProcessing/languages/fr/config/wordComplexity"; | ||
|
||
// Helpers for the supported languages. | ||
import wordComplexityHelperEnglish from "yoastseo/src/languageProcessing/languages/en/helpers/checkIfWordIsComplex"; | ||
import wordComplexityHelperGerman from "yoastseo/src/languageProcessing/languages/de/helpers/checkIfWordIsComplex"; | ||
import wordComplexityHelperSpanish from "yoastseo/src/languageProcessing/languages/es/helpers/checkIfWordIsComplex"; | ||
import wordComplexityHelperFrench from "yoastseo/src/languageProcessing/languages/fr/helpers/checkIfWordIsComplex"; | ||
// Research. | ||
import wordComplexity from "yoastseo/src/languageProcessing/researches/wordComplexity"; | ||
import keyPhraseDistribution from "yoastseo/src/languageProcessing/researches/keyphraseDistribution"; | ||
|
||
// Assessment. | ||
import WordComplexityAssessment from "yoastseo/src/scoring/assessments/readability/WordComplexityAssessment"; | ||
import KeyphraseDistributionAssessment from "yoastseo/src/scoring/assessments/seo/KeyphraseDistributionAssessment"; | ||
|
||
const helpers = { | ||
de: wordComplexityHelperGerman, | ||
en: wordComplexityHelperEnglish, | ||
es: wordComplexityHelperSpanish, | ||
fr: wordComplexityHelperFrench, | ||
}; | ||
|
||
const configs = { | ||
de: wordComplexityConfigGerman, | ||
en: wordComplexityConfigEnglish, | ||
es: wordComplexityConfigSpanish, | ||
fr: wordComplexityConfigFrench, | ||
}; | ||
|
||
const pluginName = "YoastSEOPremium"; | ||
|
||
export default function( worker, language ) { | ||
if ( getLanguagesWithWordComplexity().includes( language ) ) { | ||
// Get the word complexity config for the specific language. | ||
const wordComplexityConfig = configs[ language ]; | ||
// Get the word complexity helper for the specific language. | ||
const wordComplexityHelper = helpers[ language ]; | ||
// Initialize the assessment for regular content. | ||
const wordComplexityAssessment = new WordComplexityAssessment(); | ||
// Initialize the assessment for cornerstone content. | ||
const wordComplexityAssessmentCornerstone = new WordComplexityAssessment( { | ||
scores: { | ||
acceptableAmount: 3, | ||
}, | ||
} ); | ||
|
||
// Register the word complexity config. | ||
worker.registerResearcherConfig( "wordComplexity", wordComplexityConfig ); | ||
|
||
// Register the word complexity helper. | ||
worker.registerHelper( "checkIfWordIsComplex", wordComplexityHelper ); | ||
|
||
// Register the word complexity research. | ||
worker.registerResearch( "wordComplexity", wordComplexity ); | ||
|
||
// Register the word complexity assessment for regular content. | ||
worker.registerAssessment( "wordComplexity", wordComplexityAssessment, pluginName, "readability" ); | ||
|
||
// Register the word complexity assessment for cornerstone content. | ||
worker.registerAssessment( "wordComplexity", wordComplexityAssessmentCornerstone, pluginName, "cornerstoneReadability" ); | ||
} | ||
const keyphraseDistributionAssessment = new KeyphraseDistributionAssessment(); | ||
worker.registerResearch( "keyphraseDistribution", keyPhraseDistribution ); | ||
worker.registerAssessment( "keyphraseDistributionAssessment", keyphraseDistributionAssessment, pluginName, "seo" ); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ | |
"typescript": "^4.2.4" | ||
}, | ||
"yoast": { | ||
"pluginVersion": "21.4" | ||
"pluginVersion": "21.5" | ||
}, | ||
"version": "0.0.0" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.