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,14 +0,0 @@
|
|
|
1
|
-
import { flatten } from "lodash";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns combined list of strings/words, sorted by length (descending).
|
|
5
|
-
*
|
|
6
|
-
* @param {Object} dataWords The words data that is going to be sorted.
|
|
7
|
-
*
|
|
8
|
-
* @returns {Array<string>} All words, sorted by length (descending).
|
|
9
|
-
*/
|
|
10
|
-
export default function flattenSortLength( dataWords ) {
|
|
11
|
-
const allWords = flatten( Object.values( dataWords ) );
|
|
12
|
-
|
|
13
|
-
return allWords.sort( ( a, b ) => b.length - a.length || a.localeCompare( b ) );
|
|
14
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { escapeRegExp } from "lodash";
|
|
2
|
-
import getAltAttribute from "../image/getAltAttribute";
|
|
3
|
-
import { normalizeSingle } from "../sanitize/quotes";
|
|
4
|
-
import parseSlug from "../url/parseSlug";
|
|
5
|
-
import getWords from "../word/getWords";
|
|
6
|
-
import getImagesInTree from "../image/getImagesInTree";
|
|
7
|
-
import { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from "../../../config/wordBoundariesWithoutPunctuation";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Gets all words found in the text, title, slug and meta description of a given paper.
|
|
11
|
-
*
|
|
12
|
-
* @param {Paper} paper The paper for which to get the words.
|
|
13
|
-
* @param {boolean} areHyphensWordBoundaries Whether hyphens should be treated as word boundaries.
|
|
14
|
-
*
|
|
15
|
-
* @returns {string[]} All words found.
|
|
16
|
-
*/
|
|
17
|
-
export default function( paper, areHyphensWordBoundaries ) {
|
|
18
|
-
const paperText = paper.getText();
|
|
19
|
-
const altTagsInText = getImagesInTree( paper ).map( image => getAltAttribute( image ) );
|
|
20
|
-
|
|
21
|
-
const paperContent = [
|
|
22
|
-
paperText,
|
|
23
|
-
paper.getTitle(),
|
|
24
|
-
paper.getSlug(),
|
|
25
|
-
parseSlug( paper.getSlug() ),
|
|
26
|
-
paper.getDescription(),
|
|
27
|
-
altTagsInText.join( " " ),
|
|
28
|
-
].join( " " );
|
|
29
|
-
|
|
30
|
-
/*
|
|
31
|
-
* If hyphens should be treated as word boundaries, pass a custom word boundary regex string that includes whitespaces,
|
|
32
|
-
* hyphens (u002d), and en-dashes (u2013). Otherwise, pass a regex that includes only whitespaces and en-dashes.
|
|
33
|
-
*/
|
|
34
|
-
const words = areHyphensWordBoundaries ? getWords( paperContent, WORD_BOUNDARY_WITH_HYPHEN )
|
|
35
|
-
: getWords( paperContent, WORD_BOUNDARY_WITHOUT_HYPHEN );
|
|
36
|
-
|
|
37
|
-
return words.map(
|
|
38
|
-
word => normalizeSingle( escapeRegExp( word ) ) );
|
|
39
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks whether a word is matched with a regex.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} word The word to check.
|
|
5
|
-
* @param {string} regex The regex.
|
|
6
|
-
*
|
|
7
|
-
* @returns {boolean} Whether or not there was a match.
|
|
8
|
-
*/
|
|
9
|
-
export function doesWordMatchRegex( word, regex ) {
|
|
10
|
-
const regexObject = RegExp( regex );
|
|
11
|
-
return regexObject.test( word );
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Loops through a nested array with pairs of regexes and replacements, and performs the needed replacement if a match is found.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} word The word that may need to be modified.
|
|
18
|
-
* @param {[][]} groupOfRegexAndReplacements The array with the regexes and the required replacements.
|
|
19
|
-
*
|
|
20
|
-
* @returns {?string} The modified stem or null if no match was found.
|
|
21
|
-
*/
|
|
22
|
-
export function searchAndReplaceWithRegex( word, groupOfRegexAndReplacements ) {
|
|
23
|
-
for ( const regexAndReplacement of groupOfRegexAndReplacements ) {
|
|
24
|
-
if ( word.search( new RegExp( regexAndReplacement[ 0 ] ) ) !== -1 ) {
|
|
25
|
-
word = word.replace( new RegExp( regexAndReplacement[ 0 ] ), regexAndReplacement[ 1 ] );
|
|
26
|
-
return word;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Loops through a nested array of regexes and replacement pairs, and applies all replacements for which a match is found.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} word The word that may need to be modified.
|
|
35
|
-
* @param {[][]} listOfRegexAndReplacement The array with the regexes and the replacements.
|
|
36
|
-
*
|
|
37
|
-
* @returns {string} The modified word.
|
|
38
|
-
*/
|
|
39
|
-
export function applyAllReplacements( word, listOfRegexAndReplacement ) {
|
|
40
|
-
listOfRegexAndReplacement.forEach( function( setOfRegexAndReplacement ) {
|
|
41
|
-
word = word.replace( new RegExp( setOfRegexAndReplacement[ 0 ] ), setOfRegexAndReplacement[ 1 ] );
|
|
42
|
-
} );
|
|
43
|
-
return word;
|
|
44
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks whether the word starts with one of the words in a given list and ends in one of the suffixes
|
|
3
|
-
* in a given suffixes list. If so, deletes the suffix.
|
|
4
|
-
*
|
|
5
|
-
* @param {string[]} list The list of words to check against.
|
|
6
|
-
* @param {string[]} suffixes The suffixes that needs to be deleted.
|
|
7
|
-
* @param {string} word The word to check.
|
|
8
|
-
* @returns {string} The stemmed word.
|
|
9
|
-
*/
|
|
10
|
-
export function removeSuffixesFromFullForm( list, suffixes, word ) {
|
|
11
|
-
for ( let i = 0; i < list.length; i++ ) {
|
|
12
|
-
if ( word.startsWith( list[ i ] ) ) {
|
|
13
|
-
const suffixRetrieved = word.substring( list[ i ].length );
|
|
14
|
-
for ( let j = 0; j < suffixes.length; j++ ) {
|
|
15
|
-
if ( suffixes[ j ] === suffixRetrieved ) {
|
|
16
|
-
return word.slice( 0, -suffixRetrieved.length );
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Checks whether the word is in a given list of exceptions and if so, deletes a given suffix.
|
|
25
|
-
*
|
|
26
|
-
* @param {string[]} exceptions The exception list.
|
|
27
|
-
* @param {string} suffix The suffix that needs to be deleted.
|
|
28
|
-
* @param {string} word The word to check.
|
|
29
|
-
*
|
|
30
|
-
* @returns {string} The stemmed word.
|
|
31
|
-
*/
|
|
32
|
-
export function removeSuffixFromFullForm( exceptions, suffix, word ) {
|
|
33
|
-
for ( let i = 0; i < exceptions.length; i++ ) {
|
|
34
|
-
if ( word.endsWith( exceptions[ i ] ) ) {
|
|
35
|
-
return word.slice( 0, -suffix.length );
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An object containing the stem and the prefix.
|
|
3
|
-
*
|
|
4
|
-
* @typedef {Object} StemAndPrefixPair
|
|
5
|
-
* @property {string} stem The word without the basic prefixes.
|
|
6
|
-
* @property {string} prefix The prefix that was matched.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Strips function word prefixes from the word.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} word The word to strip the basic prefixes from.
|
|
13
|
-
* @param {RegExp} regex The regular expression to match the function word prefixes.
|
|
14
|
-
* @returns {StemAndPrefixPair} The word without the function word prefixes that was stripped,
|
|
15
|
-
* or the original word if the word is not prefixed.
|
|
16
|
-
*/
|
|
17
|
-
export function stemPrefixedFunctionWords( word, regex ) {
|
|
18
|
-
/*
|
|
19
|
-
* If a word starts with one of the prefixes, we strip it.
|
|
20
|
-
*/
|
|
21
|
-
let stemmedWord = word;
|
|
22
|
-
let prefix = "";
|
|
23
|
-
const isPrefixed = word.match( regex );
|
|
24
|
-
|
|
25
|
-
if ( isPrefixed ) {
|
|
26
|
-
prefix = isPrefixed[ 0 ];
|
|
27
|
-
stemmedWord = word.slice( prefix.length );
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return { stem: stemmedWord, prefix: prefix };
|
|
31
|
-
}
|
package/src/languageProcessing/helpers/passiveVoice/periphrastic/directPrecedenceException.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { includes } from "lodash";
|
|
2
|
-
import getWords from "../../word/getWords";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Checks whether the participle is directly preceded by a word from the direct precedence exception list.
|
|
6
|
-
* If this is the case, the clause is not passive.
|
|
7
|
-
*
|
|
8
|
-
* @param {string} clause The clause that contains the participle.
|
|
9
|
-
* @param {string} participle The participle.
|
|
10
|
-
* @param {Array} cannotDirectlyPrecedePassiveParticipleList List of words which cannot directly precede a passive participle.
|
|
11
|
-
*
|
|
12
|
-
* @returns {boolean} Returns true if a word from the direct precedence exception list is directly preceding
|
|
13
|
-
* the participle, otherwise returns false.
|
|
14
|
-
*/
|
|
15
|
-
export default function( clause, participle, cannotDirectlyPrecedePassiveParticipleList = [] ) {
|
|
16
|
-
// Break the sentence part up into words and convert to lower case.
|
|
17
|
-
const wordsInClause = getWords( clause ).map( word => word.toLowerCase() );
|
|
18
|
-
|
|
19
|
-
// Search the participle in the word list.
|
|
20
|
-
const participleIndex = wordsInClause.indexOf( participle.toLowerCase() );
|
|
21
|
-
|
|
22
|
-
/*
|
|
23
|
-
* There can be no exception in the following situations:
|
|
24
|
-
*
|
|
25
|
-
* -1 The participle is not found.
|
|
26
|
-
* 0 There is no word before the participle.
|
|
27
|
-
*/
|
|
28
|
-
if ( participleIndex < 1 ) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const wordPrecedingParticiple = wordsInClause[ participleIndex - 1 ];
|
|
33
|
-
|
|
34
|
-
// Check if the word preceding the participle is in the exceptions list.
|
|
35
|
-
return includes( cannotDirectlyPrecedePassiveParticipleList, wordPrecedingParticiple );
|
|
36
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { forEach, isEmpty, map } from "lodash";
|
|
2
|
-
|
|
3
|
-
import stripSpaces from "../../../sanitize/stripSpaces.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Strips spaces from the auxiliary matches.
|
|
7
|
-
*
|
|
8
|
-
* @param {Array} matches A list with matches of auxiliaries.
|
|
9
|
-
* @returns {Array} A list with matches with spaces removed.
|
|
10
|
-
*/
|
|
11
|
-
function sanitizeMatches( matches ) {
|
|
12
|
-
return map( matches, function( match ) {
|
|
13
|
-
return stripSpaces( match );
|
|
14
|
-
} );
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Splits sentences into clauses based on stopwords.
|
|
19
|
-
*
|
|
20
|
-
* @param {string} sentence The sentence to split.
|
|
21
|
-
* @param {Array} stopwords The array with matched stopwords.
|
|
22
|
-
*
|
|
23
|
-
* @returns {Array} The array with clauses.
|
|
24
|
-
*/
|
|
25
|
-
function splitOnStopWords( sentence, stopwords ) {
|
|
26
|
-
const clauses = [];
|
|
27
|
-
|
|
28
|
-
// Split the sentence on each found stopword and push this part in an array.
|
|
29
|
-
forEach( stopwords, function( stopword ) {
|
|
30
|
-
const clause = sentence.split( stopword );
|
|
31
|
-
if ( ! isEmpty( clause[ 0 ] ) ) {
|
|
32
|
-
clauses.push( clause[ 0 ] );
|
|
33
|
-
}
|
|
34
|
-
const startIndex = sentence.indexOf( stopword );
|
|
35
|
-
const endIndex = sentence.length;
|
|
36
|
-
sentence = stripSpaces( sentence.substring( startIndex, endIndex ) );
|
|
37
|
-
} );
|
|
38
|
-
|
|
39
|
-
// Push the remainder of the sentence in the clauses array.
|
|
40
|
-
clauses.push( sentence );
|
|
41
|
-
return clauses;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* Splits sentences into clauses based on stopCharacter.
|
|
47
|
-
*
|
|
48
|
-
* @param {string} sentence The sentence to split.
|
|
49
|
-
* @param {regex} stopCharacter The stop characters regex.
|
|
50
|
-
*
|
|
51
|
-
* @returns {Array} The array with clauses.
|
|
52
|
-
*/
|
|
53
|
-
function splitOnStopCharacter( sentence, stopCharacter ) {
|
|
54
|
-
const clauses = sentence.split( stopCharacter );
|
|
55
|
-
|
|
56
|
-
// Strip space in the beginning of the clause, if any.
|
|
57
|
-
for ( let i = 0; i < clauses.length; i++ ) {
|
|
58
|
-
if ( clauses[ i ][ 0 ] === " " ) {
|
|
59
|
-
clauses[ i ] = clauses[ i ].substring( 1, clauses[ i ].length );
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return clauses;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Creates clauses based on split sentences.
|
|
67
|
-
|
|
68
|
-
* @param {Array} clauses The array with clauses.
|
|
69
|
-
* @param {Object} options The language-specific regexes and Clause class.
|
|
70
|
-
*
|
|
71
|
-
* @returns {Array} The array with sentence parts.
|
|
72
|
-
*/
|
|
73
|
-
function createClauseObjects( clauses, options ) {
|
|
74
|
-
const clauseObjects = [];
|
|
75
|
-
forEach( clauses, function( clause ) {
|
|
76
|
-
const foundAuxiliaries = sanitizeMatches( clause.match( options.regexes.auxiliaryRegex || [] ) );
|
|
77
|
-
// If a clause doesn't have an auxiliary, we don't need it, so it can be filtered out.
|
|
78
|
-
if ( foundAuxiliaries.length !== 0 ) {
|
|
79
|
-
clauseObjects.push( new options.Clause( clause, foundAuxiliaries ) );
|
|
80
|
-
}
|
|
81
|
-
} );
|
|
82
|
-
return clauseObjects;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Splits the sentence into clauses based on stopwords.
|
|
87
|
-
*
|
|
88
|
-
* @param {string} sentence The text to split into clauses.
|
|
89
|
-
* @param {Object} options The language-specific regexes and Clause class.
|
|
90
|
-
*
|
|
91
|
-
* @returns {Array} The array with clauses.
|
|
92
|
-
*/
|
|
93
|
-
function getClausesSplitOnStopWords( sentence, options ) {
|
|
94
|
-
const auxiliaryRegex = options.regexes.auxiliaryRegex;
|
|
95
|
-
// First check if there is an auxiliary in the sentence.
|
|
96
|
-
if ( sentence.match( auxiliaryRegex ) === null ) {
|
|
97
|
-
return [];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
let clauses;
|
|
101
|
-
const stopwords = sentence.match( options.regexes.stopwordRegex ) || [];
|
|
102
|
-
// Split sentences based on stop words
|
|
103
|
-
clauses = splitOnStopWords( sentence, stopwords );
|
|
104
|
-
|
|
105
|
-
// Split sentences based on stop characters, only if the regex is available and if the sentence is not yet split from the previous check
|
|
106
|
-
if ( typeof( options.regexes.stopCharacterRegex ) !== "undefined" && clauses.length === 1 ) {
|
|
107
|
-
clauses = splitOnStopCharacter( sentence, options.regexes.stopCharacterRegex );
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return createClauseObjects( clauses, options );
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export default getClausesSplitOnStopWords;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { uniq } from "lodash";
|
|
2
|
-
|
|
3
|
-
import arrayToRegex from "../../../regex/createRegexFromArray.js";
|
|
4
|
-
import getWordIndices from "../getIndicesWithRegex.js";
|
|
5
|
-
|
|
6
|
-
import { getIndicesByWordListSorted } from "../../../word/indices.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Checks whether there are any exception words in between the auxiliary and participle. If there are, it doesn't return a passive.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} clause The clause that contains the participle.
|
|
12
|
-
* @param {string} participle The participle in the clause.
|
|
13
|
-
* @param {string[]} auxiliaries One or more auxiliaries in the clause.
|
|
14
|
-
* @param {string[]} cannotBeBetweenPassiveAuxiliaryAndParticiple The list of words that cannot be between the auxiliary and participle.
|
|
15
|
-
*
|
|
16
|
-
* @returns {boolean} Returns true if a word from the 'cannot be between passive auxiliary and participle' exception list
|
|
17
|
-
* appears anywhere in between the last (closest to participle) auxiliary and the participle.
|
|
18
|
-
*/
|
|
19
|
-
export default function( clause, participle, auxiliaries, cannotBeBetweenPassiveAuxiliaryAndParticiple ) {
|
|
20
|
-
const auxiliariesUnique = uniq( auxiliaries );
|
|
21
|
-
|
|
22
|
-
const auxiliaryIndices = getIndicesByWordListSorted( auxiliariesUnique, clause );
|
|
23
|
-
|
|
24
|
-
const participleIndex = clause.indexOf( participle );
|
|
25
|
-
const nonDirectParticiplePrecendenceExceptionRegex = arrayToRegex( cannotBeBetweenPassiveAuxiliaryAndParticiple );
|
|
26
|
-
|
|
27
|
-
// This exception is only applicable for passive constructions in which the auxiliary precedes the participle.
|
|
28
|
-
const matches = auxiliaryIndices.filter( auxiliaryIndex => auxiliaryIndex.index < participleIndex );
|
|
29
|
-
|
|
30
|
-
// If there are no auxiliaries before the participle, this exception is not applicable.
|
|
31
|
-
if ( matches.length === 0 ) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// We pick the auxiliary closest to the participle, since that is most likely the one belonging to the participle.
|
|
36
|
-
const participleAuxiliary = matches[ matches.length - 1 ];
|
|
37
|
-
|
|
38
|
-
const precedenceExceptionIndices = getWordIndices( clause, nonDirectParticiplePrecendenceExceptionRegex );
|
|
39
|
-
|
|
40
|
-
// Check whether there are any precendence words between the auxiliary and the participle.
|
|
41
|
-
const remainingPrecedenceExceptionIndices = precedenceExceptionIndices.filter( precedenceExceptionIndex =>
|
|
42
|
-
( precedenceExceptionIndex.index > participleAuxiliary.index && precedenceExceptionIndex.index < participleIndex ) );
|
|
43
|
-
|
|
44
|
-
return remainingPrecedenceExceptionIndices.length > 0;
|
|
45
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { getIndicesByWordList as getIndicesOfList, filterIndices, sortIndices } from "../../word/indices";
|
|
2
|
-
import stripSpaces from "../../sanitize/stripSpaces.js";
|
|
3
|
-
import { normalizeSingle as normalizeSingleQuotes } from "../../sanitize/quotes.js";
|
|
4
|
-
import getWordIndices from "./getIndicesWithRegex.js";
|
|
5
|
-
import includesIndex from "../../word/includesIndex";
|
|
6
|
-
import followsIndex from "../../word/followsIndex";
|
|
7
|
-
|
|
8
|
-
import { forEach, isUndefined, map } from "lodash";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Gets stop characters to determine sentence breakers.
|
|
12
|
-
*
|
|
13
|
-
* @param {string} sentence The sentence to get the stop characters from.
|
|
14
|
-
* @param {RegExp} stopCharacterRegex Regex to match the stop characters.
|
|
15
|
-
*
|
|
16
|
-
* @returns {Array} The array with stop characters.
|
|
17
|
-
*/
|
|
18
|
-
const getStopCharacters = function( sentence, stopCharacterRegex ) {
|
|
19
|
-
let match;
|
|
20
|
-
const matches = [];
|
|
21
|
-
|
|
22
|
-
stopCharacterRegex.lastIndex = 0;
|
|
23
|
-
|
|
24
|
-
while ( ( match = stopCharacterRegex.exec( sentence ) ) !== null ) {
|
|
25
|
-
matches.push(
|
|
26
|
-
{
|
|
27
|
-
index: match.index,
|
|
28
|
-
match: match[ 0 ],
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
return matches;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Filters auxiliaries preceded by a reflexive pronoun.
|
|
37
|
-
*
|
|
38
|
-
* @param {string} text The text part in which to check.
|
|
39
|
-
* @param {Array} auxiliaryMatches The auxiliary matches for which to check.
|
|
40
|
-
* @param {RegExp} directPrecedenceExceptionRegex The regex needed to find the right auxiliaries.
|
|
41
|
-
*
|
|
42
|
-
* @returns {Array} The filtered list of auxiliary indices.
|
|
43
|
-
*/
|
|
44
|
-
const auxiliaryPrecedenceExceptionFilter = function( text, auxiliaryMatches, directPrecedenceExceptionRegex ) {
|
|
45
|
-
const directPrecedenceExceptionMatches = getWordIndices( text, directPrecedenceExceptionRegex );
|
|
46
|
-
|
|
47
|
-
forEach( auxiliaryMatches, function( auxiliaryMatch ) {
|
|
48
|
-
if ( includesIndex( directPrecedenceExceptionMatches, auxiliaryMatch.index ) ) {
|
|
49
|
-
auxiliaryMatches = auxiliaryMatches.filter( function( auxiliaryObject ) {
|
|
50
|
-
return auxiliaryObject.index !== auxiliaryMatch.index;
|
|
51
|
-
} );
|
|
52
|
-
}
|
|
53
|
-
} );
|
|
54
|
-
|
|
55
|
-
return auxiliaryMatches;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Filters auxiliaries followed by a word on the followingAuxiliaryExceptionWords list.
|
|
60
|
-
*
|
|
61
|
-
* @param {string} text The text part in which to check.
|
|
62
|
-
* @param {Array} auxiliaryMatches The auxiliary matches for which to check.
|
|
63
|
-
* @param {RegExp} followingAuxiliaryExceptionRegex The regex needed to find the right auxiliaries.
|
|
64
|
-
*
|
|
65
|
-
* @returns {Array} The filtered list of auxiliary indices.
|
|
66
|
-
*/
|
|
67
|
-
const followingAuxiliaryExceptionFilter = function( text, auxiliaryMatches, followingAuxiliaryExceptionRegex ) {
|
|
68
|
-
const followingAuxiliaryExceptionMatches = getWordIndices( text, followingAuxiliaryExceptionRegex );
|
|
69
|
-
|
|
70
|
-
forEach( auxiliaryMatches, function( auxiliaryMatch ) {
|
|
71
|
-
if ( followsIndex( followingAuxiliaryExceptionMatches, auxiliaryMatch ) ) {
|
|
72
|
-
auxiliaryMatches = auxiliaryMatches.filter( function( auxiliaryObject ) {
|
|
73
|
-
return auxiliaryObject.index !== auxiliaryMatch.index;
|
|
74
|
-
} );
|
|
75
|
-
}
|
|
76
|
-
} );
|
|
77
|
-
|
|
78
|
-
return auxiliaryMatches;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Filters auxiliaries preceded by an elided word (e.g., s') on the elisionAuxiliaryExceptionWords list.
|
|
83
|
-
*
|
|
84
|
-
* @param {string} text The text part in which to check.
|
|
85
|
-
* @param {Array} auxiliaryMatches The auxiliary matches for which to check.
|
|
86
|
-
* @param {RegExp} elisionAuxiliaryExceptionRegex Regex to match the elisionAuxiliary exception.
|
|
87
|
-
*
|
|
88
|
-
* @returns {Array} The filtered list of auxiliary indices.
|
|
89
|
-
*/
|
|
90
|
-
const elisionAuxiliaryExceptionFilter = function( text, auxiliaryMatches, elisionAuxiliaryExceptionRegex ) {
|
|
91
|
-
const elisionAuxiliaryExceptionMatches = getWordIndices( text, elisionAuxiliaryExceptionRegex );
|
|
92
|
-
|
|
93
|
-
forEach( auxiliaryMatches, function( auxiliaryMatch ) {
|
|
94
|
-
if ( includesIndex( elisionAuxiliaryExceptionMatches, auxiliaryMatch.index, false ) ) {
|
|
95
|
-
auxiliaryMatches = auxiliaryMatches.filter( function( auxiliaryObject ) {
|
|
96
|
-
return auxiliaryObject.index !== auxiliaryMatch.index;
|
|
97
|
-
} );
|
|
98
|
-
}
|
|
99
|
-
} );
|
|
100
|
-
|
|
101
|
-
return auxiliaryMatches;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Gets the indices of sentence breakers (auxiliaries, stopwords and stop characters;
|
|
106
|
-
* in English also active verbs) to determine clauses.
|
|
107
|
-
* Indices are filtered because there could be duplicate matches, like "even though" and "though".
|
|
108
|
-
* In addition, 'having' will be matched both as a -ing verb as well as an auxiliary.
|
|
109
|
-
*
|
|
110
|
-
* @param {string} sentence The sentence to check for indices of sentence breakers.
|
|
111
|
-
* @param {Object} options The language options for which to match the sentence breakers.
|
|
112
|
-
*
|
|
113
|
-
* @returns {Array} The array with valid indices to use for determining clauses.
|
|
114
|
-
*/
|
|
115
|
-
const getSentenceBreakers = function( sentence, options ) {
|
|
116
|
-
sentence = sentence.toLocaleLowerCase();
|
|
117
|
-
const { regexes } = options;
|
|
118
|
-
let auxiliaryIndices = getIndicesOfList( options.auxiliaries, sentence );
|
|
119
|
-
const stopCharacterIndices = getStopCharacters( sentence, regexes.stopCharacterRegex );
|
|
120
|
-
let stopwordIndices = getIndicesOfList( options.stopwords, sentence );
|
|
121
|
-
|
|
122
|
-
// Check in options if there are other stopword indices created based on language-specific rules.
|
|
123
|
-
if ( options.otherStopWordIndices && options.otherStopWordIndices.length > 0 ) {
|
|
124
|
-
stopwordIndices = stopwordIndices.concat( options.otherStopWordIndices );
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if ( typeof regexes.directPrecedenceExceptionRegex !== "undefined" ) {
|
|
128
|
-
// Filters auxiliaries matched in the sentence based on a precedence exception filter.
|
|
129
|
-
auxiliaryIndices = auxiliaryPrecedenceExceptionFilter( sentence, auxiliaryIndices, regexes.directPrecedenceExceptionRegex );
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if ( typeof regexes.elisionAuxiliaryExceptionRegex !== "undefined" ) {
|
|
133
|
-
// Filters auxiliaries matched in the sentence based on a elision exception filter.
|
|
134
|
-
auxiliaryIndices = elisionAuxiliaryExceptionFilter( sentence, auxiliaryIndices, regexes.elisionAuxiliaryExceptionRegex );
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
let totalIndices = auxiliaryIndices.concat( stopwordIndices, stopCharacterIndices );
|
|
138
|
-
|
|
139
|
-
totalIndices = filterIndices( totalIndices );
|
|
140
|
-
|
|
141
|
-
return sortIndices( totalIndices );
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Gets the auxiliaries from a sentence.
|
|
146
|
-
*
|
|
147
|
-
* @param {string} sentencePart The part of the sentence to match for auxiliaries.
|
|
148
|
-
* @param {object} regexes The regexes needed to find the auxiliaries.
|
|
149
|
-
*
|
|
150
|
-
* @returns {Array} All formatted matches from the sentence part.
|
|
151
|
-
*/
|
|
152
|
-
const getAuxiliaryMatches = function( sentencePart, regexes ) {
|
|
153
|
-
const { auxiliaryRegex, directPrecedenceExceptionRegex, followingAuxiliaryExceptionRegex } = regexes;
|
|
154
|
-
let auxiliaryMatches = sentencePart.match( auxiliaryRegex ) || [];
|
|
155
|
-
|
|
156
|
-
if ( typeof directPrecedenceExceptionRegex !== "undefined" || typeof followingAuxiliaryExceptionRegex !== "undefined" ) {
|
|
157
|
-
// An array with the matched auxiliaries and their indices.
|
|
158
|
-
let auxiliaryMatchIndices = getIndicesOfList( auxiliaryMatches, sentencePart );
|
|
159
|
-
|
|
160
|
-
if ( typeof directPrecedenceExceptionRegex !== "undefined" ) {
|
|
161
|
-
// Filters auxiliaries matched in the sentence part based on a precedence exception filter.
|
|
162
|
-
auxiliaryMatchIndices = auxiliaryPrecedenceExceptionFilter( sentencePart, auxiliaryMatchIndices, directPrecedenceExceptionRegex );
|
|
163
|
-
}
|
|
164
|
-
// Filters auxiliaries matched in the sentence part based on a exception filter for words following the auxiliary.
|
|
165
|
-
auxiliaryMatchIndices = followingAuxiliaryExceptionFilter( sentencePart, auxiliaryMatchIndices, followingAuxiliaryExceptionRegex );
|
|
166
|
-
|
|
167
|
-
// An array with the matched auxiliary verbs (without indices).
|
|
168
|
-
auxiliaryMatches = [];
|
|
169
|
-
|
|
170
|
-
forEach( auxiliaryMatchIndices, function( auxiliaryMatchIndex ) {
|
|
171
|
-
auxiliaryMatches.push( auxiliaryMatchIndex.match );
|
|
172
|
-
} );
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return map( auxiliaryMatches, function( auxiliaryMatch ) {
|
|
176
|
-
return stripSpaces( auxiliaryMatch );
|
|
177
|
-
} );
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Gets the clauses from a sentence by determining sentence breakers.
|
|
182
|
-
*
|
|
183
|
-
* @param {string} sentence The sentence to split up into clauses.
|
|
184
|
-
* @param {object} options The language options for which to get the clauses.
|
|
185
|
-
*
|
|
186
|
-
* @returns {Array} The array with all clauses that have an auxiliary.
|
|
187
|
-
*/
|
|
188
|
-
const getClauses = function( sentence, options ) {
|
|
189
|
-
const clauses = [];
|
|
190
|
-
const auxiliaryRegex = options.regexes.auxiliaryRegex;
|
|
191
|
-
|
|
192
|
-
sentence = normalizeSingleQuotes( sentence );
|
|
193
|
-
|
|
194
|
-
// First check if there is an auxiliary in the sentence.
|
|
195
|
-
if ( sentence.match( auxiliaryRegex ) === null ) {
|
|
196
|
-
return clauses;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const indices = getSentenceBreakers( sentence, options );
|
|
200
|
-
// Get the words after the found auxiliary.
|
|
201
|
-
for ( let i = 0; i < indices.length; i++ ) {
|
|
202
|
-
let endIndex = sentence.length;
|
|
203
|
-
if ( ! isUndefined( indices[ i + 1 ] ) ) {
|
|
204
|
-
endIndex = indices[ i + 1 ].index;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Cut the sentence from the current index to the endIndex (start of next breaker, of end of sentence).
|
|
208
|
-
const clause = stripSpaces( sentence.substring( indices[ i ].index, endIndex ) );
|
|
209
|
-
|
|
210
|
-
const auxiliaryMatches = getAuxiliaryMatches( clause, options.regexes );
|
|
211
|
-
// If a clause doesn't have an auxiliary, we don't need it, so it can be filtered out.
|
|
212
|
-
if ( auxiliaryMatches.length !== 0 ) {
|
|
213
|
-
const foundClause = new options.Clause( clause, auxiliaryMatches );
|
|
214
|
-
clauses.push( foundClause );
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return clauses;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Split the sentence into clauses based on auxiliaries.
|
|
223
|
-
*
|
|
224
|
-
* @param {string} sentence The sentence to split in parts.
|
|
225
|
-
* @param {Object} options The language options for which to get the clauses.
|
|
226
|
-
*
|
|
227
|
-
* @returns {Array} A list with clauses.
|
|
228
|
-
*/
|
|
229
|
-
export default function( sentence, options ) {
|
|
230
|
-
return getClauses( sentence, options );
|
|
231
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Matches words from a list in sentence parts and returns them and their indices.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} sentencePart The sentence part to match the words in.
|
|
5
|
-
* @param {RegExp} regex The regex used for matching.
|
|
6
|
-
* @returns {Array} The list of result objects.
|
|
7
|
-
*/
|
|
8
|
-
export default function( sentencePart, regex ) {
|
|
9
|
-
const results = [];
|
|
10
|
-
/* Decided to use a for loop here so that we could retrieve all matches while keeping result objects intact.
|
|
11
|
-
For every match there is in the sentence part, an object with the match and its index will be pushed into
|
|
12
|
-
the results array. */
|
|
13
|
-
for ( let match = regex.exec( sentencePart ); match !== null; match = regex.exec( sentencePart ) ) {
|
|
14
|
-
results.push( {
|
|
15
|
-
match: match[ 0 ],
|
|
16
|
-
index: match.index,
|
|
17
|
-
} );
|
|
18
|
-
}
|
|
19
|
-
return results;
|
|
20
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { flattenDeep } from "lodash";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns words that have been determined to be a regular participle.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} word The word to check.
|
|
7
|
-
* @param {RegExp[]} regexes The regular participle regexes to match.
|
|
8
|
-
*
|
|
9
|
-
* @returns {Array} A list with the matches.
|
|
10
|
-
*/
|
|
11
|
-
export default function regularParticiples( word, regexes ) {
|
|
12
|
-
// Matches word with language-specific participle regexes.
|
|
13
|
-
let matches = [];
|
|
14
|
-
|
|
15
|
-
regexes.forEach( function( regex ) {
|
|
16
|
-
const match = word.match( regex );
|
|
17
|
-
if ( match !== null ) {
|
|
18
|
-
matches.push( match );
|
|
19
|
-
}
|
|
20
|
-
} );
|
|
21
|
-
matches = flattenDeep( matches );
|
|
22
|
-
return matches;
|
|
23
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { includes } from "lodash";
|
|
2
|
-
import getWords from "../../word/getWords";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Checks whether a word from the precedence exception list occurs anywhere in the clause before the participle.
|
|
6
|
-
* If this is the case, the sentence part is not passive.
|
|
7
|
-
*
|
|
8
|
-
* @param {string} clause The clause that contains the participle.
|
|
9
|
-
* @param {string} participle The participle.
|
|
10
|
-
* @param {Array} cannotBeBetweenPassiveAuxiliaryAndParticipleList List of words which cannot be between auxiliary and participle.
|
|
11
|
-
*
|
|
12
|
-
* @returns {boolean} Returns true if a word from the precedence exception list occurs anywhere in the
|
|
13
|
-
* sentence part before the participle, otherwise returns false.
|
|
14
|
-
*/
|
|
15
|
-
export default function( clause, participle, cannotBeBetweenPassiveAuxiliaryAndParticipleList = [] ) {
|
|
16
|
-
// Break the sentence part up into words and convert to lower case.
|
|
17
|
-
const wordsInClause = getWords( clause ).map( word => word.toLowerCase() );
|
|
18
|
-
|
|
19
|
-
// Search the participle in the word list.
|
|
20
|
-
const participleIndex = wordsInClause.indexOf( participle.toLowerCase() );
|
|
21
|
-
|
|
22
|
-
/*
|
|
23
|
-
* There can be no exception in the following situations:
|
|
24
|
-
*
|
|
25
|
-
* -1 The participle is not found.
|
|
26
|
-
* 0 There is no word before the participle.
|
|
27
|
-
*/
|
|
28
|
-
if ( participleIndex < 1 ) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Check if the words preceding the participle are in the exceptions list.
|
|
33
|
-
for ( let i = 0; i < participleIndex; i++ ) {
|
|
34
|
-
if ( includes( cannotBeBetweenPassiveAuxiliaryAndParticipleList, wordsInClause[ i ] ) ) {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return false;
|
|
40
|
-
}
|