axyseo 2.0.0-alpha.0.0.4 → 2.0.0-alpha.0.0.5
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,204 +0,0 @@
|
|
|
1
|
-
import { normalizeSingle } from "../helpers/sanitize/quotes";
|
|
2
|
-
import { collectStems, StemOriginalPair } from "../helpers/morphology/buildTopicStems";
|
|
3
|
-
|
|
4
|
-
import { escapeRegExp, flattenDeep } from "lodash";
|
|
5
|
-
import getAllWordsFromPaper from "../helpers/morphology/getAllWordsFromPaper";
|
|
6
|
-
import parseSynonyms from "../helpers/sanitize/parseSynonyms";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A stem with accompanying forms.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} stem The word stem.
|
|
12
|
-
* @param {string[]} forms The word forms for the stem.
|
|
13
|
-
*
|
|
14
|
-
* @constructor
|
|
15
|
-
*/
|
|
16
|
-
function StemWithForms( stem, forms ) {
|
|
17
|
-
this.stem = stem;
|
|
18
|
-
this.forms = forms;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A result for all topic forms.
|
|
23
|
-
*
|
|
24
|
-
* @param {Array[]} keyphraseForms All keyphrase forms.
|
|
25
|
-
* @param {Array[]} synonymsForms All synonym forms.
|
|
26
|
-
* @constructor
|
|
27
|
-
*/
|
|
28
|
-
function Result( keyphraseForms = [], synonymsForms = [] ) {
|
|
29
|
-
this.keyphraseForms = keyphraseForms;
|
|
30
|
-
this.synonymsForms = synonymsForms;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Takes a stem-original pair and returns the accompanying forms for the stem that were found in the paper. Additionally
|
|
35
|
-
* adds a sanitized version of the original word and (for specific languages) creates basic word forms.
|
|
36
|
-
*
|
|
37
|
-
* @param {StemOriginalPair} stemOriginalPair The stem-original pair for which to get forms.
|
|
38
|
-
* @param {StemWithForms[]} paperWordsGroupedByStems All word forms in the paper grouped by stem.
|
|
39
|
-
* @param {Function|null} createBasicWordForms A function to create basic word forms (if available).
|
|
40
|
-
*
|
|
41
|
-
* @returns {string[]} All forms found in the paper for the given stem, plus a sanitized version of the original word.
|
|
42
|
-
*/
|
|
43
|
-
function replaceStemWithForms( stemOriginalPair, paperWordsGroupedByStems, createBasicWordForms ) {
|
|
44
|
-
const matchingStemFormPair = paperWordsGroupedByStems.find( element => element.stem === stemOriginalPair.stem );
|
|
45
|
-
const originalSanitized = normalizeSingle( escapeRegExp( stemOriginalPair.original ) );
|
|
46
|
-
|
|
47
|
-
const forms = matchingStemFormPair
|
|
48
|
-
? [ originalSanitized, ...matchingStemFormPair.forms ]
|
|
49
|
-
: [ originalSanitized ];
|
|
50
|
-
|
|
51
|
-
// Add extra forms for languages for which we have basic word form support.
|
|
52
|
-
if ( createBasicWordForms ) {
|
|
53
|
-
forms.push( ...createBasicWordForms( stemOriginalPair.original ) );
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/*
|
|
57
|
-
* Return original and found or created forms.
|
|
58
|
-
* Only return original if no matching forms were found in the text and no forms could be created.
|
|
59
|
-
*/
|
|
60
|
-
return [ ... new Set( forms ) ];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Extracts the stems from all keyphrase and synonym stems.
|
|
65
|
-
*
|
|
66
|
-
* @param {TopicPhrase} keyphrase A topic phrase.
|
|
67
|
-
* @param {TopicPhrase[]} synonyms An array of topic phrases.
|
|
68
|
-
*
|
|
69
|
-
* @returns {string[]} All word stems of they keyphrase and synonyms.
|
|
70
|
-
*/
|
|
71
|
-
function extractStems( keyphrase, synonyms ) {
|
|
72
|
-
const keyphraseStemsOnly = keyphrase.stemOriginalPairs.length === 0
|
|
73
|
-
? []
|
|
74
|
-
: keyphrase.getStems();
|
|
75
|
-
|
|
76
|
-
const synonymsStemsOnly = synonyms.length === 0
|
|
77
|
-
? []
|
|
78
|
-
: synonyms.map( topicPhrase => topicPhrase.getStems() );
|
|
79
|
-
|
|
80
|
-
return ( [ ...keyphraseStemsOnly, ...flattenDeep( synonymsStemsOnly ) ] );
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Constructs the result with forms for a topic phrase (i.e., a keyphrase or a synonym).
|
|
85
|
-
*
|
|
86
|
-
* @param {TopicPhrase} topicPhrase The topic phrase for which to construct the result.
|
|
87
|
-
* @param {StemWithForms[]} paperWordsGroupedByStems All word forms in the paper grouped by stem.
|
|
88
|
-
* @param {Function|null} createBasicWordForms A function to create basic word forms (if available).
|
|
89
|
-
*
|
|
90
|
-
* @returns {Array.<string[]>} The word forms for a given topic phrase, grouped by original topic phrase word.
|
|
91
|
-
*/
|
|
92
|
-
function constructTopicPhraseResult( topicPhrase, paperWordsGroupedByStems, createBasicWordForms ) {
|
|
93
|
-
// Empty result for an empty topic phrase.
|
|
94
|
-
if ( topicPhrase.stemOriginalPairs.length === 0 ) {
|
|
95
|
-
return [];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if ( topicPhrase.exactMatch ) {
|
|
99
|
-
return [ [ topicPhrase.stemOriginalPairs[ 0 ].stem ] ];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return topicPhrase.stemOriginalPairs.map( function( stemOriginalPair ) {
|
|
103
|
-
return replaceStemWithForms( stemOriginalPair, paperWordsGroupedByStems, createBasicWordForms );
|
|
104
|
-
} );
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Gets all matching word forms for the keyphrase and synonyms. Stems are either collected from
|
|
109
|
-
* the paper or, for specific languages, directly created.
|
|
110
|
-
*
|
|
111
|
-
* @param {string} keyphrase The keyphrase.
|
|
112
|
-
* @param {string[]} synonyms The synonyms.
|
|
113
|
-
* @param {string[]} allWordsFromPaper All words found in the paper.
|
|
114
|
-
* @param {string[]} functionWords The function words for a given language (if available).
|
|
115
|
-
* @param {Function|null} stemmer A stemmer (if available).
|
|
116
|
-
* @param {Function|null} createBasicWordForms A function to create basic word forms (if available).
|
|
117
|
-
* @param {boolean} areHyphensWordBoundaries Whether hyphens should be treated as word boundaries.
|
|
118
|
-
|
|
119
|
-
* @returns {Object} Object with an array of keyphrase forms and an array of arrays of synonyms forms, based on the forms
|
|
120
|
-
* found in the text or created forms.
|
|
121
|
-
*/
|
|
122
|
-
function getWordForms( keyphrase, synonyms, allWordsFromPaper, functionWords, stemmer, createBasicWordForms, areHyphensWordBoundaries ) {
|
|
123
|
-
const topicPhrases = collectStems( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries );
|
|
124
|
-
const keyphraseStemmed = topicPhrases.keyphraseStems;
|
|
125
|
-
const synonymsStemmed = topicPhrases.synonymsStems;
|
|
126
|
-
|
|
127
|
-
// Return an empty result when no keyphrase and synonyms have been set.
|
|
128
|
-
if ( keyphraseStemmed.stemOriginalPairs.length === 0 && synonymsStemmed.length === 0 ) {
|
|
129
|
-
return new Result();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// Return exact match if all topic phrases contain exact match. Forms don't need to be built in that case.
|
|
133
|
-
const allTopicPhrases = [ keyphraseStemmed, ...synonymsStemmed ];
|
|
134
|
-
|
|
135
|
-
if ( allTopicPhrases.every( topicPhrase => topicPhrase.exactMatch === true ) ) {
|
|
136
|
-
return new Result(
|
|
137
|
-
[ [ keyphraseStemmed.stemOriginalPairs[ 0 ].stem ] ],
|
|
138
|
-
synonymsStemmed.map( synonym => [ [ synonym.stemOriginalPairs[ 0 ].stem ] ]
|
|
139
|
-
)
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Get all stems from the keyphrase and synonyms.
|
|
144
|
-
const topicStemsFlat = [ ... new Set( extractStems( keyphraseStemmed, synonymsStemmed ) ) ];
|
|
145
|
-
|
|
146
|
-
/*
|
|
147
|
-
* Get all words from the paper text, title, meta description and slug.
|
|
148
|
-
* Filter duplicates and function words.
|
|
149
|
-
*/
|
|
150
|
-
const paperWords = [ ... new Set( allWordsFromPaper.filter( word => ! functionWords.includes( word ) ) ) ];
|
|
151
|
-
|
|
152
|
-
// Add stems to words from the paper, filter out all forms that aren't in the keyphrase or synonyms and order alphabetically.
|
|
153
|
-
const paperWordsWithStems = paperWords
|
|
154
|
-
.map( word => new StemOriginalPair( stemmer( word ), word ) )
|
|
155
|
-
.filter( stemOriginalPair => topicStemsFlat.includes( stemOriginalPair.stem ) )
|
|
156
|
-
.sort( ( a, b ) => a.stem.localeCompare( b.stem ) );
|
|
157
|
-
|
|
158
|
-
// Group word-stem pairs from the paper by stems.
|
|
159
|
-
const paperWordsGroupedByStems = paperWordsWithStems.reduce( function( accumulator, stemOriginalPair ) {
|
|
160
|
-
const lastItem = accumulator[ accumulator.length - 1 ];
|
|
161
|
-
|
|
162
|
-
if ( accumulator.length === 0 || lastItem.stem !== stemOriginalPair.stem ) {
|
|
163
|
-
accumulator.push( new StemWithForms( stemOriginalPair.stem, [ stemOriginalPair.original ] ) );
|
|
164
|
-
} else {
|
|
165
|
-
lastItem.forms.push( stemOriginalPair.original );
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return accumulator;
|
|
169
|
-
}, [] );
|
|
170
|
-
|
|
171
|
-
return new Result(
|
|
172
|
-
constructTopicPhraseResult( keyphraseStemmed, paperWordsGroupedByStems, createBasicWordForms ),
|
|
173
|
-
synonymsStemmed.map( synonym => constructTopicPhraseResult( synonym, paperWordsGroupedByStems, createBasicWordForms ) )
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Gets all matching word forms for the keyphrase and synonyms.
|
|
179
|
-
*
|
|
180
|
-
* @param {Paper} paper The paper.
|
|
181
|
-
* @param {Researcher} researcher The researcher.
|
|
182
|
-
*
|
|
183
|
-
* @returns {Object} Object with an array of keyphrase forms and an array of arrays of synonyms forms, based on the forms
|
|
184
|
-
* found in the text or created forms.
|
|
185
|
-
*/
|
|
186
|
-
export default function( paper, researcher ) {
|
|
187
|
-
const functionWords = researcher.getConfig( "functionWords" );
|
|
188
|
-
const stemmer = researcher.getHelper( "getStemmer" )( researcher );
|
|
189
|
-
const createBasicWordForms = researcher.getHelper( "createBasicWordForms" );
|
|
190
|
-
const language = researcher.getConfig( "language" );
|
|
191
|
-
/*
|
|
192
|
-
* Whether we want to split words on hyphens depends on the language.
|
|
193
|
-
* In all languages apart from Indonesian, we consider hyphens as word boundaries. But in Indonesian, hyphens are used
|
|
194
|
-
* to form plural forms of nouns, e.g. 'buku' is the singular form for 'book' and 'buku-buku' is the plural form.
|
|
195
|
-
* This is why we don't split words on hyphens in Indonesian and we consider 'buku-buku' as one word rather than two.
|
|
196
|
-
*/
|
|
197
|
-
const areHyphensWordBoundaries = researcher.getConfig( "areHyphensWordBoundaries" );
|
|
198
|
-
|
|
199
|
-
const allWordsFromPaper = getAllWordsFromPaper( paper, areHyphensWordBoundaries ).map( word => word.toLocaleLowerCase( language ) );
|
|
200
|
-
const keyphrase = paper.getKeyword().toLocaleLowerCase( language ).trim();
|
|
201
|
-
const synonyms = parseSynonyms( paper.getSynonyms().toLocaleLowerCase( language ).trim() );
|
|
202
|
-
|
|
203
|
-
return getWordForms( keyphrase, synonyms, allWordsFromPaper, functionWords, stemmer, createBasicWordForms, areHyphensWordBoundaries );
|
|
204
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets all H1s in a text, including their content and their position information.
|
|
3
|
-
*
|
|
4
|
-
* @param {Paper} paper The paper for which to get the H1s.
|
|
5
|
-
*
|
|
6
|
-
* @returns {number | null} An array with all H1s, their content and position.
|
|
7
|
-
*/
|
|
8
|
-
export default function(paper) {
|
|
9
|
-
return paper.getH1Count();
|
|
10
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** @module researches/imageInText */
|
|
2
|
-
|
|
3
|
-
import getImagesInTree from "../helpers/image/getImagesInTree";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks the amount of images in the text.
|
|
7
|
-
*
|
|
8
|
-
* @param {Paper} paper The paper to check for images.
|
|
9
|
-
*
|
|
10
|
-
* @returns {number} The amount of found images.
|
|
11
|
-
*/
|
|
12
|
-
export default function imageCount( paper ) {
|
|
13
|
-
const images = getImagesInTree( paper );
|
|
14
|
-
|
|
15
|
-
return images.length;
|
|
16
|
-
}
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { flattenDeep, max, uniq as unique, zipWith } from "lodash";
|
|
2
|
-
import { findWordFormsInString } from "../helpers/match/findKeywordFormsInString";
|
|
3
|
-
import { markWordsInSentences } from "../helpers/word/markWordsInSentences";
|
|
4
|
-
import getSentences from "../helpers/sentence/getSentences";
|
|
5
|
-
import parseSynonyms from "../helpers/sanitize/parseSynonyms";
|
|
6
|
-
import { mergeListItems } from "../helpers/sanitize/mergeListItems";
|
|
7
|
-
import removeHtmlBlocks from "../helpers/html/htmlParser";
|
|
8
|
-
import { filterShortcodesFromHTML } from "../helpers/sanitize/filterShortcodesFromTree";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Checks whether at least half of the content words from the topic are found within the sentence.
|
|
12
|
-
* Assigns a score to every sentence following the following schema:
|
|
13
|
-
* 9 if at least half of the content words from the topic are in the sentence,
|
|
14
|
-
* 3 otherwise.
|
|
15
|
-
*
|
|
16
|
-
* @param {Array} topic The word forms of all content words in a keyphrase or a synonym.
|
|
17
|
-
* @param {Array} sentences An array of all sentences in the text.
|
|
18
|
-
* @param {string} locale The locale of the paper to analyse.
|
|
19
|
-
* @param {function} matchWordCustomHelper The language-specific helper function to match word in text.
|
|
20
|
-
*
|
|
21
|
-
* @returns {Array} The scores per sentence.
|
|
22
|
-
*/
|
|
23
|
-
const computeScoresPerSentenceLongTopic = function( topic, sentences, locale, matchWordCustomHelper ) {
|
|
24
|
-
const sentenceScores = Array( sentences.length );
|
|
25
|
-
|
|
26
|
-
for ( let i = 0; i < sentences.length; i++ ) {
|
|
27
|
-
const foundInCurrentSentence = findWordFormsInString( topic, sentences[ i ], locale, matchWordCustomHelper );
|
|
28
|
-
|
|
29
|
-
if ( foundInCurrentSentence.percentWordMatches >= 50 ) {
|
|
30
|
-
sentenceScores[ i ] = 9;
|
|
31
|
-
} else {
|
|
32
|
-
sentenceScores[ i ] = 3;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return sentenceScores;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Checks whether all content words from the topic are found within one sentence.
|
|
42
|
-
* Assigns a score to every sentence following the following schema:
|
|
43
|
-
* 9 if all content words from the topic are in the sentence,
|
|
44
|
-
* 3 if not all content words from the topic were found in the sentence.
|
|
45
|
-
*
|
|
46
|
-
* @param {Array} topic The word forms of all content words in a keyphrase or a synonym.
|
|
47
|
-
* @param {Array} sentences An array of all sentences in the text.
|
|
48
|
-
* @param {string} locale The locale of the paper to analyse.
|
|
49
|
-
* @param {function} matchWordCustomHelper The language-specific helper function to match word in text.
|
|
50
|
-
*
|
|
51
|
-
* @returns {Array} The scores per sentence.
|
|
52
|
-
*/
|
|
53
|
-
const computeScoresPerSentenceShortTopic = function( topic, sentences, locale, matchWordCustomHelper ) {
|
|
54
|
-
const sentenceScores = Array( sentences.length );
|
|
55
|
-
|
|
56
|
-
for ( let i = 0; i < sentences.length; i++ ) {
|
|
57
|
-
const currentSentence = sentences[ i ];
|
|
58
|
-
const foundInCurrentSentence = findWordFormsInString( topic, currentSentence, locale, matchWordCustomHelper );
|
|
59
|
-
if ( foundInCurrentSentence.percentWordMatches === 100 ) {
|
|
60
|
-
sentenceScores[ i ] = 9;
|
|
61
|
-
} else {
|
|
62
|
-
sentenceScores[ i ] = 3;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return sentenceScores;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Maximizes scores: Give every sentence a maximal score that it got from analysis of all topics
|
|
70
|
-
*
|
|
71
|
-
* @param {Array} sentenceScores The scores for every sentence, as assessed per keyphrase and every synonym.
|
|
72
|
-
*
|
|
73
|
-
* @returns {Array} Maximal scores of topic relevance per sentence.
|
|
74
|
-
*/
|
|
75
|
-
const maximizeSentenceScores = function( sentenceScores ) {
|
|
76
|
-
const sentenceScoresTransposed = sentenceScores[ 0 ].map( function( col, i ) {
|
|
77
|
-
return sentenceScores.map( function( row ) {
|
|
78
|
-
return row[ i ];
|
|
79
|
-
} );
|
|
80
|
-
} );
|
|
81
|
-
|
|
82
|
-
return sentenceScoresTransposed.map( function( scoresForOneSentence ) {
|
|
83
|
-
return max( scoresForOneSentence );
|
|
84
|
-
} );
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Computes the maximally long piece of text that does not include the topic.
|
|
90
|
-
*
|
|
91
|
-
* @param {Array} sentenceScores The array of scores per sentence.
|
|
92
|
-
*
|
|
93
|
-
* @returns {number} The maximum number of sentences that do not include the topic.
|
|
94
|
-
*/
|
|
95
|
-
const getDistraction = function( sentenceScores ) {
|
|
96
|
-
const numberOfSentences = sentenceScores.length;
|
|
97
|
-
const allTopicSentencesIndices = [];
|
|
98
|
-
|
|
99
|
-
for ( let i = 0; i < numberOfSentences; i++ ) {
|
|
100
|
-
if ( sentenceScores[ i ] > 3 ) {
|
|
101
|
-
allTopicSentencesIndices.push( i );
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const numberOfTopicSentences = allTopicSentencesIndices.length;
|
|
106
|
-
|
|
107
|
-
if ( numberOfTopicSentences === 0 ) {
|
|
108
|
-
return numberOfSentences;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Add fake topic sentences at the very beginning and at the very end
|
|
113
|
-
* to account for cases when the text starts or ends with a train of distraction.
|
|
114
|
-
*/
|
|
115
|
-
allTopicSentencesIndices.unshift( -1 );
|
|
116
|
-
allTopicSentencesIndices.push( numberOfSentences );
|
|
117
|
-
|
|
118
|
-
const distances = [];
|
|
119
|
-
|
|
120
|
-
for ( let i = 1; i < numberOfTopicSentences + 2; i++ ) {
|
|
121
|
-
distances.push( allTopicSentencesIndices[ i ] - allTopicSentencesIndices[ i - 1 ] - 1 );
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return max( distances );
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Computes the per-sentence scores depending on the length of the topic phrase and maximizes them over all topic phrases.
|
|
129
|
-
*
|
|
130
|
-
* @param {Array} sentences The sentences to get scores for.
|
|
131
|
-
* @param {Array} topicFormsInOneArray The topic phrases forms to search for in the sentences.
|
|
132
|
-
* @param {string} locale The locale to work in.
|
|
133
|
-
* @param {Array} functionWords The function words list.
|
|
134
|
-
* @param {function} matchWordCustomHelper The language-specific helper function to match word in text.
|
|
135
|
-
* @param {int} topicLengthCriteria The topic length criteria. The default value is 4, where a topic is considered short
|
|
136
|
-
* if it's less than 4 word long, and otherwise long.
|
|
137
|
-
* @param {Array} originalTopic The array of the original form of the topic with function words filtered out.
|
|
138
|
-
* @param {function} wordsCharacterCount The helper to calculate the characters length of all the words in the array.
|
|
139
|
-
*
|
|
140
|
-
* @returns {Object} An array with maximized score per sentence and an array with all sentences that do not contain the topic.
|
|
141
|
-
*/
|
|
142
|
-
const getSentenceScores = function( sentences, topicFormsInOneArray, locale, functionWords, matchWordCustomHelper,
|
|
143
|
-
topicLengthCriteria = 4, originalTopic, wordsCharacterCount ) {
|
|
144
|
-
// Compute per-sentence scores of topic-relatedness.
|
|
145
|
-
const topicNumber = topicFormsInOneArray.length;
|
|
146
|
-
|
|
147
|
-
const sentenceScores = Array( topicNumber );
|
|
148
|
-
|
|
149
|
-
// For languages with function words apply either full match or partial match depending on topic length
|
|
150
|
-
if ( functionWords.length > 0 ) {
|
|
151
|
-
for ( let i = 0; i < topicNumber; i++ ) {
|
|
152
|
-
const topic = topicFormsInOneArray[ i ];
|
|
153
|
-
/*
|
|
154
|
-
* If the helper to calculate the characters length of all the words in the array is available,
|
|
155
|
-
* we use this helper to calculate the characters length of the original topic form.
|
|
156
|
-
* We then use the result and compare it with the topicLengthCriteria.
|
|
157
|
-
*/
|
|
158
|
-
const topicLength = wordsCharacterCount ? wordsCharacterCount( originalTopic[ i ] ) : topic.length;
|
|
159
|
-
if ( topicLength < topicLengthCriteria ) {
|
|
160
|
-
sentenceScores[ i ] = computeScoresPerSentenceShortTopic( topic, sentences, locale, matchWordCustomHelper );
|
|
161
|
-
} else {
|
|
162
|
-
sentenceScores[ i ] = computeScoresPerSentenceLongTopic( topic, sentences, locale, matchWordCustomHelper );
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
} else {
|
|
166
|
-
// For languages without function words apply the full match always
|
|
167
|
-
for ( let i = 0; i < topicNumber; i++ ) {
|
|
168
|
-
const topic = topicFormsInOneArray[ i ];
|
|
169
|
-
sentenceScores[ i ] = computeScoresPerSentenceShortTopic( topic, sentences, locale, matchWordCustomHelper );
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Maximize scores: Give every sentence a maximal score that it got from analysis of all topics
|
|
174
|
-
const maximizedSentenceScores = maximizeSentenceScores( sentenceScores );
|
|
175
|
-
|
|
176
|
-
// Zip an array combining each sentence with the associated maximized score.
|
|
177
|
-
const sentencesWithMaximizedScores = zipWith( sentences, maximizedSentenceScores, ( sentence, score ) => {
|
|
178
|
-
return { sentence, score };
|
|
179
|
-
} );
|
|
180
|
-
|
|
181
|
-
// Filter sentences that contain topic words for future highlights.
|
|
182
|
-
const sentencesWithTopic = sentencesWithMaximizedScores.filter( sentenceObject => sentenceObject.score > 3 );
|
|
183
|
-
|
|
184
|
-
return {
|
|
185
|
-
maximizedSentenceScores: maximizedSentenceScores,
|
|
186
|
-
sentencesWithTopic: sentencesWithTopic.map( sentenceObject => sentenceObject.sentence ),
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Determines which portions of the text did not receive a lot of content words from keyphrase and synonyms.
|
|
193
|
-
*
|
|
194
|
-
* @param {Paper} paper The paper to check the keyphrase distribution for.
|
|
195
|
-
* @param {Researcher} researcher The researcher to use for analysis.
|
|
196
|
-
*
|
|
197
|
-
* @returns {Object} The scores of topic relevance per portion of text and an array of all word forms to highlight.
|
|
198
|
-
*/
|
|
199
|
-
const keyphraseDistributionResearcher = function( paper, researcher ) {
|
|
200
|
-
const functionWords = researcher.getConfig( "functionWords" );
|
|
201
|
-
const matchWordCustomHelper = researcher.getHelper( "matchWordCustomHelper" );
|
|
202
|
-
const getContentWordsHelper = researcher.getHelper( "getContentWords" );
|
|
203
|
-
const wordsCharacterCount = researcher.getResearch( "wordsCharacterCount" );
|
|
204
|
-
const memoizedTokenizer = researcher.getHelper( "memoizedTokenizer" );
|
|
205
|
-
|
|
206
|
-
// Custom topic length criteria for languages that don't use the default value to determine whether a topic is long or short.
|
|
207
|
-
const topicLengthCriteria = researcher.getConfig( "topicLength" ).lengthCriteria;
|
|
208
|
-
|
|
209
|
-
let text = paper.getText();
|
|
210
|
-
text = removeHtmlBlocks( text );
|
|
211
|
-
text = filterShortcodesFromHTML( text, paper._attributes && paper._attributes.shortcodes );
|
|
212
|
-
text = mergeListItems( text );
|
|
213
|
-
const sentences = getSentences( text, memoizedTokenizer );
|
|
214
|
-
const topicForms = researcher.getResearch( "morphology" );
|
|
215
|
-
|
|
216
|
-
const originalTopic = [];
|
|
217
|
-
if ( getContentWordsHelper ) {
|
|
218
|
-
originalTopic.push( getContentWordsHelper( paper.getKeyword() ) );
|
|
219
|
-
parseSynonyms( paper.getSynonyms() ).forEach( synonym => originalTopic.push( getContentWordsHelper( synonym ) ) );
|
|
220
|
-
}
|
|
221
|
-
const locale = paper.getLocale();
|
|
222
|
-
const topicFormsInOneArray = [ topicForms.keyphraseForms ];
|
|
223
|
-
topicForms.synonymsForms.forEach( function( synonym ) {
|
|
224
|
-
topicFormsInOneArray.push( synonym );
|
|
225
|
-
} );
|
|
226
|
-
|
|
227
|
-
const allTopicWords = unique( flattenDeep( topicFormsInOneArray ) ).sort( ( a, b ) => b.length - a.length );
|
|
228
|
-
|
|
229
|
-
// Get per-sentence scores and sentences that have topic.
|
|
230
|
-
const sentenceScores = getSentenceScores( sentences, topicFormsInOneArray, locale, functionWords, matchWordCustomHelper,
|
|
231
|
-
topicLengthCriteria, originalTopic, wordsCharacterCount );
|
|
232
|
-
const maximizedSentenceScores = sentenceScores.maximizedSentenceScores;
|
|
233
|
-
const maxLengthDistraction = getDistraction( maximizedSentenceScores );
|
|
234
|
-
|
|
235
|
-
return {
|
|
236
|
-
sentencesToHighlight: markWordsInSentences( allTopicWords, sentenceScores.sentencesWithTopic, locale, matchWordCustomHelper ),
|
|
237
|
-
keyphraseDistributionScore: maxLengthDistraction / sentences.length * 100,
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
export {
|
|
242
|
-
computeScoresPerSentenceShortTopic,
|
|
243
|
-
computeScoresPerSentenceLongTopic,
|
|
244
|
-
maximizeSentenceScores,
|
|
245
|
-
keyphraseDistributionResearcher,
|
|
246
|
-
getDistraction,
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
export default keyphraseDistributionResearcher;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines the length in words of the keyphrase.
|
|
3
|
-
*
|
|
4
|
-
* @param {Paper} paper The paper to research
|
|
5
|
-
* @param {Researcher} researcher The researcher to use for analysis
|
|
6
|
-
*
|
|
7
|
-
* @returns {Object} The length of the keyphrase and the function words list.
|
|
8
|
-
*/
|
|
9
|
-
export default function( paper, researcher ) {
|
|
10
|
-
const topicForms = researcher.getResearch( "morphology" );
|
|
11
|
-
const functionWords = researcher.getConfig( "functionWords" );
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
keyphraseLength: topicForms.keyphraseForms.length,
|
|
15
|
-
functionWords: functionWords,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { flatten, flattenDeep } from "lodash";
|
|
2
|
-
import getSentencesFromTree from "../helpers/sentence/getSentencesFromTree";
|
|
3
|
-
import { normalizeSingle } from "../helpers/sanitize/quotes";
|
|
4
|
-
import getMarkingsInSentence from "../helpers/highlighting/getMarkingsInSentence";
|
|
5
|
-
import matchWordFormsWithSentence from "../helpers/match/matchWordFormsWithSentence";
|
|
6
|
-
import isDoubleQuoted from "../helpers/match/isDoubleQuoted";
|
|
7
|
-
import { markWordsInASentence } from "../helpers/word/markWordsInSentences";
|
|
8
|
-
import getSentences from "../helpers/sentence/getSentences";
|
|
9
|
-
import { filterShortcodesFromHTML } from "../helpers";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Counts the occurrences of the keyphrase in the text and creates the Mark objects for the matches.
|
|
13
|
-
*
|
|
14
|
-
* @param {(Sentence|string)[]} sentences The sentences to check.
|
|
15
|
-
* @param {Array} keyphraseForms The keyphrase forms.
|
|
16
|
-
* @param {string} locale The locale used in the analysis.
|
|
17
|
-
* @param {function} matchWordCustomHelper A custom helper to match words with a text.
|
|
18
|
-
* @param {boolean} isExactMatchRequested Whether the exact matching is requested.
|
|
19
|
-
* @param {function} customSplitIntoTokensHelper A custom helper to split sentences into tokens.
|
|
20
|
-
*
|
|
21
|
-
* @returns {{markings: Mark[], count: number}} The number of keyphrase occurrences in the text and the Mark objects of the matches.
|
|
22
|
-
*/
|
|
23
|
-
export function countKeyphraseInText( sentences, keyphraseForms, locale, matchWordCustomHelper,
|
|
24
|
-
isExactMatchRequested, customSplitIntoTokensHelper ) {
|
|
25
|
-
const result = { count: 0, markings: [] };
|
|
26
|
-
|
|
27
|
-
sentences.forEach( sentence => {
|
|
28
|
-
const matchesInSentence = keyphraseForms.map( wordForms => matchWordFormsWithSentence( sentence,
|
|
29
|
-
wordForms, locale, matchWordCustomHelper, isExactMatchRequested, customSplitIntoTokensHelper ) );
|
|
30
|
-
|
|
31
|
-
// A sentence has at least one full-match of the keyphrase if each word occurs at least once.
|
|
32
|
-
const isEachWordFound = matchesInSentence.every( wordForms => wordForms.count > 0 );
|
|
33
|
-
|
|
34
|
-
if ( isEachWordFound ) {
|
|
35
|
-
/*
|
|
36
|
-
* Retrieve all the occurrences' count of each word of the keyphrase and save it in an array.
|
|
37
|
-
* matches: [ [ { matches: ["red"], count: 1 } ], [ { matches: ["pandas"], count: 2 } ] ]
|
|
38
|
-
* counts: [ 1, 2 ]
|
|
39
|
-
*/
|
|
40
|
-
const counts = matchesInSentence.map( match => match.count );
|
|
41
|
-
/*
|
|
42
|
-
* The number of the full-match count is the lowest count of the occurrences.
|
|
43
|
-
* counts: [ 1, 2 ]
|
|
44
|
-
* totalMatchCount: 1
|
|
45
|
-
*
|
|
46
|
-
* From the example above, the full-match is 1, because one of the "pandas" occurrences is not accompanied by "red"
|
|
47
|
-
* to be counted as a full-match.
|
|
48
|
-
*/
|
|
49
|
-
const totalMatchCount = Math.min( ...counts );
|
|
50
|
-
const foundWords = flattenDeep( matchesInSentence.map( match => match.matches ) );
|
|
51
|
-
|
|
52
|
-
let markings = [];
|
|
53
|
-
|
|
54
|
-
if ( matchWordCustomHelper ) {
|
|
55
|
-
// Currently, this check is only applicable for Japanese.
|
|
56
|
-
markings = markWordsInASentence( sentence, foundWords, matchWordCustomHelper );
|
|
57
|
-
} else {
|
|
58
|
-
markings = getMarkingsInSentence( sentence, foundWords );
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
result.count += totalMatchCount;
|
|
62
|
-
result.markings.push( markings );
|
|
63
|
-
}
|
|
64
|
-
} );
|
|
65
|
-
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Calculates the keyphrase count, takes morphology into account.
|
|
71
|
-
*
|
|
72
|
-
* @param {Paper} paper The paper containing keyphrase and text.
|
|
73
|
-
* @param {Researcher} researcher The researcher.
|
|
74
|
-
*
|
|
75
|
-
* @returns {{count: number, markings: Mark[], keyphraseLength: number}} An object containing the keyphrase count, markings and the kephrase length.
|
|
76
|
-
*/
|
|
77
|
-
export default function getKeyphraseCount( paper, researcher ) {
|
|
78
|
-
const result = { count: 0, markings: [], keyphraseLength: 0 };
|
|
79
|
-
const topicForms = researcher.getResearch( "morphology" );
|
|
80
|
-
let keyphraseForms = topicForms.keyphraseForms;
|
|
81
|
-
const keyphraseLength = keyphraseForms.length;
|
|
82
|
-
|
|
83
|
-
/*
|
|
84
|
-
* Normalize single quotes so that word form with different type of single quotes can still be matched.
|
|
85
|
-
* For example, "key‛word" should match "key'word".
|
|
86
|
-
*/
|
|
87
|
-
keyphraseForms = keyphraseForms.map( word => word.map( form => normalizeSingle( form ) ) );
|
|
88
|
-
|
|
89
|
-
if ( keyphraseLength === 0 ) {
|
|
90
|
-
return result;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const matchWordCustomHelper = researcher.getHelper( "matchWordCustomHelper" );
|
|
94
|
-
const customSentenceTokenizer = researcher.getHelper( "memoizedTokenizer" );
|
|
95
|
-
const customSplitIntoTokensHelper = researcher.getHelper( "splitIntoTokensCustom" );
|
|
96
|
-
const locale = paper.getLocale();
|
|
97
|
-
const text = matchWordCustomHelper
|
|
98
|
-
? filterShortcodesFromHTML( paper.getText(), paper._attributes && paper._attributes.shortcodes )
|
|
99
|
-
: paper.getText();
|
|
100
|
-
|
|
101
|
-
// When the custom helper is available, we're using the sentences retrieved from the text for the analysis.
|
|
102
|
-
const sentences = matchWordCustomHelper ? getSentences( text, customSentenceTokenizer ) : getSentencesFromTree( paper );
|
|
103
|
-
// Exact matching is requested when the keyphrase is enclosed in double quotes.
|
|
104
|
-
const isExactMatchRequested = isDoubleQuoted( paper.getKeyword() );
|
|
105
|
-
|
|
106
|
-
/*
|
|
107
|
-
* Count the amount of keyphrase occurrences in the sentences.
|
|
108
|
-
* An occurrence is counted when all words of the keyphrase are contained within the sentence. Each sentence can contain multiple keyphrases.
|
|
109
|
-
* (e.g. "The apple potato is an apple and a potato." has two occurrences of the keyphrase "apple potato").
|
|
110
|
-
*/
|
|
111
|
-
const keyphraseFound = countKeyphraseInText( sentences, keyphraseForms, locale, matchWordCustomHelper,
|
|
112
|
-
isExactMatchRequested, customSplitIntoTokensHelper );
|
|
113
|
-
|
|
114
|
-
result.count = keyphraseFound.count;
|
|
115
|
-
result.markings = flatten( keyphraseFound.markings );
|
|
116
|
-
result.keyphraseLength = keyphraseLength;
|
|
117
|
-
|
|
118
|
-
return result;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Calculates the keyphrase count, takes morphology into account.
|
|
123
|
-
*
|
|
124
|
-
* @deprecated Use getKeyphraseCount instead.
|
|
125
|
-
*
|
|
126
|
-
* @param {Paper} paper The paper containing keyphrase and text.
|
|
127
|
-
* @param {Researcher} researcher The researcher.
|
|
128
|
-
*
|
|
129
|
-
* @returns {Object} An array of all the matches, markings and the keyphrase count.
|
|
130
|
-
*/
|
|
131
|
-
export function keywordCount( paper, researcher ) {
|
|
132
|
-
console.warn( "This function is deprecated, use getKeyphraseCount instead." );
|
|
133
|
-
return getKeyphraseCount( paper, researcher );
|
|
134
|
-
}
|