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,13 +0,0 @@
|
|
|
1
|
-
import doubleQuotes from "../sanitize/doubleQuotes";
|
|
2
|
-
import { includes } from "lodash";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Checks if the keyphrase is double-quoted.
|
|
6
|
-
* @param {string} keyphrase The keyphrase to check.
|
|
7
|
-
* @returns {boolean} Whether the keyphrase is double-quoted.
|
|
8
|
-
*/
|
|
9
|
-
const isDoubleQuoted = ( keyphrase ) => {
|
|
10
|
-
return ( includes( doubleQuotes, keyphrase[ 0 ] ) && includes( doubleQuotes, keyphrase[ keyphrase.length - 1 ] ) );
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default isDoubleQuoted;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/** @module stringProcessing/matchTextWithArray */
|
|
2
|
-
|
|
3
|
-
import matchTextWithWord from "./matchTextWithWord";
|
|
4
|
-
import { uniq as unique } from "lodash";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Matches strings from an array against a given text.
|
|
8
|
-
*
|
|
9
|
-
* @param {String} text The text to match.
|
|
10
|
-
* @param {Array} array The array with strings to match.
|
|
11
|
-
* @param {String} [locale = "en_EN"] The locale of the text to get transliterations.
|
|
12
|
-
* @param {function} matchWordCustomHelper The language-specific helper function to match word in text.
|
|
13
|
-
*
|
|
14
|
-
* @returns {Object} An array with all matches of the text, the number of the matches, and the lowest number of positions of the matches.
|
|
15
|
-
*/
|
|
16
|
-
export default function( text, array, locale = "en_EN", matchWordCustomHelper ) {
|
|
17
|
-
let count = 0;
|
|
18
|
-
let matches = [];
|
|
19
|
-
let positions = [];
|
|
20
|
-
|
|
21
|
-
unique( array ).forEach( function( wordToMatch ) {
|
|
22
|
-
const occurrence = matchTextWithWord( text, wordToMatch, locale, matchWordCustomHelper );
|
|
23
|
-
count += occurrence.count;
|
|
24
|
-
matches = matches.concat( occurrence.matches );
|
|
25
|
-
positions.push( occurrence.position );
|
|
26
|
-
} );
|
|
27
|
-
|
|
28
|
-
// Filtered out negative number, i.e. -1.
|
|
29
|
-
positions = positions.filter( position => position >= 0 );
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
count: count,
|
|
33
|
-
matches: matches,
|
|
34
|
-
position: positions.length === 0 ? -1 : Math.min( ...positions ),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { map } from "lodash";
|
|
2
|
-
import addWordBoundary from "../word/addWordboundary.js";
|
|
3
|
-
import stripSpaces from "../sanitize/stripSpaces.js";
|
|
4
|
-
import transliterate from "../transliterate/transliterate.js";
|
|
5
|
-
import transliterateWP from "../transliterate/transliterateWPstyle.js";
|
|
6
|
-
import { replaceTurkishIsMemoized } from "../transliterate/specialCharacterMappings";
|
|
7
|
-
import { getLanguage } from "../../index";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Creates a regex from the keyword with included wordboundaries.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} keyword The keyword to create a regex from.
|
|
13
|
-
* @param {string} language The language used to determine the word boundary.
|
|
14
|
-
*
|
|
15
|
-
* @returns {RegExp} Regular expression of the keyword with word boundaries.
|
|
16
|
-
*/
|
|
17
|
-
const toRegex = function( keyword, language ) {
|
|
18
|
-
keyword = addWordBoundary( keyword, false, "", language );
|
|
19
|
-
return new RegExp( keyword, "ig" );
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Matches a string with and without transliteration.
|
|
24
|
-
* @param {string} text The text to match.
|
|
25
|
-
* @param {string} keyword The keyword to match in the text.
|
|
26
|
-
* @param {string} locale The locale used for transliteration.
|
|
27
|
-
* @returns {Array} All matches from the original as the transliterated text and keyword.
|
|
28
|
-
*/
|
|
29
|
-
export default function( text, keyword, locale ) {
|
|
30
|
-
const language = getLanguage( locale );
|
|
31
|
-
let keywordRegex = toRegex( keyword, language );
|
|
32
|
-
|
|
33
|
-
if ( language === "tr" ) {
|
|
34
|
-
const turkishMappings = replaceTurkishIsMemoized( keyword );
|
|
35
|
-
keywordRegex = new RegExp( turkishMappings.map( x => addWordBoundary( x ) ).join( "|" ), "ig" );
|
|
36
|
-
}
|
|
37
|
-
const matches = text.match( keywordRegex ) || [];
|
|
38
|
-
|
|
39
|
-
text = text.replace( keywordRegex, "" );
|
|
40
|
-
|
|
41
|
-
const transliterateKeyword = transliterate( keyword, locale );
|
|
42
|
-
const transliterateKeywordRegex = toRegex( transliterateKeyword, language );
|
|
43
|
-
const transliterateMatches = text.match( transliterateKeywordRegex ) || [];
|
|
44
|
-
let combinedArray = matches.concat( transliterateMatches );
|
|
45
|
-
|
|
46
|
-
const transliterateWPKeyword = transliterateWP( keyword, locale );
|
|
47
|
-
|
|
48
|
-
if ( ! ( transliterateWPKeyword === transliterateKeyword ) ) {
|
|
49
|
-
const transliterateWPKeywordRegex = toRegex( transliterateWPKeyword, language );
|
|
50
|
-
const transliterateWPMatches = text.match( transliterateWPKeywordRegex ) || [];
|
|
51
|
-
|
|
52
|
-
combinedArray = combinedArray.concat( transliterateWPMatches );
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return map( combinedArray, function( match ) {
|
|
56
|
-
return stripSpaces( match );
|
|
57
|
-
} );
|
|
58
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/** @module stringProcessing/matchTextWithWord */
|
|
2
|
-
|
|
3
|
-
import stripSomeTags from "../sanitize/stripNonTextTags.js";
|
|
4
|
-
import stripSpaces from "../sanitize/stripSpaces.js";
|
|
5
|
-
import removePunctuation from "../sanitize/removePunctuation.js";
|
|
6
|
-
import { unifyAllSpaces as unifyWhitespace } from "../sanitize/unifyWhitespace.js";
|
|
7
|
-
import matchStringWithTransliteration from "./matchTextWithTransliteration.js";
|
|
8
|
-
import { normalize as normalizeQuotes } from "../sanitize/quotes.js";
|
|
9
|
-
import { map } from "lodash";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Returns the number of matches in a given string
|
|
13
|
-
*
|
|
14
|
-
* @param {string} text The text to use for matching the wordToMatch.
|
|
15
|
-
* @param {string} wordToMatch The word to match in the text.
|
|
16
|
-
* @param {string} locale The locale used for transliteration.
|
|
17
|
-
* @param {function} matchWordCustomHelper The helper function to match word in text.
|
|
18
|
-
*
|
|
19
|
-
* @returns {Object} An array with all matches of the text, the number of the matches, and the lowest number of positions of the matches.
|
|
20
|
-
*/
|
|
21
|
-
export default function( text, wordToMatch, locale, matchWordCustomHelper ) {
|
|
22
|
-
text = stripSomeTags( text );
|
|
23
|
-
text = unifyWhitespace( text );
|
|
24
|
-
text = normalizeQuotes( text );
|
|
25
|
-
|
|
26
|
-
wordToMatch = normalizeQuotes( wordToMatch );
|
|
27
|
-
let matches = matchWordCustomHelper
|
|
28
|
-
? matchWordCustomHelper( text, wordToMatch )
|
|
29
|
-
: matchStringWithTransliteration( text, wordToMatch, locale );
|
|
30
|
-
|
|
31
|
-
matches = map( matches, function( keyword ) {
|
|
32
|
-
return stripSpaces( removePunctuation( keyword ) );
|
|
33
|
-
} );
|
|
34
|
-
|
|
35
|
-
// Create an array of positions of matches to determine where in the text the wordToMatch occurred first.
|
|
36
|
-
const positions = map( matches, function( keyword ) {
|
|
37
|
-
return text.indexOf( keyword );
|
|
38
|
-
} );
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
count: matches.length,
|
|
42
|
-
matches: matches,
|
|
43
|
-
position: positions.length === 0 ? -1 : Math.min( ...positions ),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import matchTextWithTransliteration from "./matchTextWithTransliteration";
|
|
2
|
-
import splitIntoTokens from "../word/splitIntoTokens";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Tokenizes the word form of the keyphrase for exact matching. This function gets the word form and tokenizes it.
|
|
6
|
-
* This function assumes that if a keyphrase needs to be matched exactly, there will be only one word form.
|
|
7
|
-
* This is the result of how the focus keyphrase is processed in buildTopicStems.js in the buildStems function.
|
|
8
|
-
*
|
|
9
|
-
* @param {(string[])} wordForms The word forms to tokenize.
|
|
10
|
-
* @param {function} customSplitIntoTokensHelper A custom helper to split sentences into tokens.
|
|
11
|
-
*
|
|
12
|
-
* @returns {string[]} The tokenized word forms.
|
|
13
|
-
*/
|
|
14
|
-
export const tokenizeKeyphraseFormsForExactMatching = ( wordForms, customSplitIntoTokensHelper ) => {
|
|
15
|
-
// Tokenize word form of the keyphrase.
|
|
16
|
-
const wordFormText = wordForms[ 0 ];
|
|
17
|
-
|
|
18
|
-
return customSplitIntoTokensHelper ? customSplitIntoTokensHelper( wordFormText ) : splitIntoTokens( wordFormText );
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Gets the exact matches of the keyphrase.
|
|
23
|
-
* Exact matching happens when the user puts the keyphrase in double quotes.
|
|
24
|
-
*
|
|
25
|
-
* @param {Sentence} sentence The sentence to match the word forms with.
|
|
26
|
-
* @param {string[]} wordForms The word forms to match.
|
|
27
|
-
* @param {string} locale The locale used in the analysis.
|
|
28
|
-
* @param {function} customSplitIntoTokensHelper A custom helper to split sentences into tokens.
|
|
29
|
-
*
|
|
30
|
-
* @returns {{count: number, matches: Token[]}} Object containing the number of the exact matches and the matched tokens.
|
|
31
|
-
*/
|
|
32
|
-
const findExactMatchKeyphraseInSentence = ( sentence, wordForms, locale, customSplitIntoTokensHelper ) => {
|
|
33
|
-
const result = {
|
|
34
|
-
count: 0,
|
|
35
|
-
matches: [],
|
|
36
|
-
};
|
|
37
|
-
// Tokenize word forms of the keyphrase.
|
|
38
|
-
const keyphraseTokens = tokenizeKeyphraseFormsForExactMatching( wordForms, customSplitIntoTokensHelper );
|
|
39
|
-
|
|
40
|
-
const sentenceTokens = sentence.tokens;
|
|
41
|
-
|
|
42
|
-
// Initialize the index of the word token of the keyphrase.
|
|
43
|
-
let indexOfWordInKeyphrase = 0;
|
|
44
|
-
// Initialize the index of the word token of the sentence.
|
|
45
|
-
let indexOfWordInSentence = 0;
|
|
46
|
-
let currentMatch = [];
|
|
47
|
-
|
|
48
|
-
// Check if the tokenized word forms occur in the same order in the sentence tokens.
|
|
49
|
-
while ( indexOfWordInSentence < sentenceTokens.length ) {
|
|
50
|
-
// If the current sentence token matches the current word token of the keyphrase, add it to the current match.
|
|
51
|
-
const sentenceTokenText = sentenceTokens[ indexOfWordInSentence ].text;
|
|
52
|
-
const keyphraseTokenText = keyphraseTokens[ indexOfWordInKeyphrase ];
|
|
53
|
-
|
|
54
|
-
const foundMatches = matchTextWithTransliteration( sentenceTokenText.toLowerCase(), keyphraseTokenText.toLowerCase(), locale );
|
|
55
|
-
|
|
56
|
-
if ( foundMatches.length > 0 ) {
|
|
57
|
-
currentMatch.push( sentenceTokens[ indexOfWordInSentence ] );
|
|
58
|
-
indexOfWordInKeyphrase++;
|
|
59
|
-
} else {
|
|
60
|
-
indexOfWordInKeyphrase = 0;
|
|
61
|
-
currentMatch = [];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/*
|
|
65
|
-
* If the current match has the same length as the keyphrase tokens, the keyphrase forms have been matched.
|
|
66
|
-
* Add the current match to the matches array and reset the index of the word in keyphrase and the current match.
|
|
67
|
-
*/
|
|
68
|
-
if ( currentMatch.length === keyphraseTokens.length ) {
|
|
69
|
-
result.matches.push( ...currentMatch );
|
|
70
|
-
result.count++;
|
|
71
|
-
indexOfWordInKeyphrase = 0;
|
|
72
|
-
currentMatch = [];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
indexOfWordInSentence++;
|
|
76
|
-
}
|
|
77
|
-
return result;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Matches a word form of the keyphrase with the tokens from the sentence.
|
|
82
|
-
*
|
|
83
|
-
* With this approach, we transliterate the word form of the keyphrase before matching it with the sentence tokens.
|
|
84
|
-
* However, we don't do the transliteration step for the sentence tokens.
|
|
85
|
-
* As a result, for example, the word form "acción" from the keyphrase will match the word "accion" in the sentence.
|
|
86
|
-
* But, the word form "accion" from the keyphrase will NOT match the word "acción" in the sentence.
|
|
87
|
-
*
|
|
88
|
-
* @param {Token[]} tokens The array of tokens to check.
|
|
89
|
-
* @param {string} wordForm The word form of the keyphrase.
|
|
90
|
-
* @param {string} locale The locale used in the analysis.
|
|
91
|
-
*
|
|
92
|
-
* @returns {Token[]} The array of the matched tokens.
|
|
93
|
-
*/
|
|
94
|
-
const matchWordFormInTokens = ( tokens, wordForm, locale ) => {
|
|
95
|
-
let matches = [];
|
|
96
|
-
|
|
97
|
-
tokens.forEach( token => {
|
|
98
|
-
const occurrence = matchTextWithTransliteration( token.text, wordForm, locale );
|
|
99
|
-
if ( occurrence.length > 0 ) {
|
|
100
|
-
matches = matches.concat( token );
|
|
101
|
-
}
|
|
102
|
-
} );
|
|
103
|
-
|
|
104
|
-
return matches;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Finds keyphrase forms in a sentence.
|
|
109
|
-
*
|
|
110
|
-
* @param {Sentence|string} sentence The sentence to check.
|
|
111
|
-
* @param {string[]} wordForms The word forms of the keyphrase to check.
|
|
112
|
-
* @param {string} locale The locale used in the analysis.
|
|
113
|
-
* @param {function} matchWordCustomHelper Custom function to match a word form with sentence.
|
|
114
|
-
*
|
|
115
|
-
* @returns {{count: number, matches: (Token|string)[]}} Object containing the number of the matches and the matched tokens.
|
|
116
|
-
*/
|
|
117
|
-
const matchWordFormsInSentence = ( sentence, wordForms, locale, matchWordCustomHelper ) => {
|
|
118
|
-
const result = {
|
|
119
|
-
count: 0,
|
|
120
|
-
matches: [],
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
wordForms.forEach( wordForm => {
|
|
124
|
-
let occurrences = [];
|
|
125
|
-
if ( matchWordCustomHelper ) {
|
|
126
|
-
occurrences = matchWordCustomHelper( sentence, wordForm );
|
|
127
|
-
} else {
|
|
128
|
-
const tokens = sentence.tokens.slice();
|
|
129
|
-
occurrences = matchWordFormInTokens( tokens, wordForm, locale );
|
|
130
|
-
}
|
|
131
|
-
result.count += occurrences.length;
|
|
132
|
-
result.matches = result.matches.concat( occurrences );
|
|
133
|
-
} );
|
|
134
|
-
|
|
135
|
-
return result;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Matches the word forms of a keyphrase with a sentence object from the html parser.
|
|
140
|
-
*
|
|
141
|
-
* @param {Sentence|string} sentence The sentence to match against the word forms of a keyphrase.
|
|
142
|
-
* @param {string[]} wordForms The array of word forms of the keyphrase.
|
|
143
|
-
* E.g. If the keyphrase is "key word", then (if Premium is activated) this will be [ "key", "keys" ] OR [ "word", "words" ]
|
|
144
|
-
* The forms are retrieved higher up (among others in keywordCount.js) with researcher.getResearch( "morphology" ).
|
|
145
|
-
* @param {string} locale The locale used for transliteration.
|
|
146
|
-
* @param {function} matchWordCustomHelper Custom function to match a word form with sentence.
|
|
147
|
-
* @param {boolean} useExactMatching Whether to match the keyphrase forms exactly or not.
|
|
148
|
-
* Exact match is used when the keyphrase is enclosed in double quotes.
|
|
149
|
-
* @param {function} customSplitIntoTokensHelper A custom helper to split sentences into tokens.
|
|
150
|
-
*
|
|
151
|
-
* @returns {{count: number, matches: (Token|string)[]}} Object containing the number of the matches and the matched tokens.
|
|
152
|
-
*/
|
|
153
|
-
const matchWordFormsWithSentence = ( sentence, wordForms, locale, matchWordCustomHelper, useExactMatching = false, customSplitIntoTokensHelper ) => {
|
|
154
|
-
/*
|
|
155
|
-
* Only use `findExactMatchKeyphraseInSentence` when the custom helper is not available.
|
|
156
|
-
* When the custom helper is available, the step for the exact matching happens in the helper.
|
|
157
|
-
*/
|
|
158
|
-
if ( useExactMatching && ! matchWordCustomHelper ) {
|
|
159
|
-
return findExactMatchKeyphraseInSentence( sentence, wordForms, locale, customSplitIntoTokensHelper );
|
|
160
|
-
}
|
|
161
|
-
return matchWordFormsInSentence( sentence, wordForms, locale, matchWordCustomHelper );
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export default matchWordFormsWithSentence;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import isDoubleQuoted from "./isDoubleQuoted";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if exact match functionality is requested by enclosing the keyphrase in double quotation marks.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} keyphrase The keyphrase to check. This must be the keyphrase accessed directly from the Paper.
|
|
7
|
-
*
|
|
8
|
-
* @returns {Object} Whether the exact match functionality is requested and the keyword stripped from double quotes.
|
|
9
|
-
*/
|
|
10
|
-
export default function processExactMatchRequest( keyphrase ) {
|
|
11
|
-
const exactMatchRequest = { exactMatchRequested: false, keyphrase: keyphrase };
|
|
12
|
-
|
|
13
|
-
// Check if only exact match processing is requested by the user. If so, strip the quotation marks from the keyphrase.
|
|
14
|
-
if ( isDoubleQuoted( keyphrase ) ) {
|
|
15
|
-
exactMatchRequest.keyphrase = keyphrase.substring( 1, keyphrase.length - 1 );
|
|
16
|
-
exactMatchRequest.exactMatchRequested = true;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return exactMatchRequest;
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base stemmer that does not stem.
|
|
3
|
-
* This is exported to allow for comparing if a stemmer is the base stemmer.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} word The word to stem.
|
|
6
|
-
*
|
|
7
|
-
* @returns {string} The stemmed word.
|
|
8
|
-
*/
|
|
9
|
-
export default function baseStemmer( word ) {
|
|
10
|
-
return word;
|
|
11
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the input word qualifies for the input regex and if so builds a required form.
|
|
3
|
-
* This function is used for other more specific functions.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} word The word to build forms for.
|
|
6
|
-
* @param {Array} regexes The regex-based array of rules to compare the word against.
|
|
7
|
-
*
|
|
8
|
-
* @returns {string} The newly built form of the word.
|
|
9
|
-
*/
|
|
10
|
-
export default function buildFormRule( word, regexes ) {
|
|
11
|
-
if ( regexes.includes( null ) ) {
|
|
12
|
-
return word;
|
|
13
|
-
}
|
|
14
|
-
for ( let i = 0; i < regexes.length; i++ ) {
|
|
15
|
-
if ( regexes[ i ].reg.test( word ) === true ) {
|
|
16
|
-
return word.replace( regexes[ i ].reg, regexes[ i ].repl );
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import getWords from "../word/getWords.js";
|
|
2
|
-
import { normalizeSingle } from "../sanitize/quotes";
|
|
3
|
-
import { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from "../../../config/wordBoundariesWithoutPunctuation";
|
|
4
|
-
|
|
5
|
-
import { isUndefined, escapeRegExp, memoize } from "lodash";
|
|
6
|
-
import isDoubleQuoted from "../match/isDoubleQuoted";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A TopicPhrase (i.e., a keyphrase or synonym) with stem-original pairs for the words in the topic phrase.
|
|
10
|
-
*/
|
|
11
|
-
class TopicPhrase {
|
|
12
|
-
/**
|
|
13
|
-
* Constructs a new TopicPhrase.
|
|
14
|
-
*
|
|
15
|
-
* @param {StemOriginalPair[]} stemOriginalPairs The stem-original pairs for the words in the topic phrase.
|
|
16
|
-
* @param {boolean} exactMatch Whether the topic phrase is an exact match.
|
|
17
|
-
*
|
|
18
|
-
* @constructor
|
|
19
|
-
*/
|
|
20
|
-
constructor( stemOriginalPairs = [], exactMatch = false ) {
|
|
21
|
-
this.stemOriginalPairs = stemOriginalPairs;
|
|
22
|
-
this.exactMatch = exactMatch;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Returns all stems in the topic phrase.
|
|
27
|
-
*
|
|
28
|
-
* @returns {string[]|[]} The stems in the topic phrase or empty array if the topic phrase is exact match.
|
|
29
|
-
*/
|
|
30
|
-
getStems() {
|
|
31
|
-
// An exact match keyphrase doesn't have stems.
|
|
32
|
-
if ( this.exactMatch ) {
|
|
33
|
-
return [];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return this.stemOriginalPairs.map( stemOriginalPair => stemOriginalPair.stem );
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* A stem-original pair ƒor a word in a topic phrase.
|
|
42
|
-
*
|
|
43
|
-
* @param {string} stem The stem of the topic phrase word.
|
|
44
|
-
* @param {string} original The original word form the topic phrase (unsanitized)
|
|
45
|
-
*
|
|
46
|
-
* @constructor
|
|
47
|
-
*/
|
|
48
|
-
function StemOriginalPair( stem, original ) {
|
|
49
|
-
this.stem = stem;
|
|
50
|
-
this.original = original;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Analyzes the focus keyword string or one synonym phrase.
|
|
55
|
-
* Checks if morphology is requested or if the user wants to match the exact string.
|
|
56
|
-
* If morphology is required, the module finds a stem for all words (if no function words list is available), or
|
|
57
|
-
* for all content words (i.e., excluding prepositions, articles, conjunctions, if the function words list is available).
|
|
58
|
-
*
|
|
59
|
-
* @param {string} keyphrase The keyphrase of the paper (or a synonym phrase) to get stem for.
|
|
60
|
-
* @param {function} stemmer The language-specific stemmer.
|
|
61
|
-
* @param {string[]} functionWords The language-specific function words.
|
|
62
|
-
* @param {boolean} areHyphensWordBoundaries Whether hyphens should be treated as word boundaries.
|
|
63
|
-
*
|
|
64
|
-
* @returns {TopicPhrase} Object with an array of StemOriginalPairs of all (content) words in the keyphrase or synonym
|
|
65
|
-
* phrase and information about whether the keyphrase/synonym should be matched exactly.
|
|
66
|
-
*/
|
|
67
|
-
const buildStems = function( keyphrase, stemmer, functionWords, areHyphensWordBoundaries ) {
|
|
68
|
-
if ( isUndefined( keyphrase ) || keyphrase === "" ) {
|
|
69
|
-
return new TopicPhrase();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// If the keyphrase is embedded in double quotation marks, return the keyphrase itself, without the outermost quotation marks.
|
|
73
|
-
if ( isDoubleQuoted( keyphrase ) ) {
|
|
74
|
-
keyphrase = keyphrase.substring( 1, keyphrase.length - 1 );
|
|
75
|
-
return new TopicPhrase(
|
|
76
|
-
[ new StemOriginalPair( escapeRegExp( keyphrase ), keyphrase ) ],
|
|
77
|
-
true
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/*
|
|
82
|
-
* If hyphens should be treated as word boundaries, pass a custom word boundary regex string that includes whitespaces,
|
|
83
|
-
* hyphens (u002d), and en-dashes (u2013). Otherwise, pass a regex that includes only whitespaces and en-dashes.
|
|
84
|
-
*/
|
|
85
|
-
let keyphraseWords = areHyphensWordBoundaries ? getWords( keyphrase, WORD_BOUNDARY_WITH_HYPHEN )
|
|
86
|
-
: getWords( keyphrase, WORD_BOUNDARY_WITHOUT_HYPHEN );
|
|
87
|
-
|
|
88
|
-
// Filter function words from the keyphrase. Don't filter if the keyphrase only consists of function words.
|
|
89
|
-
const wordsWithoutFunctionWords = keyphraseWords.filter( ( word ) => ! functionWords.includes( word ) );
|
|
90
|
-
if ( wordsWithoutFunctionWords.length > 0 ) {
|
|
91
|
-
keyphraseWords = wordsWithoutFunctionWords;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Return a stem-original pair with a stem.
|
|
95
|
-
const stemOriginalPairs = keyphraseWords.map( word => {
|
|
96
|
-
return new StemOriginalPair( stemmer( normalizeSingle( escapeRegExp( word ) ) ), word );
|
|
97
|
-
} );
|
|
98
|
-
|
|
99
|
-
return new TopicPhrase( stemOriginalPairs );
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Builds stems of words of the keyphrase and of each synonym phrase.
|
|
104
|
-
*
|
|
105
|
-
* @param {string} keyphrase The paper's keyphrase.
|
|
106
|
-
* @param {string[]} synonyms The paper's synonyms.
|
|
107
|
-
* @param {function} stemmer The language-specific stemmer (if available).
|
|
108
|
-
* @param {string[]} functionWords The language-specific function words.
|
|
109
|
-
* @param {boolean} areHyphensWordBoundaries Whether hyphens should be treated as word boundaries.
|
|
110
|
-
*
|
|
111
|
-
* @returns {Object} Object with an array of stems of words in the keyphrase and an array of arrays of stems of words in the synonyms.
|
|
112
|
-
*/
|
|
113
|
-
const collectKeyphraseAndSynonymsStems = function( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries ) {
|
|
114
|
-
const keyphraseStems = buildStems( keyphrase, stemmer, functionWords, areHyphensWordBoundaries );
|
|
115
|
-
const synonymsStems = synonyms.map( synonym => buildStems( synonym, stemmer, functionWords, areHyphensWordBoundaries ) );
|
|
116
|
-
|
|
117
|
-
return {
|
|
118
|
-
keyphraseStems,
|
|
119
|
-
synonymsStems,
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Caches stems depending on the currently available stemmer and functionWords and (separately) keyphrase and synonyms.
|
|
125
|
-
* In this way, if the stemmer and functionWords remain the same in multiple calls of this function, the function
|
|
126
|
-
* that collects actual stems only needs to check if the keyphrase and synonyms also remain the
|
|
127
|
-
* same to return the cached result. The joining of keyphrase and synonyms for this function is needed,
|
|
128
|
-
* because by default memoize caches by the first key only, which in the current case would mean that the function would
|
|
129
|
-
* return the cached forms if the keyphrase has not changed (without checking if synonyms were changed).
|
|
130
|
-
*
|
|
131
|
-
* @param {function} stemmer The language-specific stemmer (if available).
|
|
132
|
-
* @param {string[]} functionWords The language-specific function words.
|
|
133
|
-
* @param {boolean} areHyphensWordBoundaries Whether hyphens should be treated as word boundaries.
|
|
134
|
-
*
|
|
135
|
-
* @returns {function} The function that collects the stems for a given set of keyphrase, synonyms, stemmer and functionWords.
|
|
136
|
-
*/
|
|
137
|
-
const primeLanguageSpecificData = memoize( ( stemmer, functionWords, areHyphensWordBoundaries ) => {
|
|
138
|
-
return memoize( ( keyphrase, synonyms ) => {
|
|
139
|
-
return collectKeyphraseAndSynonymsStems( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries );
|
|
140
|
-
}, ( keyphrase, synonyms ) => {
|
|
141
|
-
return keyphrase + "," + synonyms.join( "," );
|
|
142
|
-
} );
|
|
143
|
-
} );
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Retrieves stems of words of the keyphrase and of each synonym phrase using the function that caches
|
|
147
|
-
* the results of previous calls of this function.
|
|
148
|
-
*
|
|
149
|
-
* @param {string} keyphrase The paper's keyphrase.
|
|
150
|
-
* @param {string[]} synonyms The paper's synonyms.
|
|
151
|
-
* @param {function} stemmer The language-specific stemmer (if available).
|
|
152
|
-
* @param {string[]} functionWords The language-specific function words.
|
|
153
|
-
* @param {boolean} areHyphensWordBoundaries Whether hyphens should be treated as word boundaries.
|
|
154
|
-
*
|
|
155
|
-
* @returns {Object} Object with an array of stems of words in the keyphrase and an array of arrays of stems of words in the synonyms.
|
|
156
|
-
*/
|
|
157
|
-
function collectStems( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries ) {
|
|
158
|
-
const collectStemsWithLanguageSpecificData = primeLanguageSpecificData( stemmer, functionWords, areHyphensWordBoundaries );
|
|
159
|
-
|
|
160
|
-
return collectStemsWithLanguageSpecificData( keyphrase, synonyms );
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export {
|
|
164
|
-
buildStems,
|
|
165
|
-
collectStems,
|
|
166
|
-
TopicPhrase,
|
|
167
|
-
StemOriginalPair,
|
|
168
|
-
primeLanguageSpecificData,
|
|
169
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates an object with a regex and a replacement pair to be processed.
|
|
3
|
-
*
|
|
4
|
-
* @param {Array} rule A pair or triplet of strings of which the first one is the regex to match
|
|
5
|
-
* and the second (and the third) is the replacement.
|
|
6
|
-
* @param {string} [flags=i] The regex flags to use.
|
|
7
|
-
*
|
|
8
|
-
* @returns {{ reg: RegExp, repl: string }|{ reg: RegExp, repl1: string, repl2: string }|null} Object to be used in the regex-based rules.
|
|
9
|
-
*/
|
|
10
|
-
const createSingleRuleFromArray = function( rule, flags = "i" ) {
|
|
11
|
-
if ( rule.length === 2 ) {
|
|
12
|
-
return {
|
|
13
|
-
reg: new RegExp( rule[ 0 ], flags ),
|
|
14
|
-
repl: rule[ 1 ],
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
if ( rule.length === 3 ) {
|
|
18
|
-
return {
|
|
19
|
-
reg: new RegExp( rule[ 0 ], flags ),
|
|
20
|
-
repl1: rule[ 1 ],
|
|
21
|
-
repl2: rule[ 2 ],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
return null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Creates an array of objects with a regex and a replacement pair to be processed.
|
|
29
|
-
*
|
|
30
|
-
* @param {Array} rules An array with pairs or triplets of strings of which the first one is the regex to match
|
|
31
|
-
* and the second (and the third) is the replacement.
|
|
32
|
-
* @param {string} [flags=i] The regex flags to use.
|
|
33
|
-
*
|
|
34
|
-
* @returns {Array} Array of objects to be used in the regex-based rules.
|
|
35
|
-
*/
|
|
36
|
-
const createRulesFromArrays = function( rules, flags = "i" ) {
|
|
37
|
-
return rules.map( rule => createSingleRuleFromArray( rule, flags ) );
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export {
|
|
41
|
-
createSingleRuleFromArray,
|
|
42
|
-
createRulesFromArrays,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default createRulesFromArrays;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import flattenSortLength from "./flattenSortLength";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks whether the word ends in one of the words in an exception list that is a simple array.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} word The word to check.
|
|
7
|
-
* @param {string[]} exceptionList The list of exceptions.
|
|
8
|
-
*
|
|
9
|
-
* @returns {boolean} Whether the checked word ends in one of the words in the exception list.
|
|
10
|
-
*/
|
|
11
|
-
export function checkIfWordEndingIsOnExceptionList( word, exceptionList ) {
|
|
12
|
-
for ( let i = 0; i < exceptionList.length; i++ ) {
|
|
13
|
-
if ( word.endsWith( exceptionList[ i ] ) ) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Checks whether a word is on the list of words that can have a prefix or not. Before checking the list, checks whether the word has a prefix
|
|
22
|
-
* and if it does, removes it.
|
|
23
|
-
*
|
|
24
|
-
* @param {string} word The word to check.
|
|
25
|
-
* @param {string[]} exceptionList The list of exceptions.
|
|
26
|
-
* @param {Object} prefixesObject An Object that contains the arrays of prefixes.
|
|
27
|
-
*
|
|
28
|
-
* @returns {boolean} Whether the word was found on the exception list or not.
|
|
29
|
-
*/
|
|
30
|
-
export function checkIfWordIsOnListThatCanHavePrefix( word, exceptionList, prefixesObject ) {
|
|
31
|
-
const prefixes = flattenSortLength( prefixesObject );
|
|
32
|
-
|
|
33
|
-
// Check whether the inputted word starts with one of the prefixes
|
|
34
|
-
const foundPrefix = prefixes.find( prefix => word.startsWith( prefix ) );
|
|
35
|
-
let stemmedWordWithoutPrefix = "";
|
|
36
|
-
|
|
37
|
-
if ( typeof( foundPrefix ) === "string" ) {
|
|
38
|
-
stemmedWordWithoutPrefix = word.slice( foundPrefix.length );
|
|
39
|
-
// At least 3 characters left after prefix deletion so that e.g. "be" is not treated as a prefix if found in the word "berg".
|
|
40
|
-
if ( stemmedWordWithoutPrefix.length > 2 ) {
|
|
41
|
-
word = stemmedWordWithoutPrefix;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return exceptionList.includes( word );
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Checks whether the word ends in one of the words in an exception list with two stems.
|
|
50
|
-
*
|
|
51
|
-
* @param {Array} exceptionListWithTwoStems The exception list with two stems.
|
|
52
|
-
* @param {string} word The word to check.
|
|
53
|
-
*
|
|
54
|
-
* @returns {string} The stem.
|
|
55
|
-
*/
|
|
56
|
-
export function checkExceptionListWithTwoStems( exceptionListWithTwoStems, word ) {
|
|
57
|
-
for ( const stemSet of exceptionListWithTwoStems ) {
|
|
58
|
-
const foundStem = stemSet.find( stemWord => word.endsWith( stemWord ) );
|
|
59
|
-
if ( foundStem ) {
|
|
60
|
-
const precedingLexicalMaterial = word.slice( 0, word.length - foundStem.length );
|
|
61
|
-
|
|
62
|
-
return precedingLexicalMaterial + stemSet[ 0 ];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Loops through an array of word endings and returns the longest ending that was matched at the end of the string.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} string The string to check.
|
|
5
|
-
* @param {string[]} endings The word endings to check.
|
|
6
|
-
* @returns {string} The longest matched ending.
|
|
7
|
-
*/
|
|
8
|
-
export default function findMatchingEndingInArray( string, endings ) {
|
|
9
|
-
const matches = [];
|
|
10
|
-
for ( const i in endings ) {
|
|
11
|
-
if ( string.endsWith( endings[ i ] ) ) {
|
|
12
|
-
matches.push( endings[ i ] );
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const longest = matches.sort( function( a, b ) {
|
|
17
|
-
return b.length - a.length;
|
|
18
|
-
} )[ 0 ];
|
|
19
|
-
|
|
20
|
-
if ( longest ) {
|
|
21
|
-
return longest;
|
|
22
|
-
}
|
|
23
|
-
return "";
|
|
24
|
-
}
|