axyseo 2.0.0-alpha.0.0.4 → 2.0.0-alpha.0.0.6
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.
- package/package.json +5 -2
- package/.browserslistrc +0 -1
- package/.gitattributes +0 -1
- package/babel.config.js +0 -3
- package/eslint.config.mjs +0 -119
- package/src/bundledPlugins/index.js +0 -5
- package/src/bundledPlugins/previouslyUsedKeywords.js +0 -192
- package/src/config/diacritics.js +0 -106
- package/src/config/getTransliterations.js +0 -1447
- package/src/config/transliterationsWPstyle.js +0 -774
- package/src/config/wordBoundaries.js +0 -23
- package/src/config/wordBoundariesWithoutPunctuation.js +0 -9
- package/src/const/analysis.js +0 -41
- package/src/errors/invalidType.js +0 -14
- package/src/errors/missingArgument.js +0 -14
- package/src/helpers/createMeasurementElement.js +0 -40
- package/src/helpers/domManipulation.js +0 -65
- package/src/helpers/errors.js +0 -26
- package/src/helpers/factory.js +0 -219
- package/src/helpers/formatNumber.js +0 -12
- package/src/helpers/formatString.js +0 -33
- package/src/helpers/getLanguagesWithWordComplexity.js +0 -8
- package/src/helpers/getLanguagesWithWordFormSupport.js +0 -11
- package/src/helpers/getWordComplexityConfig.js +0 -20
- package/src/helpers/getWordComplexityHelper.js +0 -20
- package/src/helpers/htmlEntities.js +0 -41
- package/src/helpers/includesAny.js +0 -19
- package/src/helpers/index.js +0 -127
- package/src/helpers/shortlinker/Shortlinker.js +0 -75
- package/src/helpers/shortlinker/index.js +0 -1
- package/src/helpers/shortlinker/singleton.js +0 -68
- package/src/helpers/types.js +0 -34
- package/src/index.js +0 -60
- package/src/languageProcessing/AbstractResearcher.js +0 -366
- package/src/languageProcessing/helpers/highlighting/getMarkingsInSentence.js +0 -125
- package/src/languageProcessing/helpers/html/getFieldsToMark.js +0 -29
- package/src/languageProcessing/helpers/html/getSubheadingTexts.js +0 -47
- package/src/languageProcessing/helpers/html/getSubheadings.js +0 -95
- package/src/languageProcessing/helpers/html/html.js +0 -176
- package/src/languageProcessing/helpers/html/htmlParser.js +0 -145
- package/src/languageProcessing/helpers/html/matchParagraphs.js +0 -62
- package/src/languageProcessing/helpers/html/normalizeHTML.js +0 -16
- package/src/languageProcessing/helpers/image/getAltAttribute.js +0 -20
- package/src/languageProcessing/helpers/image/getImagesInTree.js +0 -16
- package/src/languageProcessing/helpers/image/imageInText.js +0 -19
- package/src/languageProcessing/helpers/index.js +0 -12
- package/src/languageProcessing/helpers/language/getLanguage.js +0 -9
- package/src/languageProcessing/helpers/link/checkNofollow.js +0 -38
- package/src/languageProcessing/helpers/link/getAnchorsFromText.js +0 -32
- package/src/languageProcessing/helpers/link/getLinkType.js +0 -32
- package/src/languageProcessing/helpers/match/findKeywordFormsInString.js +0 -101
- package/src/languageProcessing/helpers/match/isDoubleQuoted.js +0 -13
- package/src/languageProcessing/helpers/match/matchTextWithArray.js +0 -36
- package/src/languageProcessing/helpers/match/matchTextWithTransliteration.js +0 -58
- package/src/languageProcessing/helpers/match/matchTextWithWord.js +0 -45
- package/src/languageProcessing/helpers/match/matchWordFormsWithSentence.js +0 -164
- package/src/languageProcessing/helpers/match/processExactMatchRequest.js +0 -20
- package/src/languageProcessing/helpers/morphology/baseStemmer.js +0 -11
- package/src/languageProcessing/helpers/morphology/buildFormRule.js +0 -19
- package/src/languageProcessing/helpers/morphology/buildTopicStems.js +0 -169
- package/src/languageProcessing/helpers/morphology/createRulesFromArrays.js +0 -45
- package/src/languageProcessing/helpers/morphology/exceptionListHelpers.js +0 -65
- package/src/languageProcessing/helpers/morphology/findMatchingEndingInArray.js +0 -24
- package/src/languageProcessing/helpers/morphology/flattenSortLength.js +0 -14
- package/src/languageProcessing/helpers/morphology/getAllWordsFromPaper.js +0 -39
- package/src/languageProcessing/helpers/morphology/regexHelpers.js +0 -44
- package/src/languageProcessing/helpers/morphology/stemHelpers.js +0 -38
- package/src/languageProcessing/helpers/morphology/stemPrefixedFunctionWords.js +0 -31
- package/src/languageProcessing/helpers/passiveVoice/periphrastic/directPrecedenceException.js +0 -36
- package/src/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/getClausesSplitOnStopWords.js +0 -113
- package/src/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/nonDirectParticiplePrecedenceException.js +0 -45
- package/src/languageProcessing/helpers/passiveVoice/periphrastic/getClauses.js +0 -231
- package/src/languageProcessing/helpers/passiveVoice/periphrastic/getIndicesWithRegex.js +0 -20
- package/src/languageProcessing/helpers/passiveVoice/periphrastic/matchRegularParticiples.js +0 -23
- package/src/languageProcessing/helpers/passiveVoice/periphrastic/precedenceException.js +0 -40
- package/src/languageProcessing/helpers/prominentWords/determineProminentWords.js +0 -238
- package/src/languageProcessing/helpers/regex/createRegexFromArray.js +0 -35
- package/src/languageProcessing/helpers/regex/createRegexFromDoubleArray.js +0 -34
- package/src/languageProcessing/helpers/regex/createWordRegex.js +0 -30
- package/src/languageProcessing/helpers/regex/matchStringWithRegex.js +0 -19
- package/src/languageProcessing/helpers/regex/searchAndReplaceWithOneRegex.js +0 -14
- package/src/languageProcessing/helpers/sanitize/doubleQuotes.js +0 -12
- package/src/languageProcessing/helpers/sanitize/filterShortcodesFromTree.js +0 -131
- package/src/languageProcessing/helpers/sanitize/mergeListItems.js +0 -24
- package/src/languageProcessing/helpers/sanitize/parseSynonyms.js +0 -20
- package/src/languageProcessing/helpers/sanitize/quotes.js +0 -46
- package/src/languageProcessing/helpers/sanitize/removeEmailAddresses.js +0 -12
- package/src/languageProcessing/helpers/sanitize/removePunctuation.js +0 -64
- package/src/languageProcessing/helpers/sanitize/removePunctuationExceptQuotes.js +0 -18
- package/src/languageProcessing/helpers/sanitize/removeSentenceTerminators.js +0 -13
- package/src/languageProcessing/helpers/sanitize/removeURLs.js +0 -13
- package/src/languageProcessing/helpers/sanitize/sanitizeLineBreakTag.js +0 -11
- package/src/languageProcessing/helpers/sanitize/sanitizeString.js +0 -18
- package/src/languageProcessing/helpers/sanitize/stripHTMLTags.js +0 -57
- package/src/languageProcessing/helpers/sanitize/stripNonTextTags.js +0 -15
- package/src/languageProcessing/helpers/sanitize/stripNumbers.js +0 -21
- package/src/languageProcessing/helpers/sanitize/stripSpaces.js +0 -23
- package/src/languageProcessing/helpers/sanitize/stripWordBoundaries.js +0 -65
- package/src/languageProcessing/helpers/sanitize/unifyWhitespace.js +0 -61
- package/src/languageProcessing/helpers/sentence/SentenceTokenizer.js +0 -640
- package/src/languageProcessing/helpers/sentence/countSentences.js +0 -20
- package/src/languageProcessing/helpers/sentence/getSentences.js +0 -65
- package/src/languageProcessing/helpers/sentence/getSentencesFromTree.js +0 -55
- package/src/languageProcessing/helpers/sentence/memoizedSentenceTokenizer.js +0 -28
- package/src/languageProcessing/helpers/sentence/sentencesLength.js +0 -31
- package/src/languageProcessing/helpers/syllables/DeviationFragment.js +0 -112
- package/src/languageProcessing/helpers/syllables/countSyllables.js +0 -182
- package/src/languageProcessing/helpers/syllables/syllableCountIterator.js +0 -56
- package/src/languageProcessing/helpers/syllables/syllableCountStep.js +0 -68
- package/src/languageProcessing/helpers/transform/transformWordsWithHyphens.js +0 -17
- package/src/languageProcessing/helpers/transliterate/replaceDiacritics.js +0 -22
- package/src/languageProcessing/helpers/transliterate/specialCharacterMappings.js +0 -214
- package/src/languageProcessing/helpers/transliterate/transliterate.js +0 -20
- package/src/languageProcessing/helpers/transliterate/transliterateWPstyle.js +0 -21
- package/src/languageProcessing/helpers/url/parseSlug.js +0 -10
- package/src/languageProcessing/helpers/url/url.js +0 -172
- package/src/languageProcessing/helpers/word/addWordboundary.js +0 -37
- package/src/languageProcessing/helpers/word/areWordsInSentence.js +0 -16
- package/src/languageProcessing/helpers/word/countMetaDescriptionLength.js +0 -18
- package/src/languageProcessing/helpers/word/countWords.js +0 -14
- package/src/languageProcessing/helpers/word/createPunctuationTokens.js +0 -42
- package/src/languageProcessing/helpers/word/filterWordsFromArray.js +0 -15
- package/src/languageProcessing/helpers/word/followsIndex.js +0 -25
- package/src/languageProcessing/helpers/word/getAllWordsFromTree.js +0 -23
- package/src/languageProcessing/helpers/word/getWords.js +0 -43
- package/src/languageProcessing/helpers/word/includesIndex.js +0 -30
- package/src/languageProcessing/helpers/word/indices.js +0 -146
- package/src/languageProcessing/helpers/word/markWordsInSentences.js +0 -173
- package/src/languageProcessing/helpers/word/matchWordInSentence.js +0 -61
- package/src/languageProcessing/helpers/word/splitIntoTokens.js +0 -46
- package/src/languageProcessing/index.js +0 -91
- package/src/languageProcessing/languages/_default/Researcher.js +0 -34
- package/src/languageProcessing/languages/_default/helpers/getStemmer.js +0 -11
- package/src/languageProcessing/languages/ar/Researcher.js +0 -46
- package/src/languageProcessing/languages/ar/config/firstWordExceptions.js +0 -14
- package/src/languageProcessing/languages/ar/config/functionWords.js +0 -329
- package/src/languageProcessing/languages/ar/config/internal/passiveVerbsWithLongVowel.js +0 -570
- package/src/languageProcessing/languages/ar/config/prefixedFunctionWords.js +0 -5
- package/src/languageProcessing/languages/ar/config/transitionWords.js +0 -19
- package/src/languageProcessing/languages/ar/config/twoPartTransitionWords.js +0 -7
- package/src/languageProcessing/languages/ar/helpers/createBasicWordForms.js +0 -32
- package/src/languageProcessing/languages/ar/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/ar/helpers/internal/stem.js +0 -632
- package/src/languageProcessing/languages/ar/helpers/isPassiveSentence.js +0 -33
- package/src/languageProcessing/languages/ca/Researcher.js +0 -43
- package/src/languageProcessing/languages/ca/config/sentenceLength.js +0 -3
- package/src/languageProcessing/languages/ca/config/transitionWords.js +0 -31
- package/src/languageProcessing/languages/ca/config/twoPartTransitionWords.js +0 -7
- package/src/languageProcessing/languages/ca/helpers/getStemmer.js +0 -11
- package/src/languageProcessing/languages/cs/Researcher.js +0 -44
- package/src/languageProcessing/languages/cs/config/firstWordExceptions.js +0 -15
- package/src/languageProcessing/languages/cs/config/functionWords.js +0 -121
- package/src/languageProcessing/languages/cs/config/internal/passiveVoiceAuxiliaries.js +0 -38
- package/src/languageProcessing/languages/cs/config/internal/passiveVoiceEndings.js +0 -54
- package/src/languageProcessing/languages/cs/config/stopWords.js +0 -42
- package/src/languageProcessing/languages/cs/config/transitionWords.js +0 -26
- package/src/languageProcessing/languages/cs/config/twoPartTransitionWords.js +0 -8
- package/src/languageProcessing/languages/cs/helpers/getClauses.js +0 -26
- package/src/languageProcessing/languages/cs/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/cs/helpers/internal/getParticiples.js +0 -16
- package/src/languageProcessing/languages/cs/helpers/internal/stem.js +0 -499
- package/src/languageProcessing/languages/cs/values/Clause.js +0 -34
- package/src/languageProcessing/languages/de/Researcher.js +0 -52
- package/src/languageProcessing/languages/de/config/firstWordExceptions.js +0 -17
- package/src/languageProcessing/languages/de/config/functionWords.js +0 -303
- package/src/languageProcessing/languages/de/config/internal/exceptionsParticiplesActive.js +0 -2231
- package/src/languageProcessing/languages/de/config/internal/passiveVoiceAuxiliaries.js +0 -96
- package/src/languageProcessing/languages/de/config/internal/passiveVoiceIrregulars.js +0 -368
- package/src/languageProcessing/languages/de/config/internal/passiveVoiceRegex.js +0 -72
- package/src/languageProcessing/languages/de/config/keyphraseLength.js +0 -11
- package/src/languageProcessing/languages/de/config/stopWords.js +0 -67
- package/src/languageProcessing/languages/de/config/syllables.json +0 -460
- package/src/languageProcessing/languages/de/config/transitionWords.js +0 -31
- package/src/languageProcessing/languages/de/config/twoPartTransitionWords.js +0 -12
- package/src/languageProcessing/languages/de/config/wordComplexity.js +0 -4
- package/src/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js +0 -18
- package/src/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js +0 -40
- package/src/languageProcessing/languages/de/helpers/checkIfWordIsFunction.js +0 -15
- package/src/languageProcessing/languages/de/helpers/getClauses.js +0 -25
- package/src/languageProcessing/languages/de/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/de/helpers/internal/SentenceTokenizer.js +0 -31
- package/src/languageProcessing/languages/de/helpers/internal/detectAndStemRegularParticiple.js +0 -128
- package/src/languageProcessing/languages/de/helpers/internal/determineStem.js +0 -128
- package/src/languageProcessing/languages/de/helpers/internal/getParticiples.js +0 -40
- package/src/languageProcessing/languages/de/helpers/internal/stem.js +0 -215
- package/src/languageProcessing/languages/de/helpers/memoizedSentenceTokenizer.js +0 -28
- package/src/languageProcessing/languages/de/values/Clause.js +0 -85
- package/src/languageProcessing/languages/el/Researcher.js +0 -46
- package/src/languageProcessing/languages/el/config/firstWordExceptions.js +0 -47
- package/src/languageProcessing/languages/el/config/functionWords.js +0 -116
- package/src/languageProcessing/languages/el/config/internal/auxiliaries.js +0 -19
- package/src/languageProcessing/languages/el/config/internal/morphologicalPassiveSuffixes.js +0 -87
- package/src/languageProcessing/languages/el/config/internal/nonPassiveVerbStems.js +0 -138
- package/src/languageProcessing/languages/el/config/stopWords.js +0 -854
- package/src/languageProcessing/languages/el/config/transitionWords.js +0 -26
- package/src/languageProcessing/languages/el/config/twoPartTransitionWords.js +0 -10
- package/src/languageProcessing/languages/el/helpers/getClauses.js +0 -25
- package/src/languageProcessing/languages/el/helpers/getStemmer.js +0 -21
- package/src/languageProcessing/languages/el/helpers/internal/getParticiples.js +0 -20
- package/src/languageProcessing/languages/el/helpers/internal/stem.js +0 -368
- package/src/languageProcessing/languages/el/helpers/isPassiveSentence.js +0 -38
- package/src/languageProcessing/languages/el/values/Clause.js +0 -37
- package/src/languageProcessing/languages/en/Researcher.js +0 -46
- package/src/languageProcessing/languages/en/config/abbreviations.js +0 -55
- package/src/languageProcessing/languages/en/config/firstWordExceptions.js +0 -14
- package/src/languageProcessing/languages/en/config/functionWords.js +0 -186
- package/src/languageProcessing/languages/en/config/internal/passiveVoiceAuxiliaries.js +0 -44
- package/src/languageProcessing/languages/en/config/internal/passiveVoiceIrregulars.js +0 -354
- package/src/languageProcessing/languages/en/config/internal/passiveVoiceNonVerbEndingEd.js +0 -3047
- package/src/languageProcessing/languages/en/config/regularParticiplesRegex.js +0 -5
- package/src/languageProcessing/languages/en/config/stopWords.js +0 -52
- package/src/languageProcessing/languages/en/config/syllables.json +0 -86
- package/src/languageProcessing/languages/en/config/transitionWords.js +0 -48
- package/src/languageProcessing/languages/en/config/twoPartTransitionWords.js +0 -7
- package/src/languageProcessing/languages/en/config/wordComplexity.js +0 -5
- package/src/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js +0 -18
- package/src/languageProcessing/languages/en/helpers/checkIfWordIsComplex.js +0 -43
- package/src/languageProcessing/languages/en/helpers/getClauses.js +0 -49
- package/src/languageProcessing/languages/en/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/en/helpers/internal/determineStem.js +0 -178
- package/src/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js +0 -162
- package/src/languageProcessing/languages/en/helpers/internal/getParticiples.js +0 -25
- package/src/languageProcessing/languages/en/helpers/internal/getVerbStem.js +0 -237
- package/src/languageProcessing/languages/en/values/Clause.js +0 -68
- package/src/languageProcessing/languages/es/Researcher.js +0 -48
- package/src/languageProcessing/languages/es/config/firstWordExceptions.js +0 -16
- package/src/languageProcessing/languages/es/config/functionWords.js +0 -321
- package/src/languageProcessing/languages/es/config/internal/passiveVoiceAuxiliaries.js +0 -60
- package/src/languageProcessing/languages/es/config/internal/passiveVoiceParticiples.js +0 -7327
- package/src/languageProcessing/languages/es/config/sentenceLength.js +0 -3
- package/src/languageProcessing/languages/es/config/stopWords.js +0 -33
- package/src/languageProcessing/languages/es/config/syllables.json +0 -176
- package/src/languageProcessing/languages/es/config/transitionWords.js +0 -40
- package/src/languageProcessing/languages/es/config/twoPartTransitionWords.js +0 -10
- package/src/languageProcessing/languages/es/config/wordComplexity.js +0 -4
- package/src/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js +0 -18
- package/src/languageProcessing/languages/es/helpers/checkIfWordIsComplex.js +0 -56
- package/src/languageProcessing/languages/es/helpers/getClauses.js +0 -29
- package/src/languageProcessing/languages/es/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js +0 -41
- package/src/languageProcessing/languages/es/helpers/internal/getParticiples.js +0 -35
- package/src/languageProcessing/languages/es/helpers/internal/stem.js +0 -793
- package/src/languageProcessing/languages/es/values/Clause.js +0 -47
- package/src/languageProcessing/languages/fa/Researcher.js +0 -47
- package/src/languageProcessing/languages/fa/config/firstWordExceptions.js +0 -12
- package/src/languageProcessing/languages/fa/config/functionWords.js +0 -122
- package/src/languageProcessing/languages/fa/config/internal/participles.js +0 -1429
- package/src/languageProcessing/languages/fa/config/sentenceLength.js +0 -3
- package/src/languageProcessing/languages/fa/config/transitionWords.js +0 -20
- package/src/languageProcessing/languages/fa/config/twoPartTransitionWords.js +0 -9
- package/src/languageProcessing/languages/fa/helpers/createBasicWordForms.js +0 -97
- package/src/languageProcessing/languages/fa/helpers/getStemmer.js +0 -13
- package/src/languageProcessing/languages/fa/helpers/isPassiveSentence.js +0 -14
- package/src/languageProcessing/languages/fr/Researcher.js +0 -46
- package/src/languageProcessing/languages/fr/config/firstWordExceptions.js +0 -16
- package/src/languageProcessing/languages/fr/config/functionWords.js +0 -281
- package/src/languageProcessing/languages/fr/config/internal/exceptionsParticiplesActive.js +0 -1510
- package/src/languageProcessing/languages/fr/config/internal/passiveVoiceAuxiliaries.js +0 -108
- package/src/languageProcessing/languages/fr/config/internal/passiveVoiceIrregulars.js +0 -565
- package/src/languageProcessing/languages/fr/config/stopWords.js +0 -119
- package/src/languageProcessing/languages/fr/config/syllables.json +0 -1426
- package/src/languageProcessing/languages/fr/config/transitionWords.js +0 -59
- package/src/languageProcessing/languages/fr/config/twoPartTransitionWords.js +0 -15
- package/src/languageProcessing/languages/fr/config/wordComplexity.js +0 -4
- package/src/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js +0 -18
- package/src/languageProcessing/languages/fr/helpers/checkIfWordIsComplex.js +0 -67
- package/src/languageProcessing/languages/fr/helpers/getClauses.js +0 -34
- package/src/languageProcessing/languages/fr/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/fr/helpers/internal/getParticiples.js +0 -72
- package/src/languageProcessing/languages/fr/helpers/internal/stem.js +0 -633
- package/src/languageProcessing/languages/fr/values/Clause.js +0 -96
- package/src/languageProcessing/languages/he/Researcher.js +0 -50
- package/src/languageProcessing/languages/he/config/firstWordExceptions.js +0 -13
- package/src/languageProcessing/languages/he/config/functionWords.js +0 -564
- package/src/languageProcessing/languages/he/config/internal/regularRootsHufal.js +0 -186
- package/src/languageProcessing/languages/he/config/internal/regularRootsNifal.js +0 -195
- package/src/languageProcessing/languages/he/config/internal/regularRootsPual.js +0 -168
- package/src/languageProcessing/languages/he/config/passiveVoice/regularRootsHufal.js +0 -188
- package/src/languageProcessing/languages/he/config/passiveVoice/regularRootsNifal.js +0 -197
- package/src/languageProcessing/languages/he/config/passiveVoice/regularRootsPual.js +0 -170
- package/src/languageProcessing/languages/he/config/prefixedFunctionWords.js +0 -2
- package/src/languageProcessing/languages/he/config/sentenceLength.js +0 -3
- package/src/languageProcessing/languages/he/config/transitionWords.js +0 -28
- package/src/languageProcessing/languages/he/config/twoPartTransitionWords.js +0 -8
- package/src/languageProcessing/languages/he/helpers/createBasicWordForms.js +0 -33
- package/src/languageProcessing/languages/he/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/he/helpers/internal/stem.js +0 -52
- package/src/languageProcessing/languages/he/helpers/isPassiveSentence.js +0 -96
- package/src/languageProcessing/languages/he/helpers/stem.js +0 -52
- package/src/languageProcessing/languages/hu/Researcher.js +0 -48
- package/src/languageProcessing/languages/hu/config/firstWordExceptions.js +0 -31
- package/src/languageProcessing/languages/hu/config/functionWords.js +0 -284
- package/src/languageProcessing/languages/hu/config/internal/auxiliaries.js +0 -97
- package/src/languageProcessing/languages/hu/config/internal/morphologicalPassiveAffixes.js +0 -125
- package/src/languageProcessing/languages/hu/config/internal/nonPassivesInVaAndVe.js +0 -265
- package/src/languageProcessing/languages/hu/config/internal/odikVerbs.js +0 -273
- package/src/languageProcessing/languages/hu/config/internal/participles.js +0 -412
- package/src/languageProcessing/languages/hu/config/stopWords.js +0 -213
- package/src/languageProcessing/languages/hu/config/transitionWords.js +0 -42
- package/src/languageProcessing/languages/hu/config/twoPartTransitionWords.js +0 -34
- package/src/languageProcessing/languages/hu/helpers/getClauses.js +0 -25
- package/src/languageProcessing/languages/hu/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/hu/helpers/internal/getParticiples.js +0 -21
- package/src/languageProcessing/languages/hu/helpers/internal/stem.js +0 -389
- package/src/languageProcessing/languages/hu/helpers/isPassiveSentence.js +0 -54
- package/src/languageProcessing/languages/hu/values/Clause.js +0 -41
- package/src/languageProcessing/languages/id/Researcher.js +0 -46
- package/src/languageProcessing/languages/id/config/firstWordExceptions.js +0 -13
- package/src/languageProcessing/languages/id/config/functionWords.js +0 -202
- package/src/languageProcessing/languages/id/config/internal/nonPassiveVerbsStartingDi.js +0 -215
- package/src/languageProcessing/languages/id/config/transitionWords.js +0 -62
- package/src/languageProcessing/languages/id/config/twoPartTransitionWords.js +0 -13
- package/src/languageProcessing/languages/id/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/id/helpers/internal/stem.js +0 -462
- package/src/languageProcessing/languages/id/helpers/internal/stemHelpers.js +0 -78
- package/src/languageProcessing/languages/id/helpers/isPassiveSentence.js +0 -39
- package/src/languageProcessing/languages/id/helpers/splitIntoTokensCustom.js +0 -47
- package/src/languageProcessing/languages/it/Researcher.js +0 -48
- package/src/languageProcessing/languages/it/config/firstWordExceptions.js +0 -17
- package/src/languageProcessing/languages/it/config/functionWords.js +0 -277
- package/src/languageProcessing/languages/it/config/internal/passiveVoiceAuxiliaries.js +0 -98
- package/src/languageProcessing/languages/it/config/internal/passiveVoiceParticiples.js +0 -7197
- package/src/languageProcessing/languages/it/config/sentenceLength.js +0 -3
- package/src/languageProcessing/languages/it/config/stopWords.js +0 -57
- package/src/languageProcessing/languages/it/config/syllables.json +0 -573
- package/src/languageProcessing/languages/it/config/transitionWords.js +0 -104
- package/src/languageProcessing/languages/it/config/twoPartTransitionWords.js +0 -9
- package/src/languageProcessing/languages/it/helpers/calculateFleschReadingScore.js +0 -15
- package/src/languageProcessing/languages/it/helpers/getClauses.js +0 -32
- package/src/languageProcessing/languages/it/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/it/helpers/internal/getParticiples.js +0 -34
- package/src/languageProcessing/languages/it/helpers/internal/stem.js +0 -436
- package/src/languageProcessing/languages/it/values/Clause.js +0 -47
- package/src/languageProcessing/languages/ja/Researcher.js +0 -86
- package/src/languageProcessing/languages/ja/config/assessmentApplicabilityCharacterCount.js +0 -4
- package/src/languageProcessing/languages/ja/config/firstWordExceptions.js +0 -8
- package/src/languageProcessing/languages/ja/config/functionWords.js +0 -563
- package/src/languageProcessing/languages/ja/config/keyphraseLength.js +0 -16
- package/src/languageProcessing/languages/ja/config/metaDescriptionLength.js +0 -4
- package/src/languageProcessing/languages/ja/config/paragraphLength.js +0 -10
- package/src/languageProcessing/languages/ja/config/sentenceLength.js +0 -4
- package/src/languageProcessing/languages/ja/config/subheadingsTooLong.js +0 -18
- package/src/languageProcessing/languages/ja/config/textLength.js +0 -47
- package/src/languageProcessing/languages/ja/config/topicLength.js +0 -5
- package/src/languageProcessing/languages/ja/config/transitionWords.js +0 -354
- package/src/languageProcessing/languages/ja/customResearches/findKeyphraseInSEOTitle.js +0 -98
- package/src/languageProcessing/languages/ja/customResearches/getKeyphraseLength.js +0 -19
- package/src/languageProcessing/languages/ja/customResearches/getWordForms.js +0 -50
- package/src/languageProcessing/languages/ja/customResearches/textLength.js +0 -24
- package/src/languageProcessing/languages/ja/helpers/countCharacters.js +0 -19
- package/src/languageProcessing/languages/ja/helpers/customGetStemmer.js +0 -21
- package/src/languageProcessing/languages/ja/helpers/getContentWords.js +0 -21
- package/src/languageProcessing/languages/ja/helpers/getWords.js +0 -31
- package/src/languageProcessing/languages/ja/helpers/internal/SentenceTokenizer.js +0 -102
- package/src/languageProcessing/languages/ja/helpers/internal/createWordForms.js +0 -68
- package/src/languageProcessing/languages/ja/helpers/internal/determineStem.js +0 -17
- package/src/languageProcessing/languages/ja/helpers/matchTextWithWord.js +0 -53
- package/src/languageProcessing/languages/ja/helpers/matchTransitionWords.js +0 -25
- package/src/languageProcessing/languages/ja/helpers/memoizedSentenceTokenizer.js +0 -28
- package/src/languageProcessing/languages/ja/helpers/splitIntoTokensCustom.js +0 -20
- package/src/languageProcessing/languages/ja/helpers/wordsCharacterCount.js +0 -13
- package/src/languageProcessing/languages/nb/Researcher.js +0 -45
- package/src/languageProcessing/languages/nb/config/firstWordExceptions.js +0 -12
- package/src/languageProcessing/languages/nb/config/functionWords.js +0 -106
- package/src/languageProcessing/languages/nb/config/internal/participles.js +0 -3127
- package/src/languageProcessing/languages/nb/config/internal/passiveVoiceAuxiliaries.js +0 -15
- package/src/languageProcessing/languages/nb/config/stopWords.js +0 -39
- package/src/languageProcessing/languages/nb/config/transitionWords.js +0 -21
- package/src/languageProcessing/languages/nb/config/twoPartTransitionWords.js +0 -10
- package/src/languageProcessing/languages/nb/helpers/getClauses.js +0 -28
- package/src/languageProcessing/languages/nb/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/nb/helpers/internal/getParticiples.js +0 -24
- package/src/languageProcessing/languages/nb/helpers/internal/stem.js +0 -133
- package/src/languageProcessing/languages/nb/values/Clause.js +0 -43
- package/src/languageProcessing/languages/nl/Researcher.js +0 -48
- package/src/languageProcessing/languages/nl/config/firstWordExceptions.js +0 -15
- package/src/languageProcessing/languages/nl/config/functionWords.js +0 -233
- package/src/languageProcessing/languages/nl/config/internal/nonParticiples.js +0 -2515
- package/src/languageProcessing/languages/nl/config/internal/passiveVoiceAuxiliaries.js +0 -13
- package/src/languageProcessing/languages/nl/config/internal/passiveVoiceIrregulars.js +0 -474
- package/src/languageProcessing/languages/nl/config/keyphraseLength.js +0 -10
- package/src/languageProcessing/languages/nl/config/stopWords.js +0 -35
- package/src/languageProcessing/languages/nl/config/syllables.json +0 -343
- package/src/languageProcessing/languages/nl/config/transitionWords.js +0 -22
- package/src/languageProcessing/languages/nl/config/twoPartTransitionWords.js +0 -8
- package/src/languageProcessing/languages/nl/helpers/calculateFleschReadingScore.js +0 -15
- package/src/languageProcessing/languages/nl/helpers/getClauses.js +0 -25
- package/src/languageProcessing/languages/nl/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js +0 -128
- package/src/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js +0 -324
- package/src/languageProcessing/languages/nl/helpers/internal/detectAndStemSuffixes.js +0 -164
- package/src/languageProcessing/languages/nl/helpers/internal/determineStem.js +0 -133
- package/src/languageProcessing/languages/nl/helpers/internal/getParticiples.js +0 -25
- package/src/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js +0 -183
- package/src/languageProcessing/languages/nl/helpers/internal/stem.js +0 -146
- package/src/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js +0 -109
- package/src/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js +0 -65
- package/src/languageProcessing/languages/nl/values/Clause.js +0 -62
- package/src/languageProcessing/languages/pl/Researcher.js +0 -47
- package/src/languageProcessing/languages/pl/config/firstWordExceptions.js +0 -12
- package/src/languageProcessing/languages/pl/config/functionWords.js +0 -421
- package/src/languageProcessing/languages/pl/config/internal/auxiliaries.js +0 -85
- package/src/languageProcessing/languages/pl/config/internal/participles.js +0 -26433
- package/src/languageProcessing/languages/pl/config/sentenceLength.js +0 -10
- package/src/languageProcessing/languages/pl/config/stopWords.js +0 -36
- package/src/languageProcessing/languages/pl/config/transitionWords.js +0 -42
- package/src/languageProcessing/languages/pl/config/twoPartTransitionWords.js +0 -8
- package/src/languageProcessing/languages/pl/helpers/getClauses.js +0 -25
- package/src/languageProcessing/languages/pl/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/pl/helpers/internal/getParticiples.js +0 -18
- package/src/languageProcessing/languages/pl/helpers/internal/stem.js +0 -161
- package/src/languageProcessing/languages/pl/values/Clause.js +0 -53
- package/src/languageProcessing/languages/pt/Researcher.js +0 -48
- package/src/languageProcessing/languages/pt/config/firstWordExceptions.js +0 -15
- package/src/languageProcessing/languages/pt/config/functionWords.js +0 -226
- package/src/languageProcessing/languages/pt/config/internal/passiveVoiceAuxiliaries.js +0 -66
- package/src/languageProcessing/languages/pt/config/internal/passiveVoiceParticiples.js +0 -4088
- package/src/languageProcessing/languages/pt/config/sentenceLength.js +0 -3
- package/src/languageProcessing/languages/pt/config/stopWords.js +0 -50
- package/src/languageProcessing/languages/pt/config/syllables.json +0 -38
- package/src/languageProcessing/languages/pt/config/transitionWords.js +0 -34
- package/src/languageProcessing/languages/pt/config/twoPartTransitionWords.js +0 -9
- package/src/languageProcessing/languages/pt/helpers/calculateFleschReadingScore.js +0 -15
- package/src/languageProcessing/languages/pt/helpers/getClauses.js +0 -29
- package/src/languageProcessing/languages/pt/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/pt/helpers/internal/getParticiples.js +0 -35
- package/src/languageProcessing/languages/pt/helpers/internal/stem.js +0 -319
- package/src/languageProcessing/languages/pt/values/Clause.js +0 -43
- package/src/languageProcessing/languages/ru/Researcher.js +0 -48
- package/src/languageProcessing/languages/ru/config/firstWordExceptions.js +0 -14
- package/src/languageProcessing/languages/ru/config/fleschReadingEaseScores.js +0 -20
- package/src/languageProcessing/languages/ru/config/functionWords.js +0 -519
- package/src/languageProcessing/languages/ru/config/internal/participlesShortenedList.js +0 -2914
- package/src/languageProcessing/languages/ru/config/internal/passiveVoiceParticiples.js +0 -6295
- package/src/languageProcessing/languages/ru/config/sentenceLength.js +0 -3
- package/src/languageProcessing/languages/ru/config/syllables.json +0 -19
- package/src/languageProcessing/languages/ru/config/transitionWords.js +0 -62
- package/src/languageProcessing/languages/ru/config/twoPartTransitionWords.js +0 -14
- package/src/languageProcessing/languages/ru/helpers/calculateFleschReadingScore.js +0 -16
- package/src/languageProcessing/languages/ru/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/ru/helpers/internal/stem.js +0 -288
- package/src/languageProcessing/languages/ru/helpers/isPassiveSentence.js +0 -14
- package/src/languageProcessing/languages/sk/Researcher.js +0 -46
- package/src/languageProcessing/languages/sk/config/firstWordExceptions.js +0 -14
- package/src/languageProcessing/languages/sk/config/functionWords.js +0 -855
- package/src/languageProcessing/languages/sk/config/internal/nonPassives.js +0 -1074
- package/src/languageProcessing/languages/sk/config/internal/passiveVoiceAuxiliaries.js +0 -22
- package/src/languageProcessing/languages/sk/config/stopWords.js +0 -34
- package/src/languageProcessing/languages/sk/config/transitionWords.js +0 -23
- package/src/languageProcessing/languages/sk/config/twoPartTransitionWords.js +0 -10
- package/src/languageProcessing/languages/sk/helpers/getClauses.js +0 -26
- package/src/languageProcessing/languages/sk/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/sk/helpers/internal/getParticiples.js +0 -16
- package/src/languageProcessing/languages/sk/helpers/internal/stem.js +0 -319
- package/src/languageProcessing/languages/sk/values/Clause.js +0 -39
- package/src/languageProcessing/languages/sv/Researcher.js +0 -45
- package/src/languageProcessing/languages/sv/config/firstWordExceptions.js +0 -15
- package/src/languageProcessing/languages/sv/config/functionWords.js +0 -176
- package/src/languageProcessing/languages/sv/config/internal/passiveVerbs.js +0 -10400
- package/src/languageProcessing/languages/sv/config/keyphraseLength.js +0 -11
- package/src/languageProcessing/languages/sv/config/transitionWords.js +0 -35
- package/src/languageProcessing/languages/sv/config/twoPartTransitionWords.js +0 -8
- package/src/languageProcessing/languages/sv/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/sv/helpers/internal/stem.js +0 -152
- package/src/languageProcessing/languages/sv/helpers/isPassiveSentence.js +0 -14
- package/src/languageProcessing/languages/tr/Researcher.js +0 -44
- package/src/languageProcessing/languages/tr/config/firstWordExceptions.js +0 -13
- package/src/languageProcessing/languages/tr/config/functionWords.js +0 -116
- package/src/languageProcessing/languages/tr/config/internal/nonPassiveExceptions.js +0 -574
- package/src/languageProcessing/languages/tr/config/internal/passiveEndings.js +0 -151
- package/src/languageProcessing/languages/tr/config/sentenceLength.js +0 -7
- package/src/languageProcessing/languages/tr/config/transitionWords.js +0 -42
- package/src/languageProcessing/languages/tr/config/twoPartTransitionWords.js +0 -7
- package/src/languageProcessing/languages/tr/helpers/getStemmer.js +0 -22
- package/src/languageProcessing/languages/tr/helpers/internal/stem.js +0 -20
- package/src/languageProcessing/languages/tr/helpers/isPassiveSentence.js +0 -43
- package/src/languageProcessing/researches/altTagCount.js +0 -70
- package/src/languageProcessing/researches/countSentencesFromText.js +0 -19
- package/src/languageProcessing/researches/findKeyphraseInSEOTitle.js +0 -257
- package/src/languageProcessing/researches/findKeywordInFirstParagraph.js +0 -86
- package/src/languageProcessing/researches/findTransitionWords.js +0 -123
- package/src/languageProcessing/researches/functionWordsInKeyphrase.js +0 -44
- package/src/languageProcessing/researches/getAnchorsWithKeyphrase.js +0 -227
- package/src/languageProcessing/researches/getFleschReadingScore.js +0 -150
- package/src/languageProcessing/researches/getKeywordDensity.js +0 -44
- package/src/languageProcessing/researches/getLinkStatistics.js +0 -54
- package/src/languageProcessing/researches/getLinks.js +0 -18
- package/src/languageProcessing/researches/getLongCenterAlignedTexts.js +0 -37
- package/src/languageProcessing/researches/getParagraphLength.js +0 -44
- package/src/languageProcessing/researches/getParagraphs.js +0 -18
- package/src/languageProcessing/researches/getPassiveVoiceResult.js +0 -129
- package/src/languageProcessing/researches/getProminentWordsForInsights.js +0 -48
- package/src/languageProcessing/researches/getProminentWordsForInternalLinking.js +0 -119
- package/src/languageProcessing/researches/getSentenceBeginnings.js +0 -124
- package/src/languageProcessing/researches/getSubheadingTextLengths.js +0 -59
- package/src/languageProcessing/researches/getWordForms.js +0 -204
- package/src/languageProcessing/researches/h1s.js +0 -10
- package/src/languageProcessing/researches/imageCount.js +0 -16
- package/src/languageProcessing/researches/index.js +0 -5
- package/src/languageProcessing/researches/keyphraseDistribution.js +0 -249
- package/src/languageProcessing/researches/keyphraseLength.js +0 -17
- package/src/languageProcessing/researches/keywordCount.js +0 -134
- package/src/languageProcessing/researches/keywordCountInUrl.js +0 -57
- package/src/languageProcessing/researches/matchKeywordInSubheadings.js +0 -62
- package/src/languageProcessing/researches/metaDescriptionKeyword.js +0 -85
- package/src/languageProcessing/researches/metaDescriptionLength.js +0 -12
- package/src/languageProcessing/researches/pageTitleWidth.js +0 -11
- package/src/languageProcessing/researches/readingTime.js +0 -82
- package/src/languageProcessing/researches/sentences.js +0 -20
- package/src/languageProcessing/researches/videoCount.js +0 -32
- package/src/languageProcessing/researches/wordComplexity.js +0 -129
- package/src/languageProcessing/researches/wordCountInText.js +0 -29
- package/src/languageProcessing/values/Clause.js +0 -108
- package/src/languageProcessing/values/ProminentWord.js +0 -95
- package/src/languageProcessing/values/Sentence.js +0 -111
- package/src/languageProcessing/values/index.js +0 -9
- package/src/markers/addMark.js +0 -9
- package/src/markers/addMarkSingleWord.js +0 -32
- package/src/markers/index.js +0 -7
- package/src/markers/removeDuplicateMarks.js +0 -27
- package/src/markers/removeMarks.js +0 -11
- package/src/parse/build/build.js +0 -52
- package/src/parse/build/index.js +0 -10
- package/src/parse/build/private/adapt.js +0 -113
- package/src/parse/build/private/adaptAttributes.js +0 -36
- package/src/parse/build/private/alwaysFilterElements.js +0 -75
- package/src/parse/build/private/combineIntoImplicitParagraphs.js +0 -130
- package/src/parse/build/private/filterBeforeTokenizing.js +0 -32
- package/src/parse/build/private/filterHelpers.js +0 -44
- package/src/parse/build/private/filterTree.js +0 -42
- package/src/parse/build/private/getTextElementPositions.js +0 -184
- package/src/parse/build/private/helpers/parseClassAttribute.js +0 -9
- package/src/parse/build/private/isPhrasingContent.js +0 -28
- package/src/parse/build/private/parseBlocks.js +0 -151
- package/src/parse/build/private/tokenize.js +0 -74
- package/src/parse/language/LanguageProcessor.js +0 -74
- package/src/parse/structure/Heading.js +0 -26
- package/src/parse/structure/Node.js +0 -69
- package/src/parse/structure/Paragraph.js +0 -48
- package/src/parse/structure/Sentence.js +0 -30
- package/src/parse/structure/SourceCodeLocation.js +0 -41
- package/src/parse/structure/Text.js +0 -27
- package/src/parse/structure/Token.js +0 -24
- package/src/parse/structure/index.js +0 -16
- package/src/parse/traverse/findAllInTree.js +0 -58
- package/src/parse/traverse/index.js +0 -12
- package/src/parse/traverse/innerText.js +0 -26
- package/src/parsedPaper/ParsedPaper.js +0 -92
- package/src/parsedPaper/assess/TreeAssessor.js +0 -184
- package/src/parsedPaper/assess/assessmentListFactories.js +0 -73
- package/src/parsedPaper/assess/assessments/Assessment.js +0 -79
- package/src/parsedPaper/assess/assessments/index.js +0 -6
- package/src/parsedPaper/assess/assessorFactories.js +0 -104
- package/src/parsedPaper/assess/cornerstone/assessmentListFactories.js +0 -47
- package/src/parsedPaper/assess/cornerstone/index.js +0 -5
- package/src/parsedPaper/assess/index.js +0 -20
- package/src/parsedPaper/build/PaperParser.js +0 -105
- package/src/parsedPaper/build/linguisticParsing/Sentence.js +0 -89
- package/src/parsedPaper/build/linguisticParsing/SentenceTokenizer.js +0 -323
- package/src/parsedPaper/build/linguisticParsing/parseText.js +0 -20
- package/src/parsedPaper/build/tree/TreeBuilder.js +0 -75
- package/src/parsedPaper/build/tree/cleanup/calculateTextIndices.js +0 -190
- package/src/parsedPaper/build/tree/cleanup/getElementContent.js +0 -21
- package/src/parsedPaper/build/tree/cleanup/postParsing.js +0 -37
- package/src/parsedPaper/build/tree/html/HTMLTreeConverter.js +0 -230
- package/src/parsedPaper/build/tree/html/buildTree.js +0 -31
- package/src/parsedPaper/build/tree/html/htmlConstants.js +0 -37
- package/src/parsedPaper/build/tree/index.js +0 -14
- package/src/parsedPaper/build/tree/metadata/buildTree.js +0 -32
- package/src/parsedPaper/research/TreeResearcher.js +0 -134
- package/src/parsedPaper/research/index.js +0 -13
- package/src/parsedPaper/research/researches/Headings.js +0 -20
- package/src/parsedPaper/research/researches/LinkStatistics.js +0 -128
- package/src/parsedPaper/research/researches/Research.js +0 -50
- package/src/parsedPaper/research/researches/index.js +0 -1
- package/src/parsedPaper/structure/tree/FormattingElement.js +0 -67
- package/src/parsedPaper/structure/tree/SourceCodeLocation.js +0 -31
- package/src/parsedPaper/structure/tree/TextContainer.js +0 -85
- package/src/parsedPaper/structure/tree/index.js +0 -22
- package/src/parsedPaper/structure/tree/nodes/Heading.js +0 -26
- package/src/parsedPaper/structure/tree/nodes/LeafNode.js +0 -75
- package/src/parsedPaper/structure/tree/nodes/List.js +0 -47
- package/src/parsedPaper/structure/tree/nodes/ListItem.js +0 -26
- package/src/parsedPaper/structure/tree/nodes/MetadataMiscellaneous.js +0 -46
- package/src/parsedPaper/structure/tree/nodes/MetadataText.js +0 -26
- package/src/parsedPaper/structure/tree/nodes/Node.js +0 -154
- package/src/parsedPaper/structure/tree/nodes/Paragraph.js +0 -24
- package/src/parsedPaper/structure/tree/nodes/StructuredNode.js +0 -52
- package/src/parsedPaper/structure/tree/nodes/index.js +0 -21
- package/src/scoring/assessments/assessment.js +0 -63
- package/src/scoring/assessments/index.js +0 -58
- package/src/scoring/assessments/readability/ParagraphTooLongAssessment.js +0 -173
- package/src/scoring/assessments/readability/SentenceBeginningsAssessment.js +0 -132
- package/src/scoring/assessments/readability/SentenceLengthInTextAssessment.js +0 -186
- package/src/scoring/assessments/readability/TransitionWordsAssessment.js +0 -168
- package/src/scoring/assessments/seo/ImageCountAssessment.js +0 -112
- package/src/scoring/assessments/seo/InternalLinksAssessment.js +0 -114
- package/src/scoring/assessments/seo/IntroductionKeywordAssessment.js +0 -110
- package/src/scoring/assessments/seo/KeyphraseAssessment.js +0 -104
- package/src/scoring/assessments/seo/KeyphraseLengthAssessment.js +0 -110
- package/src/scoring/assessments/seo/KeywordDensityAssessment.js +0 -116
- package/src/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +0 -114
- package/src/scoring/assessments/seo/MetaDescriptionLengthAssessment.js +0 -112
- package/src/scoring/assessments/seo/MetaTitleKeywordAssessment.js +0 -111
- package/src/scoring/assessments/seo/NumberInMetaTitleAssessment.js +0 -107
- package/src/scoring/assessments/seo/OutboundLinksAssessment.js +0 -111
- package/src/scoring/assessments/seo/PageTitleWidthAssessment.js +0 -104
- package/src/scoring/assessments/seo/SingleH1Assessment.js +0 -118
- package/src/scoring/assessments/seo/SingleTitleAssessment.js +0 -108
- package/src/scoring/assessments/seo/SubHeadingsKeywordAssessment.js +0 -107
- package/src/scoring/assessments/seo/TextImagesAssessment.js +0 -144
- package/src/scoring/assessments/seo/TextLengthAssessment.js +0 -100
- package/src/scoring/assessments/seo/UrlKeywordAssessment.js +0 -111
- package/src/scoring/assessments/seo/UrlLengthAssessment.js +0 -103
- package/src/scoring/assessors/assessor.js +0 -269
- package/src/scoring/assessors/avadaAssessor.js +0 -67
- package/src/scoring/assessors/contentAssessor.js +0 -159
- package/src/scoring/assessors/index.js +0 -4
- package/src/scoring/assessors/seoAssessor.js +0 -57
- package/src/scoring/helpers/assessments/checkForTooLongSentences.js +0 -13
- package/src/scoring/helpers/assessments/inRange.js +0 -49
- package/src/scoring/helpers/assessments/keyphraseLengthFactor.js +0 -10
- package/src/scoring/helpers/assessments/recommendedKeywordCount.js +0 -43
- package/src/scoring/helpers/index.js +0 -74
- package/src/scoring/interpreters/index.js +0 -5
- package/src/scoring/interpreters/scoreToRating.js +0 -31
- package/src/scoring/renderers/AssessorPresenter.js +0 -360
- package/src/scoring/scoreAggregators/ReadabilityScoreAggregator.js +0 -203
- package/src/scoring/scoreAggregators/SEOScoreAggregator.js +0 -54
- package/src/scoring/scoreAggregators/ScoreAggregator.js +0 -23
- package/src/scoring/scoreAggregators/index.js +0 -3
- package/src/values/AssessmentResult.js +0 -496
- package/src/values/Mark.js +0 -271
- package/src/values/Paper.js +0 -425
- package/src/values/index.js +0 -9
- package/src/vendor/turkishStemmer.js +0 -3435
- package/tsconfig.json +0 -15
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { memoize, uniq } from "lodash";
|
|
2
|
-
|
|
3
|
-
import getWords from "../word/getWords";
|
|
4
|
-
import { normalizeSingle } from "../sanitize/quotes";
|
|
5
|
-
import ProminentWord from "../../values/ProminentWord";
|
|
6
|
-
|
|
7
|
-
const specialCharacters = /[1234567890‘’“”"'.…?!:;,¿¡«»&*@#±^%$|~=+§`[\](){}⟨⟩<>/\\–\-\u2014\u00d7\s]/g;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Returns only those prominent words that occur more than a certain number of times and do not consist of special characters.
|
|
11
|
-
*
|
|
12
|
-
* @param {ProminentWord[]} prominentWords A list of prominent words.
|
|
13
|
-
* @param {int} [minimalNumberOfOccurrences] A minimal number of occurrences that is needed for a relevant prominentWord, default 2.
|
|
14
|
-
*
|
|
15
|
-
* @returns {ProminentWord[]} Only relevant words.
|
|
16
|
-
*/
|
|
17
|
-
function filterProminentWords( prominentWords, minimalNumberOfOccurrences = 2 ) {
|
|
18
|
-
prominentWords = prominentWords.filter( function( word ) {
|
|
19
|
-
return (
|
|
20
|
-
word.getOccurrences() >= minimalNumberOfOccurrences &&
|
|
21
|
-
word.getWord().replace( specialCharacters, "" ) !== ""
|
|
22
|
-
);
|
|
23
|
-
} );
|
|
24
|
-
return prominentWords;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Sorts prominent words based on their number of occurrences and length.
|
|
29
|
-
*
|
|
30
|
-
* @param {ProminentWord[]} prominentWords The prominent words to sort.
|
|
31
|
-
*
|
|
32
|
-
* @returns {void}
|
|
33
|
-
*/
|
|
34
|
-
function sortProminentWords( prominentWords ) {
|
|
35
|
-
prominentWords.sort( function( wordA, wordB ) {
|
|
36
|
-
const difference = wordB.getOccurrences() - wordA.getOccurrences();
|
|
37
|
-
// The word with the highest number of occurrences comes first.
|
|
38
|
-
if ( difference !== 0 ) {
|
|
39
|
-
return difference;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// In case of a tie on occurrence number, the alphabetically first word comes first.
|
|
43
|
-
return wordA.getStem().localeCompare( wordB.getStem() );
|
|
44
|
-
} );
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Collapses prominent words that have the same stem.
|
|
49
|
-
*
|
|
50
|
-
* @param {ProminentWord[]} prominentWords All prominentWords.
|
|
51
|
-
*
|
|
52
|
-
* @returns {ProminentWord[]} The original array with collapsed duplicates.
|
|
53
|
-
*/
|
|
54
|
-
function collapseProminentWordsOnStem( prominentWords ) {
|
|
55
|
-
if ( prominentWords.length === 0 ) {
|
|
56
|
-
return [];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Sort the input array by stem
|
|
60
|
-
prominentWords.sort( function( wordA, wordB ) {
|
|
61
|
-
return wordA.getStem().localeCompare( wordB.getStem() );
|
|
62
|
-
} );
|
|
63
|
-
|
|
64
|
-
const collapsedProminentWords = [];
|
|
65
|
-
let previousWord = new ProminentWord(
|
|
66
|
-
prominentWords[ 0 ].getWord(),
|
|
67
|
-
prominentWords[ 0 ].getStem(),
|
|
68
|
-
prominentWords[ 0 ].getOccurrences()
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
for ( let i = 1; i < prominentWords.length; i++ ) {
|
|
72
|
-
const currentWord = new ProminentWord(
|
|
73
|
-
prominentWords[ i ].getWord(),
|
|
74
|
-
prominentWords[ i ].getStem(),
|
|
75
|
-
prominentWords[ i ].getOccurrences()
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
/*
|
|
79
|
-
* Compare the stem of the current word in the loop with the previously available stem.
|
|
80
|
-
* If they are equal, the word should be collapsed.
|
|
81
|
-
* When collapsing, the numbers of occurrences get summed.
|
|
82
|
-
* If the stem happens to equal the real word that occurred in the text, we can be sure it's ok to display it
|
|
83
|
-
* to the customer. So, the stem reassigns the word.
|
|
84
|
-
*/
|
|
85
|
-
if ( currentWord.getStem() === previousWord.getStem() ) {
|
|
86
|
-
previousWord.setOccurrences( previousWord.getOccurrences() + currentWord.getOccurrences() );
|
|
87
|
-
|
|
88
|
-
if ( currentWord.getWord() === previousWord.getStem() || currentWord.getWord().toLocaleLowerCase() === previousWord.getStem() ) {
|
|
89
|
-
previousWord.setWord( currentWord.getWord() );
|
|
90
|
-
}
|
|
91
|
-
} else {
|
|
92
|
-
collapsedProminentWords.push( previousWord );
|
|
93
|
-
previousWord = currentWord;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
collapsedProminentWords.push( previousWord );
|
|
98
|
-
|
|
99
|
-
return collapsedProminentWords;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Retrieves a list of all abbreviations from the text. Returns an empty array if the input text is empty.
|
|
104
|
-
*
|
|
105
|
-
* @param {string} text A text.
|
|
106
|
-
*
|
|
107
|
-
* @returns {string[]} A list of abbreviations from the list.
|
|
108
|
-
*/
|
|
109
|
-
function retrieveAbbreviations( text ) {
|
|
110
|
-
const words = getWords( normalizeSingle( text ) );
|
|
111
|
-
const abbreviations = [];
|
|
112
|
-
|
|
113
|
-
words.forEach( function( word ) {
|
|
114
|
-
if ( word.length > 1 && word.length < 5 && word === word.toLocaleUpperCase() ) {
|
|
115
|
-
abbreviations.push( word.toLocaleLowerCase() );
|
|
116
|
-
}
|
|
117
|
-
} );
|
|
118
|
-
|
|
119
|
-
return uniq( abbreviations );
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Computes prominent words from an array of words. In order to do so, checks whether the word is included in the list of
|
|
124
|
-
* function words and determines the number of occurrences for every word. Then checks if any two words have the same stem
|
|
125
|
-
* and if so collapses over them.
|
|
126
|
-
*
|
|
127
|
-
* @param {string[]} words The words to determine relevance for.
|
|
128
|
-
* @param {string[]} abbreviations Abbreviations that should not be stemmed.
|
|
129
|
-
* @param {Function} stemmer The available stemmer.
|
|
130
|
-
* @param {Array} functionWords The available function words list.
|
|
131
|
-
*
|
|
132
|
-
* @returns {ProminentWord[]} All prominent words sorted and filtered for this text.
|
|
133
|
-
*/
|
|
134
|
-
function computeProminentWords( words, abbreviations, stemmer, functionWords ) {
|
|
135
|
-
if ( words.length === 0 ) {
|
|
136
|
-
return [];
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const uniqueContentWords = uniq( words.filter( word => ! functionWords.includes( word.trim() ) ) );
|
|
140
|
-
const prominentWords = [];
|
|
141
|
-
|
|
142
|
-
uniqueContentWords.forEach( function( word ) {
|
|
143
|
-
if ( abbreviations.includes( word ) ) {
|
|
144
|
-
prominentWords.push( new ProminentWord(
|
|
145
|
-
word.toLocaleUpperCase(),
|
|
146
|
-
word,
|
|
147
|
-
words.filter( element => element === word ).length
|
|
148
|
-
) );
|
|
149
|
-
} else {
|
|
150
|
-
prominentWords.push( new ProminentWord(
|
|
151
|
-
word,
|
|
152
|
-
stemmer( word ),
|
|
153
|
-
words.filter( element => element === word ).length
|
|
154
|
-
) );
|
|
155
|
-
}
|
|
156
|
-
} );
|
|
157
|
-
|
|
158
|
-
return collapseProminentWordsOnStem( prominentWords );
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Caches prominent words depending on text words.
|
|
163
|
-
* Only the words and abbreviations are used as the cache key as the stemmer and function words
|
|
164
|
-
* are config and shouldn't change in the scope of one request.
|
|
165
|
-
*
|
|
166
|
-
* @param {string[]} words The words to determine relevance for.
|
|
167
|
-
* @param {string[]} abbreviations Abbreviations that should not be stemmed.
|
|
168
|
-
* @param {Function} stemmer The available stemmer.
|
|
169
|
-
* @param {Array} functionWords The available function words list.
|
|
170
|
-
*
|
|
171
|
-
* @returns {function} The function that collects prominent words for a given set of text words, language and morphologyData.
|
|
172
|
-
*/
|
|
173
|
-
const computeProminentWordsMemoized = memoize( ( words, abbreviations, stemmer, functionWords ) => {
|
|
174
|
-
return computeProminentWords( words, abbreviations, stemmer, functionWords );
|
|
175
|
-
}, ( words, abbreviations ) => {
|
|
176
|
-
return words.join( "," ) + "," + abbreviations.join( "," );
|
|
177
|
-
} );
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Gets prominent words from the paper text.
|
|
182
|
-
*
|
|
183
|
-
* @param {string} text The text to retrieve the prominent words from.
|
|
184
|
-
* @param {string[]} abbreviations The abbreviations that occur in the text and attributes of the paper.
|
|
185
|
-
* @param {Function} stemmer The available stemmer.
|
|
186
|
-
* @param {Array} functionWords The available function words list.
|
|
187
|
-
* @param {function} getWordsCustomHelper The custom helper to get words.
|
|
188
|
-
*
|
|
189
|
-
* @returns {ProminentWord[]} All prominent words sorted and filtered for this text.
|
|
190
|
-
*/
|
|
191
|
-
function getProminentWords( text, abbreviations, stemmer, functionWords, getWordsCustomHelper ) {
|
|
192
|
-
if ( text === "" ) {
|
|
193
|
-
return [];
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const words = getWordsCustomHelper
|
|
197
|
-
? getWordsCustomHelper( normalizeSingle( text ).toLocaleLowerCase() )
|
|
198
|
-
: getWords( normalizeSingle( text ).toLocaleLowerCase() );
|
|
199
|
-
|
|
200
|
-
return computeProminentWordsMemoized( words, abbreviations, stemmer, functionWords );
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Gets prominent words from keyphrase and synonyms, metadescription, title, and subheadings.
|
|
205
|
-
*
|
|
206
|
-
* @param {string[]} attributes The array with attributes to process.
|
|
207
|
-
* @param {string[]} abbreviations The abbreviations that occur in the text and attributes of the paper.
|
|
208
|
-
* @param {Function} stemmer The available stemmer.
|
|
209
|
-
* @param {Array} functionWords The available function words list.
|
|
210
|
-
* @param {function} getWordsCustomHelper The custom helper to get words.
|
|
211
|
-
*
|
|
212
|
-
* @returns {ProminentWord[]} Prominent words from the paper attributes.
|
|
213
|
-
*/
|
|
214
|
-
function getProminentWordsFromPaperAttributes( attributes, abbreviations, stemmer, functionWords, getWordsCustomHelper ) {
|
|
215
|
-
const wordsFromAttributes = getWordsCustomHelper
|
|
216
|
-
? getWordsCustomHelper( attributes.join( " " ).toLocaleLowerCase() )
|
|
217
|
-
: getWords( attributes.join( " " ).toLocaleLowerCase() );
|
|
218
|
-
|
|
219
|
-
return computeProminentWords( wordsFromAttributes, abbreviations, stemmer, functionWords );
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export {
|
|
223
|
-
getProminentWords,
|
|
224
|
-
getProminentWordsFromPaperAttributes,
|
|
225
|
-
filterProminentWords,
|
|
226
|
-
sortProminentWords,
|
|
227
|
-
collapseProminentWordsOnStem,
|
|
228
|
-
retrieveAbbreviations,
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
export default {
|
|
232
|
-
getProminentWords,
|
|
233
|
-
getProminentWordsFromPaperAttributes,
|
|
234
|
-
filterProminentWords,
|
|
235
|
-
sortProminentWords,
|
|
236
|
-
collapseProminentWordsOnStem,
|
|
237
|
-
retrieveAbbreviations,
|
|
238
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @module stringProcessing/createRegexFromArray */
|
|
2
|
-
|
|
3
|
-
import { map } from "lodash";
|
|
4
|
-
import addWordBoundary from "../word/addWordboundary.js";
|
|
5
|
-
import replaceDiacritics from "../transliterate/replaceDiacritics";
|
|
6
|
-
import sanitizeString from "../sanitize/sanitizeString";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Creates a regex of combined strings from the input array.
|
|
10
|
-
*
|
|
11
|
-
* @param {string[]} array The array with strings
|
|
12
|
-
* @param {boolean} [disableWordBoundary=false] Boolean indicating whether or not to disable word boundaries.
|
|
13
|
-
* @param {string} [extraBoundary=""] A string that is used as extra boundary for the regex.
|
|
14
|
-
* @param {boolean} [doReplaceDiacritics=false] If set to true, it replaces diacritics. Defaults to false.
|
|
15
|
-
*
|
|
16
|
-
* @returns {RegExp} regex The regex created from the array.
|
|
17
|
-
*/
|
|
18
|
-
export default function( array, disableWordBoundary = false, extraBoundary = "", doReplaceDiacritics = false ) {
|
|
19
|
-
array = map( array, function( string ) {
|
|
20
|
-
if ( doReplaceDiacritics ) {
|
|
21
|
-
string = replaceDiacritics( string );
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
string = sanitizeString( string );
|
|
25
|
-
|
|
26
|
-
if ( disableWordBoundary ) {
|
|
27
|
-
return string;
|
|
28
|
-
}
|
|
29
|
-
return addWordBoundary( string, true, extraBoundary );
|
|
30
|
-
} );
|
|
31
|
-
|
|
32
|
-
const regexString = "(" + array.join( ")|(" ) + ")";
|
|
33
|
-
|
|
34
|
-
return new RegExp( regexString, "ig" );
|
|
35
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** @module stringProcessing/createRegexFromDoubleArray */
|
|
2
|
-
|
|
3
|
-
import addWordBoundary from "../word/addWordboundary.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Creates a regex string of combined strings from the input array.
|
|
7
|
-
*
|
|
8
|
-
* @param {array} array The array containing the various parts of a transition word combination.
|
|
9
|
-
*
|
|
10
|
-
* @returns {array} The array with replaced entries.
|
|
11
|
-
*/
|
|
12
|
-
const wordCombinationToRegexString = function( array ) {
|
|
13
|
-
array = array.map( function( word ) {
|
|
14
|
-
return addWordBoundary( word );
|
|
15
|
-
} );
|
|
16
|
-
return array.join( "(.*?)" );
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Creates a regex of combined strings from the input array, containing arrays with two entries.
|
|
21
|
-
*
|
|
22
|
-
* @param {array} array The array containing arrays.
|
|
23
|
-
*
|
|
24
|
-
* @returns {RegExp} The regex created from the array.
|
|
25
|
-
*/
|
|
26
|
-
export default function( array ) {
|
|
27
|
-
array = array.map( function( wordCombination ) {
|
|
28
|
-
return wordCombinationToRegexString( wordCombination );
|
|
29
|
-
} );
|
|
30
|
-
|
|
31
|
-
const regexString = "(" + array.join( ")|(" ) + ")";
|
|
32
|
-
|
|
33
|
-
return new RegExp( regexString, "ig" );
|
|
34
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** @module stringProcessing/stringToRegex */
|
|
2
|
-
import { escapeRegExp, isUndefined, memoize } from "lodash";
|
|
3
|
-
import sanitizeString from "../sanitize/sanitizeString";
|
|
4
|
-
import replaceDiacritics from "../transliterate/replaceDiacritics.js";
|
|
5
|
-
import addWordBoundary from "../word/addWordboundary.js";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Creates a regex from a string so it can be matched everywhere in the same way.
|
|
9
|
-
*
|
|
10
|
-
* @param {string} string The string to make a regex from.
|
|
11
|
-
* @param {string} [extraBoundary=""] A string that is used as extra boundary for the regex.
|
|
12
|
-
* @param {boolean} [doReplaceDiacritics=true] If set to false, it doesn't replace diacritics. Defaults to true.
|
|
13
|
-
*
|
|
14
|
-
* @returns {RegExp} regex The regex made from the keyword
|
|
15
|
-
*/
|
|
16
|
-
export default memoize( function( string, extraBoundary, doReplaceDiacritics ) {
|
|
17
|
-
if ( isUndefined( extraBoundary ) ) {
|
|
18
|
-
extraBoundary = "";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if ( isUndefined( doReplaceDiacritics ) || doReplaceDiacritics === true ) {
|
|
22
|
-
string = replaceDiacritics( string );
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
string = sanitizeString( string );
|
|
26
|
-
string = escapeRegExp( string );
|
|
27
|
-
string = addWordBoundary( string, false, extraBoundary );
|
|
28
|
-
|
|
29
|
-
return new RegExp( string, "ig" );
|
|
30
|
-
} );
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** @module stringProcessing/matchStringWithRegex */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks a string with a regex, return all matches found with that regex.
|
|
5
|
-
*
|
|
6
|
-
* @param {String} text The text to match.
|
|
7
|
-
* @param {object} regex A compiled regular expression.
|
|
8
|
-
*
|
|
9
|
-
* @returns {Array} Array with matches, empty array if no matches found.
|
|
10
|
-
*/
|
|
11
|
-
export default function( text, regex ) {
|
|
12
|
-
let matches = text.match( regex );
|
|
13
|
-
|
|
14
|
-
if ( matches === null ) {
|
|
15
|
-
matches = [];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return matches;
|
|
19
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks whether a given regex matches a given word and if so, performs the replacement.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} word The word that may need to be modified.
|
|
5
|
-
* @param {string[]} regexAndReplacement A regex and the required replacement.
|
|
6
|
-
*
|
|
7
|
-
* @returns {?string} The modified stem or undefined if no match was found.
|
|
8
|
-
*/
|
|
9
|
-
export default function searchAndReplaceWithOneRegex( word, regexAndReplacement ) {
|
|
10
|
-
if ( word.search( new RegExp( regexAndReplacement[ 0 ] ) ) !== -1 ) {
|
|
11
|
-
word = word.replace( new RegExp( regexAndReplacement[ 0 ] ), regexAndReplacement[ 1 ] );
|
|
12
|
-
return word;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns an array with double quotes.
|
|
3
|
-
*
|
|
4
|
-
* Japanese-specific quotes:
|
|
5
|
-
* U300c - left corner bracket.
|
|
6
|
-
* U300d - right corner bracket.
|
|
7
|
-
* U300e - left white corner bracket.
|
|
8
|
-
* U300f - right white corner bracket.
|
|
9
|
-
*
|
|
10
|
-
* @returns {string[]} The array with double quotes..
|
|
11
|
-
*/
|
|
12
|
-
export default [ "“", "”", "〝", "〞", "〟", "‟", "„", "\"", "\u300c", "\u300d", "\u300e", "\u300f" ];
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Creates a regex to filter shortcodes from HTML.
|
|
4
|
-
* @param {string[]} shortcodeTags The tags of the shortcodes to filter.
|
|
5
|
-
* @returns {RegExp} The regex to recognize the shortcodes.
|
|
6
|
-
*/
|
|
7
|
-
export const createShortcodeTagsRegex = shortcodeTags => {
|
|
8
|
-
const shortcodeTagsRegexString = `\\[\\/?(${ shortcodeTags.join( "|" ) })[^\\]]*\\]`;
|
|
9
|
-
return new RegExp( shortcodeTagsRegexString, "g" );
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Filters shortcodes from HTML string.
|
|
14
|
-
* @param {string} html The HTML to filter.
|
|
15
|
-
* @param {string[]} shortcodeTags The tags of the shortcodes to filter.
|
|
16
|
-
* @returns {string} The filtered HTML.
|
|
17
|
-
*/
|
|
18
|
-
export const filterShortcodesFromHTML = ( html, shortcodeTags ) => {
|
|
19
|
-
if ( ! shortcodeTags || shortcodeTags.length === 0 ) {
|
|
20
|
-
return html;
|
|
21
|
-
}
|
|
22
|
-
const shortcodeTagsRegex = createShortcodeTagsRegex( shortcodeTags );
|
|
23
|
-
return html.replace( shortcodeTagsRegex, "" );
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Checks if a token is part of an opening shortcode.
|
|
28
|
-
* @param {Token[]} tokens The tokens to check.
|
|
29
|
-
* @param {number} index The index of the current token.
|
|
30
|
-
* @returns {boolean} Whether the token is part of an opening shortcode.
|
|
31
|
-
*/
|
|
32
|
-
const tokenIsPartOfOpeningShortcode = ( tokens, index ) => {
|
|
33
|
-
return tokens[ index - 1 ] && tokens[ index - 1 ].text === "[";
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Checks if a token is part of a closing shortcode.
|
|
38
|
-
* @param {Token[]} tokens The tokens to check.
|
|
39
|
-
* @param {number} index The index of the current token.
|
|
40
|
-
* @returns {boolean} Whether the token is part of a closing shortcode.
|
|
41
|
-
*/
|
|
42
|
-
const tokenIsPartOfClosingShortcode = ( tokens, index ) => {
|
|
43
|
-
return tokens[ index - 1 ] && tokens[ index - 1 ].text === "/" && tokens[ index - 2 ] && tokens[ index - 2 ].text === "[";
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Checks if a token is part of a shortcode.
|
|
48
|
-
* @param {Token[]} tokens The tokens to check.
|
|
49
|
-
* @param {number} index The index of the current token.
|
|
50
|
-
* @param {string[]} shortcodeTags An array of active shortcode tags.
|
|
51
|
-
* @param {boolean} encounteredClosingBracket Whether a closing bracket has been encountered (while looping backwards through the tokens).
|
|
52
|
-
* @returns {boolean} Whether the token is part of a shortcode.
|
|
53
|
-
*/
|
|
54
|
-
const tokenIsShortcode = ( tokens, index, shortcodeTags, encounteredClosingBracket ) => {
|
|
55
|
-
return encounteredClosingBracket && shortcodeTags.includes( tokens[ index ].text ) &&
|
|
56
|
-
( tokenIsPartOfOpeningShortcode( tokens, index ) || tokenIsPartOfClosingShortcode( tokens, index ) );
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Filters shortcodes from a sentence.
|
|
61
|
-
* @param {Sentence} sentence The sentence to filter.
|
|
62
|
-
* @param {string[]} shortcodeTags The tags of the shortcodes to filter.
|
|
63
|
-
* @param {RegExp} shortcodeTagsRegex The regex to filter the shortcodes.
|
|
64
|
-
* @returns {void}
|
|
65
|
-
*
|
|
66
|
-
*/
|
|
67
|
-
const filterShortcodesFromSentence = ( sentence, shortcodeTags, shortcodeTagsRegex ) => {
|
|
68
|
-
const tokens = sentence.tokens;
|
|
69
|
-
|
|
70
|
-
let encounteredClosingBracket = false;
|
|
71
|
-
// traverse through tokens backwards
|
|
72
|
-
for ( let i = tokens.length - 1; i >= 0; i-- ) {
|
|
73
|
-
if ( tokens[ i ].text === "]" ) {
|
|
74
|
-
encounteredClosingBracket = true;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if ( tokenIsShortcode( tokens, i, shortcodeTags, encounteredClosingBracket ) ) {
|
|
78
|
-
while ( tokens[ i ].text !== "]" ) {
|
|
79
|
-
tokens.splice( i, 1 );
|
|
80
|
-
}
|
|
81
|
-
tokens.splice( i, 1 );
|
|
82
|
-
encounteredClosingBracket = false;
|
|
83
|
-
|
|
84
|
-
while ( tokens[ i - 1 ] && "[/".includes( tokens[ i - 1 ].text ) ) {
|
|
85
|
-
tokens.splice( i - 1, 1 );
|
|
86
|
-
i--;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
sentence.tokens = tokens;
|
|
91
|
-
|
|
92
|
-
sentence.text = sentence.text.replace( shortcodeTagsRegex, "" );
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* A recursive function that filters shortcodes from sentences.
|
|
97
|
-
* @param {Node} tree The tree to filter.
|
|
98
|
-
* @param {string[]} shortcodeTags The tags of the shortcodes to filter.
|
|
99
|
-
* @param {RegExp} shortcodeTagsRegex The regex to filter the shortcodes.
|
|
100
|
-
* @returns {void}
|
|
101
|
-
*/
|
|
102
|
-
const filterShortcodesFromSentences = ( tree, shortcodeTags, shortcodeTagsRegex ) => {
|
|
103
|
-
if ( tree.sentences ) {
|
|
104
|
-
tree.sentences.forEach( sentence => {
|
|
105
|
-
filterShortcodesFromSentence( sentence, shortcodeTags, shortcodeTagsRegex );
|
|
106
|
-
} );
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if ( tree.childNodes ) {
|
|
110
|
-
tree.childNodes.forEach( childNode => {
|
|
111
|
-
filterShortcodesFromSentences( childNode, shortcodeTags, shortcodeTagsRegex );
|
|
112
|
-
} );
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Filters shortcodes from the tree.
|
|
118
|
-
* @param {Node} tree The tree to filter.
|
|
119
|
-
* @param {string[]} shortcodeTags The tags of the shortcodes to filter.
|
|
120
|
-
* @returns {void}
|
|
121
|
-
*/
|
|
122
|
-
const filterShortcodesFromTree = ( tree, shortcodeTags ) => {
|
|
123
|
-
if ( ! shortcodeTags || shortcodeTags.length === 0 ) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const shortcodeTagsRegex = createShortcodeTagsRegex( shortcodeTags );
|
|
127
|
-
|
|
128
|
-
filterShortcodesFromSentences( tree, shortcodeTags, shortcodeTagsRegex );
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export default filterShortcodesFromTree;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Removes list-related html tags in a text to be used for the keyphrase distribution assessment.
|
|
3
|
-
* That way, lists with single words don't result in a skewed keyphrase distribution result.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} text The text in which to remove the list structures.
|
|
6
|
-
*
|
|
7
|
-
* @returns {string} The text with all list structures removed.
|
|
8
|
-
*/
|
|
9
|
-
export function mergeListItems( text ) {
|
|
10
|
-
const listTags = /<\/?(o|ul)(?:[^>]+)?>/g;
|
|
11
|
-
const listItemTags = /\s?<\/?li(?:[^>]+)?>\s?/g;
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* Steps:
|
|
15
|
-
* 1) Remove all ul and ol tags.
|
|
16
|
-
* 2) Replace all li tags with spaces to avoid list items being stuck together.
|
|
17
|
-
* 3) Replace multiple instances of whitespace with a single instance.
|
|
18
|
-
*/
|
|
19
|
-
text = text.replace( listTags, "" );
|
|
20
|
-
text = text.replace( listItemTags, " " );
|
|
21
|
-
text = text.replace( /\s+/g, " " );
|
|
22
|
-
|
|
23
|
-
return text;
|
|
24
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** @module stringProcessing/parseSynonyms */
|
|
2
|
-
|
|
3
|
-
import stripSpaces from "./stripSpaces.js";
|
|
4
|
-
import removePunctuationExceptQuotes from "./removePunctuationExceptQuotes.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Parses synonyms from a comma-separated string into an array.
|
|
8
|
-
*
|
|
9
|
-
* @param {String} synonyms The text to match
|
|
10
|
-
*
|
|
11
|
-
* @returns {Array} An array with all synonyms.
|
|
12
|
-
*/
|
|
13
|
-
export default function( synonyms ) {
|
|
14
|
-
let synonymsSplit = synonyms.split( "," );
|
|
15
|
-
|
|
16
|
-
synonymsSplit = synonymsSplit.map( synonym =>
|
|
17
|
-
removePunctuationExceptQuotes( stripSpaces( synonym ) ) ).filter( synonym => synonym );
|
|
18
|
-
|
|
19
|
-
return synonymsSplit;
|
|
20
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const SINGLE_QUOTES_ARRAY = [ "'", "‘", "’", "‛", "`", "‹", "›" ];
|
|
2
|
-
const SINGLE_QUOTES_REGEX = new RegExp( "[" + SINGLE_QUOTES_ARRAY.join( "" ) + "]", "g" );
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Normalizes single quotes to 'regular' quotes.
|
|
6
|
-
*
|
|
7
|
-
* @param {string} text Text to normalize.
|
|
8
|
-
* @returns {string} The normalized text.
|
|
9
|
-
*/
|
|
10
|
-
function normalizeSingleQuotes( text ) {
|
|
11
|
-
return text.replace( SINGLE_QUOTES_REGEX, "'" );
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Normalizes double quotes to 'regular' quotes.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} text Text to normalize.
|
|
18
|
-
* @returns {string} The normalized text.
|
|
19
|
-
*/
|
|
20
|
-
function normalizeDoubleQuotes( text ) {
|
|
21
|
-
return text.replace( /[“”〝〞〟‟„『』«»]/g, "\"" );
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Normalizes quotes to 'regular' quotes.
|
|
26
|
-
*
|
|
27
|
-
* @param {string} text Text to normalize.
|
|
28
|
-
* @returns {string} The normalized text.
|
|
29
|
-
*/
|
|
30
|
-
function normalizeQuotes( text ) {
|
|
31
|
-
return normalizeDoubleQuotes( normalizeSingleQuotes( text ) );
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
normalizeSingleQuotes as normalizeSingle,
|
|
36
|
-
normalizeDoubleQuotes as normalizeDouble,
|
|
37
|
-
normalizeQuotes as normalize,
|
|
38
|
-
SINGLE_QUOTES_REGEX,
|
|
39
|
-
SINGLE_QUOTES_ARRAY,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
normalizeSingle: normalizeSingleQuotes,
|
|
44
|
-
normalizeDouble: normalizeDoubleQuotes,
|
|
45
|
-
normalize: normalizeQuotes,
|
|
46
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const emailRegex = new RegExp( "[^\\s@]+@[^\\s@]+\\.[^\\s@]+", "igm" );
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Removes email addresses from a text.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} text The text to remove emails from.
|
|
7
|
-
*
|
|
8
|
-
* @returns {string} The text without email addresses.
|
|
9
|
-
*/
|
|
10
|
-
export default function( text ) {
|
|
11
|
-
return text.replace( emailRegex, "" );
|
|
12
|
-
}
|