diff --git a/packages/yoastseo/src/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js b/packages/yoastseo/src/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js index 1dfe87dab38..387fe5fa6f5 100644 --- a/packages/yoastseo/src/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js +++ b/packages/yoastseo/src/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js @@ -17,7 +17,7 @@ export default function checkIfWordIsComplex( config, word, premiumData ) { // All words are converted to lower case before processing to avoid excluding complex words that start with a capital letter. word = word.toLowerCase(); - // The German word is not complex if its length is 10 characters or less. + // The German word is not complex if its length is 10 characters or fewer. if ( word.length <= lengthLimit ) { return false; } diff --git a/packages/yoastseo/src/languageProcessing/researches/wordComplexity.js b/packages/yoastseo/src/languageProcessing/researches/wordComplexity.js index 0bdcc20129f..e21aabcd32c 100644 --- a/packages/yoastseo/src/languageProcessing/researches/wordComplexity.js +++ b/packages/yoastseo/src/languageProcessing/researches/wordComplexity.js @@ -38,18 +38,22 @@ const getComplexWords = function( currentSentence, researcher ) { // Filters out function words because function words are not complex. // Words are converted to lowercase before processing to avoid excluding function words that start with a capital letter. const words = allWords.filter( word => ! ( checkIfWordIsFunction ? checkIfWordIsFunction( word ) : functionWords.includes( word ) ) ); - const results = []; + const result = { + complexWords: [], + sentence: currentSentence, + }; + + if ( ! premiumData ) { + return result; + } words.forEach( word => { if ( checkIfWordIsComplex( wordComplexityConfig, word, premiumData ) ) { - results.push( word ); + result.complexWords.push( word ); } } ); - return { - complexWords: results, - sentence: currentSentence, - }; + return result; }; /**