axyseo 2.0.0-alpha.2 → 2.1.0
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/build/config/diacritics.js +1 -7
- package/build/config/diacritics.js.map +1 -1
- package/build/config/getTransliterations.js +6 -14
- package/build/config/getTransliterations.js.map +1 -1
- package/build/config/transliterationsWPstyle.js +5 -12
- package/build/config/transliterationsWPstyle.js.map +1 -1
- package/build/config/wordBoundaries.js +1 -7
- package/build/config/wordBoundaries.js.map +1 -1
- package/build/config/wordBoundariesWithoutPunctuation.js +2 -8
- package/build/config/wordBoundariesWithoutPunctuation.js.map +1 -1
- package/build/const/analysis.js +32 -11
- package/build/const/analysis.js.map +1 -1
- package/build/errors/invalidType.js +1 -8
- package/build/errors/invalidType.js.map +1 -1
- package/build/errors/missingArgument.js +1 -8
- package/build/errors/missingArgument.js.map +1 -1
- package/build/helpers/createMeasurementElement.js +1 -8
- package/build/helpers/createMeasurementElement.js.map +1 -1
- package/build/helpers/domManipulation.js +3 -8
- package/build/helpers/domManipulation.js.map +1 -1
- package/build/helpers/errors.js +5 -10
- package/build/helpers/errors.js.map +1 -1
- package/build/helpers/factory.js +7 -13
- package/build/helpers/factory.js.map +1 -1
- package/build/helpers/formatNumber.js +1 -7
- package/build/helpers/formatNumber.js.map +1 -1
- package/build/helpers/formatString.js +4 -9
- package/build/helpers/formatString.js.map +1 -1
- package/build/helpers/getLanguagesWithWordComplexity.js +1 -7
- package/build/helpers/getLanguagesWithWordComplexity.js.map +1 -1
- package/build/helpers/getLanguagesWithWordFormSupport.js +1 -7
- package/build/helpers/getLanguagesWithWordFormSupport.js.map +1 -1
- package/build/helpers/getWordComplexityConfig.js +9 -15
- package/build/helpers/getWordComplexityConfig.js.map +1 -1
- package/build/helpers/getWordComplexityHelper.js +9 -15
- package/build/helpers/getWordComplexityHelper.js.map +1 -1
- package/build/helpers/htmlEntities.js +6 -11
- package/build/helpers/htmlEntities.js.map +1 -1
- package/build/helpers/includesAny.js +3 -8
- package/build/helpers/includesAny.js.map +1 -1
- package/build/helpers/index.js +30 -72
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/shortlinker/Shortlinker.js +1 -8
- package/build/helpers/shortlinker/Shortlinker.js.map +1 -1
- package/build/helpers/shortlinker/index.js +1 -16
- package/build/helpers/shortlinker/index.js.map +1 -1
- package/build/helpers/shortlinker/singleton.js +5 -13
- package/build/helpers/shortlinker/singleton.js.map +1 -1
- package/build/helpers/types.js +2 -9
- package/build/helpers/types.js.map +1 -1
- package/build/index.js +25 -87
- package/build/index.js.map +1 -1
- package/build/languageProcessing/AbstractResearcher.js +88 -95
- package/build/languageProcessing/AbstractResearcher.js.map +1 -1
- package/build/languageProcessing/helpers/highlighting/getMarkingsInSentence.js +3 -10
- package/build/languageProcessing/helpers/highlighting/getMarkingsInSentence.js.map +1 -1
- package/build/languageProcessing/helpers/html/getFieldsToMark.js +6 -11
- package/build/languageProcessing/helpers/html/getFieldsToMark.js.map +1 -1
- package/build/languageProcessing/helpers/html/getSubheadingTexts.js +3 -8
- package/build/languageProcessing/helpers/html/getSubheadingTexts.js.map +1 -1
- package/build/languageProcessing/helpers/html/getSubheadings.js +2 -12
- package/build/languageProcessing/helpers/html/getSubheadings.js.map +1 -1
- package/build/languageProcessing/helpers/html/html.js +9 -17
- package/build/languageProcessing/helpers/html/html.js.map +1 -1
- package/build/languageProcessing/helpers/html/htmlParser.js +3 -10
- package/build/languageProcessing/helpers/html/htmlParser.js.map +1 -1
- package/build/languageProcessing/helpers/html/matchParagraphs.js +7 -12
- package/build/languageProcessing/helpers/html/matchParagraphs.js.map +1 -1
- package/build/languageProcessing/helpers/html/normalizeHTML.js +4 -10
- package/build/languageProcessing/helpers/html/normalizeHTML.js.map +1 -1
- package/build/languageProcessing/helpers/image/getAltAttribute.js +3 -9
- package/build/languageProcessing/helpers/image/getAltAttribute.js.map +1 -1
- package/build/languageProcessing/helpers/image/getImagesInTree.js +1 -7
- package/build/languageProcessing/helpers/image/getImagesInTree.js.map +1 -1
- package/build/languageProcessing/helpers/image/imageInText.js +5 -12
- package/build/languageProcessing/helpers/image/imageInText.js.map +1 -1
- package/build/languageProcessing/helpers/index.js +5 -40
- package/build/languageProcessing/helpers/index.js.map +1 -1
- package/build/languageProcessing/helpers/language/getLanguage.js +1 -7
- package/build/languageProcessing/helpers/language/getLanguage.js.map +1 -1
- package/build/languageProcessing/helpers/link/checkNofollow.js +3 -10
- package/build/languageProcessing/helpers/link/checkNofollow.js.map +1 -1
- package/build/languageProcessing/helpers/link/getAnchorsFromText.js +1 -7
- package/build/languageProcessing/helpers/link/getAnchorsFromText.js.map +1 -1
- package/build/languageProcessing/helpers/link/getLinkType.js +7 -13
- package/build/languageProcessing/helpers/link/getLinkType.js.map +1 -1
- package/build/languageProcessing/helpers/match/findKeywordFormsInString.js +10 -17
- package/build/languageProcessing/helpers/match/findKeywordFormsInString.js.map +1 -1
- package/build/languageProcessing/helpers/match/isDoubleQuoted.js +4 -10
- package/build/languageProcessing/helpers/match/isDoubleQuoted.js.map +1 -1
- package/build/languageProcessing/helpers/match/matchTextWithArray.js +6 -12
- package/build/languageProcessing/helpers/match/matchTextWithArray.js.map +1 -1
- package/build/languageProcessing/helpers/match/matchTextWithTransliteration.js +16 -22
- package/build/languageProcessing/helpers/match/matchTextWithTransliteration.js.map +1 -1
- package/build/languageProcessing/helpers/match/matchTextWithWord.js +17 -23
- package/build/languageProcessing/helpers/match/matchTextWithWord.js.map +1 -1
- package/build/languageProcessing/helpers/match/matchWordFormsWithSentence.js +7 -15
- package/build/languageProcessing/helpers/match/matchWordFormsWithSentence.js.map +1 -1
- package/build/languageProcessing/helpers/match/processExactMatchRequest.js +3 -9
- package/build/languageProcessing/helpers/match/processExactMatchRequest.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/baseStemmer.js +1 -7
- package/build/languageProcessing/helpers/morphology/baseStemmer.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/buildFormRule.js +1 -7
- package/build/languageProcessing/helpers/morphology/buildFormRule.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/buildTopicStems.js +13 -23
- package/build/languageProcessing/helpers/morphology/buildTopicStems.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/createRulesFromArrays.js +2 -9
- package/build/languageProcessing/helpers/morphology/createRulesFromArrays.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/exceptionListHelpers.js +5 -13
- package/build/languageProcessing/helpers/morphology/exceptionListHelpers.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/findMatchingEndingInArray.js +1 -7
- package/build/languageProcessing/helpers/morphology/findMatchingEndingInArray.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/flattenSortLength.js +3 -8
- package/build/languageProcessing/helpers/morphology/flattenSortLength.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/getAllWordsFromPaper.js +12 -18
- package/build/languageProcessing/helpers/morphology/getAllWordsFromPaper.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/regexHelpers.js +3 -11
- package/build/languageProcessing/helpers/morphology/regexHelpers.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/stemHelpers.js +2 -9
- package/build/languageProcessing/helpers/morphology/stemHelpers.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/stemPrefixedFunctionWords.js +1 -7
- package/build/languageProcessing/helpers/morphology/stemPrefixedFunctionWords.js.map +1 -1
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/directPrecedenceException.js +5 -11
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/directPrecedenceException.js.map +1 -1
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/getClausesSplitOnStopWords.js +9 -15
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/getClausesSplitOnStopWords.js.map +1 -1
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/nonDirectParticiplePrecedenceException.js +9 -15
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/nonDirectParticiplePrecedenceException.js.map +1 -1
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/getClauses.js +28 -34
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/getClauses.js.map +1 -1
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/getIndicesWithRegex.js +1 -7
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/getIndicesWithRegex.js.map +1 -1
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/matchRegularParticiples.js +3 -8
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/matchRegularParticiples.js.map +1 -1
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/precedenceException.js +5 -11
- package/build/languageProcessing/helpers/passiveVoice/periphrastic/precedenceException.js.map +1 -1
- package/build/languageProcessing/helpers/prominentWords/determineProminentWords.js +16 -28
- package/build/languageProcessing/helpers/prominentWords/determineProminentWords.js.map +1 -1
- package/build/languageProcessing/helpers/regex/createRegexFromArray.js +10 -16
- package/build/languageProcessing/helpers/regex/createRegexFromArray.js.map +1 -1
- package/build/languageProcessing/helpers/regex/createRegexFromDoubleArray.js +4 -10
- package/build/languageProcessing/helpers/regex/createRegexFromDoubleArray.js.map +1 -1
- package/build/languageProcessing/helpers/regex/createWordRegex.js +12 -18
- package/build/languageProcessing/helpers/regex/createWordRegex.js.map +1 -1
- package/build/languageProcessing/helpers/regex/matchStringWithRegex.js +1 -7
- package/build/languageProcessing/helpers/regex/matchStringWithRegex.js.map +1 -1
- package/build/languageProcessing/helpers/regex/searchAndReplaceWithOneRegex.js +1 -7
- package/build/languageProcessing/helpers/regex/searchAndReplaceWithOneRegex.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/doubleQuotes.js +1 -7
- package/build/languageProcessing/helpers/sanitize/doubleQuotes.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/filterShortcodesFromTree.js +3 -11
- package/build/languageProcessing/helpers/sanitize/filterShortcodesFromTree.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/mergeListItems.js +1 -7
- package/build/languageProcessing/helpers/sanitize/mergeListItems.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/parseSynonyms.js +5 -11
- package/build/languageProcessing/helpers/sanitize/parseSynonyms.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/quotes.js +4 -12
- package/build/languageProcessing/helpers/sanitize/quotes.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/removeEmailAddresses.js +1 -7
- package/build/languageProcessing/helpers/sanitize/removeEmailAddresses.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/removePunctuation.js +7 -13
- package/build/languageProcessing/helpers/sanitize/removePunctuation.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/removePunctuationExceptQuotes.js +1 -7
- package/build/languageProcessing/helpers/sanitize/removePunctuationExceptQuotes.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/removeSentenceTerminators.js +1 -7
- package/build/languageProcessing/helpers/sanitize/removeSentenceTerminators.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/removeURLs.js +1 -7
- package/build/languageProcessing/helpers/sanitize/removeURLs.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/sanitizeLineBreakTag.js +1 -7
- package/build/languageProcessing/helpers/sanitize/sanitizeLineBreakTag.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/sanitizeString.js +5 -10
- package/build/languageProcessing/helpers/sanitize/sanitizeString.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/stripHTMLTags.js +7 -16
- package/build/languageProcessing/helpers/sanitize/stripHTMLTags.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/stripNonTextTags.js +4 -10
- package/build/languageProcessing/helpers/sanitize/stripNonTextTags.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/stripNumbers.js +4 -10
- package/build/languageProcessing/helpers/sanitize/stripNumbers.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/stripSpaces.js +1 -7
- package/build/languageProcessing/helpers/sanitize/stripSpaces.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/stripWordBoundaries.js +2 -10
- package/build/languageProcessing/helpers/sanitize/stripWordBoundaries.js.map +1 -1
- package/build/languageProcessing/helpers/sanitize/unifyWhitespace.js +2 -11
- package/build/languageProcessing/helpers/sanitize/unifyWhitespace.js.map +1 -1
- package/build/languageProcessing/helpers/sentence/SentenceTokenizer.js +22 -29
- package/build/languageProcessing/helpers/sentence/SentenceTokenizer.js.map +1 -1
- package/build/languageProcessing/helpers/sentence/countSentences.js +4 -10
- package/build/languageProcessing/helpers/sentence/countSentences.js.map +1 -1
- package/build/languageProcessing/helpers/sentence/getSentences.js +13 -20
- package/build/languageProcessing/helpers/sentence/getSentences.js.map +1 -1
- package/build/languageProcessing/helpers/sentence/getSentencesFromTree.js +2 -9
- package/build/languageProcessing/helpers/sentence/getSentencesFromTree.js.map +1 -1
- package/build/languageProcessing/helpers/sentence/memoizedSentenceTokenizer.js +4 -10
- package/build/languageProcessing/helpers/sentence/memoizedSentenceTokenizer.js.map +1 -1
- package/build/languageProcessing/helpers/sentence/sentencesLength.js +7 -13
- package/build/languageProcessing/helpers/sentence/sentencesLength.js.map +1 -1
- package/build/languageProcessing/helpers/syllables/DeviationFragment.js +5 -11
- package/build/languageProcessing/helpers/syllables/DeviationFragment.js.map +1 -1
- package/build/languageProcessing/helpers/syllables/countSyllables.js +23 -30
- package/build/languageProcessing/helpers/syllables/countSyllables.js.map +1 -1
- package/build/languageProcessing/helpers/syllables/syllableCountIterator.js +7 -14
- package/build/languageProcessing/helpers/syllables/syllableCountIterator.js.map +1 -1
- package/build/languageProcessing/helpers/syllables/syllableCountStep.js +5 -12
- package/build/languageProcessing/helpers/syllables/syllableCountStep.js.map +1 -1
- package/build/languageProcessing/helpers/transform/transformWordsWithHyphens.js +1 -7
- package/build/languageProcessing/helpers/transform/transformWordsWithHyphens.js.map +1 -1
- package/build/languageProcessing/helpers/transliterate/replaceDiacritics.js +4 -10
- package/build/languageProcessing/helpers/transliterate/replaceDiacritics.js.map +1 -1
- package/build/languageProcessing/helpers/transliterate/specialCharacterMappings.js +12 -23
- package/build/languageProcessing/helpers/transliterate/specialCharacterMappings.js.map +1 -1
- package/build/languageProcessing/helpers/transliterate/transliterate.js +3 -9
- package/build/languageProcessing/helpers/transliterate/transliterate.js.map +1 -1
- package/build/languageProcessing/helpers/transliterate/transliterateWPstyle.js +3 -9
- package/build/languageProcessing/helpers/transliterate/transliterateWPstyle.js.map +1 -1
- package/build/languageProcessing/helpers/url/parseSlug.js +1 -7
- package/build/languageProcessing/helpers/url/parseSlug.js.map +1 -1
- package/build/languageProcessing/helpers/url/url.js +7 -13
- package/build/languageProcessing/helpers/url/url.js.map +1 -1
- package/build/languageProcessing/helpers/word/addWordboundary.js +1 -7
- package/build/languageProcessing/helpers/word/addWordboundary.js.map +1 -1
- package/build/languageProcessing/helpers/word/areWordsInSentence.js +4 -10
- package/build/languageProcessing/helpers/word/areWordsInSentence.js.map +1 -1
- package/build/languageProcessing/helpers/word/countMetaDescriptionLength.js +1 -7
- package/build/languageProcessing/helpers/word/countMetaDescriptionLength.js.map +1 -1
- package/build/languageProcessing/helpers/word/countWords.js +4 -10
- package/build/languageProcessing/helpers/word/countWords.js.map +1 -1
- package/build/languageProcessing/helpers/word/createPunctuationTokens.js +5 -10
- package/build/languageProcessing/helpers/word/createPunctuationTokens.js.map +1 -1
- package/build/languageProcessing/helpers/word/filterWordsFromArray.js +4 -9
- package/build/languageProcessing/helpers/word/filterWordsFromArray.js.map +1 -1
- package/build/languageProcessing/helpers/word/followsIndex.js +5 -10
- package/build/languageProcessing/helpers/word/followsIndex.js.map +1 -1
- package/build/languageProcessing/helpers/word/getAllWordsFromTree.js +7 -13
- package/build/languageProcessing/helpers/word/getAllWordsFromTree.js.map +1 -1
- package/build/languageProcessing/helpers/word/getWords.js +9 -19
- package/build/languageProcessing/helpers/word/getWords.js.map +1 -1
- package/build/languageProcessing/helpers/word/includesIndex.js +5 -10
- package/build/languageProcessing/helpers/word/includesIndex.js.map +1 -1
- package/build/languageProcessing/helpers/word/indices.js +14 -25
- package/build/languageProcessing/helpers/word/indices.js.map +1 -1
- package/build/languageProcessing/helpers/word/markWordsInSentences.js +23 -35
- package/build/languageProcessing/helpers/word/markWordsInSentences.js.map +1 -1
- package/build/languageProcessing/helpers/word/matchWordInSentence.js +8 -15
- package/build/languageProcessing/helpers/word/matchWordInSentence.js.map +1 -1
- package/build/languageProcessing/helpers/word/splitIntoTokens.js +3 -9
- package/build/languageProcessing/helpers/word/splitIntoTokens.js.map +1 -1
- package/build/languageProcessing/index.js +41 -282
- package/build/languageProcessing/index.js.map +1 -1
- package/build/languageProcessing/languages/_default/Researcher.js +5 -13
- package/build/languageProcessing/languages/_default/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/_default/helpers/getStemmer.js +3 -9
- package/build/languageProcessing/languages/_default/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/ar/Researcher.js +19 -27
- package/build/languageProcessing/languages/ar/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/ar/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/ar/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/ar/config/functionWords.js +7 -13
- package/build/languageProcessing/languages/ar/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/ar/config/internal/passiveVerbsWithLongVowel.js +1 -7
- package/build/languageProcessing/languages/ar/config/internal/passiveVerbsWithLongVowel.js.map +1 -1
- package/build/languageProcessing/languages/ar/config/prefixedFunctionWords.js +2 -8
- package/build/languageProcessing/languages/ar/config/prefixedFunctionWords.js.map +1 -1
- package/build/languageProcessing/languages/ar/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/ar/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/ar/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/ar/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/ar/helpers/createBasicWordForms.js +6 -11
- package/build/languageProcessing/languages/ar/helpers/createBasicWordForms.js.map +1 -1
- package/build/languageProcessing/languages/ar/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/ar/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/ar/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/ar/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/ar/helpers/isPassiveSentence.js +5 -12
- package/build/languageProcessing/languages/ar/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/ca/Researcher.js +11 -19
- package/build/languageProcessing/languages/ca/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/ca/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/ca/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/ca/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/ca/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/ca/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/ca/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/ca/helpers/getStemmer.js +3 -9
- package/build/languageProcessing/languages/ca/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/cs/Researcher.js +17 -25
- package/build/languageProcessing/languages/cs/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/cs/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/cs/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/cs/config/functionWords.js +4 -10
- package/build/languageProcessing/languages/cs/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/cs/config/internal/passiveVoiceAuxiliaries.js +2 -8
- package/build/languageProcessing/languages/cs/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/cs/config/internal/passiveVoiceEndings.js +2 -8
- package/build/languageProcessing/languages/cs/config/internal/passiveVoiceEndings.js.map +1 -1
- package/build/languageProcessing/languages/cs/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/cs/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/cs/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/cs/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/cs/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/cs/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/cs/helpers/getClauses.js +9 -16
- package/build/languageProcessing/languages/cs/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/cs/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/cs/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/cs/helpers/internal/getParticiples.js +6 -12
- package/build/languageProcessing/languages/cs/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/cs/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/cs/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/cs/values/Clause.js +5 -12
- package/build/languageProcessing/languages/cs/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/de/Researcher.js +27 -35
- package/build/languageProcessing/languages/de/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/de/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/de/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/de/config/functionWords.js +11 -19
- package/build/languageProcessing/languages/de/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/de/config/internal/exceptionsParticiplesActive.js +1 -7
- package/build/languageProcessing/languages/de/config/internal/exceptionsParticiplesActive.js.map +1 -1
- package/build/languageProcessing/languages/de/config/internal/passiveVoiceAuxiliaries.js +4 -10
- package/build/languageProcessing/languages/de/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/de/config/internal/passiveVoiceIrregulars.js +1 -7
- package/build/languageProcessing/languages/de/config/internal/passiveVoiceIrregulars.js.map +1 -1
- package/build/languageProcessing/languages/de/config/internal/passiveVoiceRegex.js +1 -7
- package/build/languageProcessing/languages/de/config/internal/passiveVoiceRegex.js.map +1 -1
- package/build/languageProcessing/languages/de/config/keyphraseLength.js +1 -7
- package/build/languageProcessing/languages/de/config/keyphraseLength.js.map +1 -1
- package/build/languageProcessing/languages/de/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/de/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/de/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/de/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/de/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/de/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/de/config/wordComplexity.js +1 -7
- package/build/languageProcessing/languages/de/config/wordComplexity.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js +3 -9
- package/build/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js +1 -7
- package/build/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/checkIfWordIsFunction.js +3 -8
- package/build/languageProcessing/languages/de/helpers/checkIfWordIsFunction.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/getClauses.js +9 -16
- package/build/languageProcessing/languages/de/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/de/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/SentenceTokenizer.js +4 -11
- package/build/languageProcessing/languages/de/helpers/internal/SentenceTokenizer.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/detectAndStemRegularParticiple.js +4 -10
- package/build/languageProcessing/languages/de/helpers/internal/detectAndStemRegularParticiple.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/determineStem.js +10 -16
- package/build/languageProcessing/languages/de/helpers/internal/determineStem.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/getParticiples.js +9 -16
- package/build/languageProcessing/languages/de/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/de/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/memoizedSentenceTokenizer.js +4 -10
- package/build/languageProcessing/languages/de/helpers/memoizedSentenceTokenizer.js.map +1 -1
- package/build/languageProcessing/languages/de/values/Clause.js +11 -18
- package/build/languageProcessing/languages/de/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/el/Researcher.js +18 -26
- package/build/languageProcessing/languages/el/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/el/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/el/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/el/config/functionWords.js +4 -10
- package/build/languageProcessing/languages/el/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/el/config/internal/auxiliaries.js +1 -7
- package/build/languageProcessing/languages/el/config/internal/auxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/el/config/internal/morphologicalPassiveSuffixes.js +1 -7
- package/build/languageProcessing/languages/el/config/internal/morphologicalPassiveSuffixes.js.map +1 -1
- package/build/languageProcessing/languages/el/config/internal/nonPassiveVerbStems.js +1 -7
- package/build/languageProcessing/languages/el/config/internal/nonPassiveVerbStems.js.map +1 -1
- package/build/languageProcessing/languages/el/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/el/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/el/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/el/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/el/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/el/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/getClauses.js +9 -16
- package/build/languageProcessing/languages/el/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/getStemmer.js +7 -14
- package/build/languageProcessing/languages/el/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/internal/getParticiples.js +3 -9
- package/build/languageProcessing/languages/el/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/internal/stem.js +4 -13
- package/build/languageProcessing/languages/el/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/isPassiveSentence.js +7 -14
- package/build/languageProcessing/languages/el/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/el/values/Clause.js +6 -12
- package/build/languageProcessing/languages/el/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/en/Researcher.js +21 -29
- package/build/languageProcessing/languages/en/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/en/config/abbreviations.js +2 -8
- package/build/languageProcessing/languages/en/config/abbreviations.js.map +1 -1
- package/build/languageProcessing/languages/en/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/en/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/en/config/functionWords.js +11 -18
- package/build/languageProcessing/languages/en/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/en/config/internal/passiveVoiceAuxiliaries.js +6 -12
- package/build/languageProcessing/languages/en/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/en/config/internal/passiveVoiceIrregulars.js +1 -7
- package/build/languageProcessing/languages/en/config/internal/passiveVoiceIrregulars.js.map +1 -1
- package/build/languageProcessing/languages/en/config/internal/passiveVoiceNonVerbEndingEd.js +1 -7
- package/build/languageProcessing/languages/en/config/internal/passiveVoiceNonVerbEndingEd.js.map +1 -1
- package/build/languageProcessing/languages/en/config/regularParticiplesRegex.js +1 -7
- package/build/languageProcessing/languages/en/config/regularParticiplesRegex.js.map +1 -1
- package/build/languageProcessing/languages/en/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/en/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/en/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/en/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/en/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/en/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/en/config/wordComplexity.js +1 -7
- package/build/languageProcessing/languages/en/config/wordComplexity.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js +3 -9
- package/build/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/checkIfWordIsComplex.js +4 -10
- package/build/languageProcessing/languages/en/helpers/checkIfWordIsComplex.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/getClauses.js +15 -22
- package/build/languageProcessing/languages/en/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/en/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/determineStem.js +21 -32
- package/build/languageProcessing/languages/en/helpers/internal/determineStem.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js +6 -13
- package/build/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getParticiples.js +8 -14
- package/build/languageProcessing/languages/en/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getVerbStem.js +6 -16
- package/build/languageProcessing/languages/en/helpers/internal/getVerbStem.js.map +1 -1
- package/build/languageProcessing/languages/en/values/Clause.js +10 -17
- package/build/languageProcessing/languages/en/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/es/Researcher.js +23 -31
- package/build/languageProcessing/languages/es/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/es/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/es/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/es/config/functionWords.js +11 -17
- package/build/languageProcessing/languages/es/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/es/config/internal/passiveVoiceAuxiliaries.js +1 -7
- package/build/languageProcessing/languages/es/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/es/config/internal/passiveVoiceParticiples.js +1 -7
- package/build/languageProcessing/languages/es/config/internal/passiveVoiceParticiples.js.map +1 -1
- package/build/languageProcessing/languages/es/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/es/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/es/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/es/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/es/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/es/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/es/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/es/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/es/config/wordComplexity.js +1 -7
- package/build/languageProcessing/languages/es/config/wordComplexity.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js +3 -9
- package/build/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/checkIfWordIsComplex.js +1 -7
- package/build/languageProcessing/languages/es/helpers/checkIfWordIsComplex.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/getClauses.js +10 -17
- package/build/languageProcessing/languages/es/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/es/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js +7 -13
- package/build/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/internal/getParticiples.js +6 -12
- package/build/languageProcessing/languages/es/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/internal/stem.js +5 -13
- package/build/languageProcessing/languages/es/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/es/values/Clause.js +7 -14
- package/build/languageProcessing/languages/es/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/fa/Researcher.js +19 -27
- package/build/languageProcessing/languages/fa/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/fa/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/fa/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/fa/config/functionWords.js +4 -10
- package/build/languageProcessing/languages/fa/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/fa/config/internal/participles.js +1 -7
- package/build/languageProcessing/languages/fa/config/internal/participles.js.map +1 -1
- package/build/languageProcessing/languages/fa/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/fa/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/fa/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/fa/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/fa/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/fa/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/fa/helpers/createBasicWordForms.js +3 -9
- package/build/languageProcessing/languages/fa/helpers/createBasicWordForms.js.map +1 -1
- package/build/languageProcessing/languages/fa/helpers/getStemmer.js +3 -9
- package/build/languageProcessing/languages/fa/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/fa/helpers/isPassiveSentence.js +6 -12
- package/build/languageProcessing/languages/fa/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/fr/Researcher.js +21 -29
- package/build/languageProcessing/languages/fr/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/fr/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/functionWords.js +11 -17
- package/build/languageProcessing/languages/fr/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/internal/exceptionsParticiplesActive.js +4 -9
- package/build/languageProcessing/languages/fr/config/internal/exceptionsParticiplesActive.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/internal/passiveVoiceAuxiliaries.js +1 -7
- package/build/languageProcessing/languages/fr/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/internal/passiveVoiceIrregulars.js +4 -9
- package/build/languageProcessing/languages/fr/config/internal/passiveVoiceIrregulars.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/fr/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/fr/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/fr/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/fr/config/wordComplexity.js +1 -7
- package/build/languageProcessing/languages/fr/config/wordComplexity.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js +3 -9
- package/build/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/checkIfWordIsComplex.js +3 -9
- package/build/languageProcessing/languages/fr/helpers/checkIfWordIsComplex.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/getClauses.js +10 -17
- package/build/languageProcessing/languages/fr/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/fr/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/internal/getParticiples.js +11 -16
- package/build/languageProcessing/languages/fr/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/internal/stem.js +3 -10
- package/build/languageProcessing/languages/fr/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/fr/values/Clause.js +14 -20
- package/build/languageProcessing/languages/fr/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/he/Researcher.js +21 -29
- package/build/languageProcessing/languages/he/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/he/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/he/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/he/config/functionWords.js +4 -11
- package/build/languageProcessing/languages/he/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/he/config/internal/regularRootsHufal.js +1 -7
- package/build/languageProcessing/languages/he/config/internal/regularRootsHufal.js.map +1 -1
- package/build/languageProcessing/languages/he/config/internal/regularRootsNifal.js +1 -7
- package/build/languageProcessing/languages/he/config/internal/regularRootsNifal.js.map +1 -1
- package/build/languageProcessing/languages/he/config/internal/regularRootsPual.js +1 -7
- package/build/languageProcessing/languages/he/config/internal/regularRootsPual.js.map +1 -1
- package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsHufal.js +1 -7
- package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsHufal.js.map +1 -1
- package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsNifal.js +1 -7
- package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsNifal.js.map +1 -1
- package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsPual.js +1 -7
- package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsPual.js.map +1 -1
- package/build/languageProcessing/languages/he/config/prefixedFunctionWords.js +2 -8
- package/build/languageProcessing/languages/he/config/prefixedFunctionWords.js.map +1 -1
- package/build/languageProcessing/languages/he/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/he/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/he/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/he/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/he/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/he/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/he/helpers/createBasicWordForms.js +6 -11
- package/build/languageProcessing/languages/he/helpers/createBasicWordForms.js.map +1 -1
- package/build/languageProcessing/languages/he/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/he/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/he/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/he/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/he/helpers/isPassiveSentence.js +10 -16
- package/build/languageProcessing/languages/he/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/he/helpers/stem.js +1 -7
- package/build/languageProcessing/languages/he/helpers/stem.js.map +1 -1
- package/build/languageProcessing/languages/hu/Researcher.js +19 -27
- package/build/languageProcessing/languages/hu/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/hu/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/functionWords.js +4 -10
- package/build/languageProcessing/languages/hu/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/internal/auxiliaries.js +1 -7
- package/build/languageProcessing/languages/hu/config/internal/auxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/internal/morphologicalPassiveAffixes.js +3 -9
- package/build/languageProcessing/languages/hu/config/internal/morphologicalPassiveAffixes.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/internal/nonPassivesInVaAndVe.js +2 -7
- package/build/languageProcessing/languages/hu/config/internal/nonPassivesInVaAndVe.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/internal/odikVerbs.js +1 -7
- package/build/languageProcessing/languages/hu/config/internal/odikVerbs.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/internal/participles.js +2 -7
- package/build/languageProcessing/languages/hu/config/internal/participles.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/stopWords.js +2 -7
- package/build/languageProcessing/languages/hu/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/hu/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/hu/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/hu/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/getClauses.js +9 -16
- package/build/languageProcessing/languages/hu/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/hu/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/internal/getParticiples.js +6 -12
- package/build/languageProcessing/languages/hu/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/hu/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/isPassiveSentence.js +9 -15
- package/build/languageProcessing/languages/hu/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/hu/values/Clause.js +8 -14
- package/build/languageProcessing/languages/hu/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/id/Researcher.js +17 -25
- package/build/languageProcessing/languages/id/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/id/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/id/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/id/config/functionWords.js +8 -16
- package/build/languageProcessing/languages/id/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/id/config/internal/nonPassiveVerbsStartingDi.js +1 -7
- package/build/languageProcessing/languages/id/config/internal/nonPassiveVerbsStartingDi.js.map +1 -1
- package/build/languageProcessing/languages/id/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/id/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/id/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/id/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/id/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/internal/stem.js +29 -34
- package/build/languageProcessing/languages/id/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/internal/stemHelpers.js +5 -13
- package/build/languageProcessing/languages/id/helpers/internal/stemHelpers.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/isPassiveSentence.js +5 -12
- package/build/languageProcessing/languages/id/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/splitIntoTokensCustom.js +3 -9
- package/build/languageProcessing/languages/id/helpers/splitIntoTokensCustom.js.map +1 -1
- package/build/languageProcessing/languages/it/Researcher.js +23 -31
- package/build/languageProcessing/languages/it/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/it/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/it/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/it/config/functionWords.js +11 -17
- package/build/languageProcessing/languages/it/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/it/config/internal/passiveVoiceAuxiliaries.js +1 -7
- package/build/languageProcessing/languages/it/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/it/config/internal/passiveVoiceParticiples.js +1 -7
- package/build/languageProcessing/languages/it/config/internal/passiveVoiceParticiples.js.map +1 -1
- package/build/languageProcessing/languages/it/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/it/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/it/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/it/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/it/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/it/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/it/config/twoPartTransitionWords.js +1 -7
- package/build/languageProcessing/languages/it/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/calculateFleschReadingScore.js +3 -9
- package/build/languageProcessing/languages/it/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/getClauses.js +10 -17
- package/build/languageProcessing/languages/it/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/it/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/internal/getParticiples.js +6 -12
- package/build/languageProcessing/languages/it/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/internal/stem.js +3 -9
- package/build/languageProcessing/languages/it/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/it/values/Clause.js +7 -14
- package/build/languageProcessing/languages/it/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/ja/Researcher.js +51 -59
- package/build/languageProcessing/languages/ja/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/assessmentApplicabilityCharacterCount.js +1 -7
- package/build/languageProcessing/languages/ja/config/assessmentApplicabilityCharacterCount.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/ja/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/functionWords.js +1 -7
- package/build/languageProcessing/languages/ja/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/keyphraseLength.js +1 -7
- package/build/languageProcessing/languages/ja/config/keyphraseLength.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/metaDescriptionLength.js +1 -7
- package/build/languageProcessing/languages/ja/config/metaDescriptionLength.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/paragraphLength.js +1 -7
- package/build/languageProcessing/languages/ja/config/paragraphLength.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/ja/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/subheadingsTooLong.js +1 -7
- package/build/languageProcessing/languages/ja/config/subheadingsTooLong.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/textLength.js +1 -7
- package/build/languageProcessing/languages/ja/config/textLength.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/topicLength.js +1 -7
- package/build/languageProcessing/languages/ja/config/topicLength.js.map +1 -1
- package/build/languageProcessing/languages/ja/config/transitionWords.js +2 -7
- package/build/languageProcessing/languages/ja/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/ja/customResearches/findKeyphraseInSEOTitle.js +16 -22
- package/build/languageProcessing/languages/ja/customResearches/findKeyphraseInSEOTitle.js.map +1 -1
- package/build/languageProcessing/languages/ja/customResearches/getKeyphraseLength.js +5 -11
- package/build/languageProcessing/languages/ja/customResearches/getKeyphraseLength.js.map +1 -1
- package/build/languageProcessing/languages/ja/customResearches/getWordForms.js +11 -17
- package/build/languageProcessing/languages/ja/customResearches/getWordForms.js.map +1 -1
- package/build/languageProcessing/languages/ja/customResearches/textLength.js +3 -9
- package/build/languageProcessing/languages/ja/customResearches/textLength.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/countCharacters.js +6 -12
- package/build/languageProcessing/languages/ja/helpers/countCharacters.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/customGetStemmer.js +8 -14
- package/build/languageProcessing/languages/ja/helpers/customGetStemmer.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/getContentWords.js +5 -11
- package/build/languageProcessing/languages/ja/helpers/getContentWords.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/getWords.js +8 -15
- package/build/languageProcessing/languages/ja/helpers/getWords.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/internal/SentenceTokenizer.js +6 -13
- package/build/languageProcessing/languages/ja/helpers/internal/SentenceTokenizer.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/internal/createWordForms.js +4 -9
- package/build/languageProcessing/languages/ja/helpers/internal/createWordForms.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/internal/determineStem.js +3 -9
- package/build/languageProcessing/languages/ja/helpers/internal/determineStem.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/matchTextWithWord.js +7 -13
- package/build/languageProcessing/languages/ja/helpers/matchTextWithWord.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/matchTransitionWords.js +3 -9
- package/build/languageProcessing/languages/ja/helpers/matchTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/memoizedSentenceTokenizer.js +4 -10
- package/build/languageProcessing/languages/ja/helpers/memoizedSentenceTokenizer.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/splitIntoTokensCustom.js +5 -11
- package/build/languageProcessing/languages/ja/helpers/splitIntoTokensCustom.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/wordsCharacterCount.js +1 -7
- package/build/languageProcessing/languages/ja/helpers/wordsCharacterCount.js.map +1 -1
- package/build/languageProcessing/languages/nb/Researcher.js +17 -25
- package/build/languageProcessing/languages/nb/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/nb/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/nb/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/nb/config/functionWords.js +5 -11
- package/build/languageProcessing/languages/nb/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/nb/config/internal/participles.js +2 -7
- package/build/languageProcessing/languages/nb/config/internal/participles.js.map +1 -1
- package/build/languageProcessing/languages/nb/config/internal/passiveVoiceAuxiliaries.js +1 -7
- package/build/languageProcessing/languages/nb/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/nb/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/nb/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/nb/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/nb/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/nb/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/nb/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/nb/helpers/getClauses.js +11 -18
- package/build/languageProcessing/languages/nb/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/nb/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/nb/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/nb/helpers/internal/getParticiples.js +8 -14
- package/build/languageProcessing/languages/nb/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/nb/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/nb/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/nb/values/Clause.js +8 -14
- package/build/languageProcessing/languages/nb/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/nl/Researcher.js +23 -31
- package/build/languageProcessing/languages/nl/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/nl/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/functionWords.js +10 -16
- package/build/languageProcessing/languages/nl/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/internal/nonParticiples.js +1 -7
- package/build/languageProcessing/languages/nl/config/internal/nonParticiples.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/internal/passiveVoiceAuxiliaries.js +1 -7
- package/build/languageProcessing/languages/nl/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/internal/passiveVoiceIrregulars.js +1 -7
- package/build/languageProcessing/languages/nl/config/internal/passiveVoiceIrregulars.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/keyphraseLength.js +1 -7
- package/build/languageProcessing/languages/nl/config/keyphraseLength.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/nl/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/nl/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/nl/config/twoPartTransitionWords.js +1 -7
- package/build/languageProcessing/languages/nl/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/calculateFleschReadingScore.js +3 -9
- package/build/languageProcessing/languages/nl/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/getClauses.js +9 -16
- package/build/languageProcessing/languages/nl/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/nl/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js +7 -13
- package/build/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js +8 -14
- package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemSuffixes.js +10 -15
- package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemSuffixes.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/determineStem.js +10 -16
- package/build/languageProcessing/languages/nl/helpers/internal/determineStem.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/getParticiples.js +7 -13
- package/build/languageProcessing/languages/nl/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js +7 -12
- package/build/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stem.js +17 -23
- package/build/languageProcessing/languages/nl/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js +4 -11
- package/build/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js +8 -14
- package/build/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js.map +1 -1
- package/build/languageProcessing/languages/nl/values/Clause.js +10 -16
- package/build/languageProcessing/languages/nl/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/pl/Researcher.js +19 -27
- package/build/languageProcessing/languages/pl/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/pl/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/pl/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/pl/config/functionWords.js +9 -16
- package/build/languageProcessing/languages/pl/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/pl/config/internal/auxiliaries.js +1 -7
- package/build/languageProcessing/languages/pl/config/internal/auxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/pl/config/internal/participles.js +1 -7
- package/build/languageProcessing/languages/pl/config/internal/participles.js.map +1 -1
- package/build/languageProcessing/languages/pl/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/pl/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/pl/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/pl/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/pl/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/pl/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/pl/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/pl/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/pl/helpers/getClauses.js +9 -16
- package/build/languageProcessing/languages/pl/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/pl/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/pl/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/pl/helpers/internal/getParticiples.js +7 -13
- package/build/languageProcessing/languages/pl/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/pl/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/pl/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/pl/values/Clause.js +8 -14
- package/build/languageProcessing/languages/pl/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/pt/Researcher.js +23 -31
- package/build/languageProcessing/languages/pt/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/pt/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/pt/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/pt/config/functionWords.js +10 -16
- package/build/languageProcessing/languages/pt/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/pt/config/internal/passiveVoiceAuxiliaries.js +1 -7
- package/build/languageProcessing/languages/pt/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/pt/config/internal/passiveVoiceParticiples.js +1 -7
- package/build/languageProcessing/languages/pt/config/internal/passiveVoiceParticiples.js.map +1 -1
- package/build/languageProcessing/languages/pt/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/pt/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/pt/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/pt/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/pt/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/pt/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/pt/config/twoPartTransitionWords.js +1 -7
- package/build/languageProcessing/languages/pt/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/calculateFleschReadingScore.js +3 -9
- package/build/languageProcessing/languages/pt/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/getClauses.js +10 -17
- package/build/languageProcessing/languages/pt/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/pt/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/internal/getParticiples.js +6 -12
- package/build/languageProcessing/languages/pt/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/internal/stem.js +3 -9
- package/build/languageProcessing/languages/pt/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/pt/values/Clause.js +7 -14
- package/build/languageProcessing/languages/pt/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/ru/Researcher.js +23 -31
- package/build/languageProcessing/languages/ru/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/ru/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/ru/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/ru/config/fleschReadingEaseScores.js +1 -7
- package/build/languageProcessing/languages/ru/config/fleschReadingEaseScores.js.map +1 -1
- package/build/languageProcessing/languages/ru/config/functionWords.js +8 -14
- package/build/languageProcessing/languages/ru/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/ru/config/internal/participlesShortenedList.js +2 -8
- package/build/languageProcessing/languages/ru/config/internal/participlesShortenedList.js.map +1 -1
- package/build/languageProcessing/languages/ru/config/internal/passiveVoiceParticiples.js +1 -7
- package/build/languageProcessing/languages/ru/config/internal/passiveVoiceParticiples.js.map +1 -1
- package/build/languageProcessing/languages/ru/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/ru/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/ru/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/ru/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/ru/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/ru/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/ru/helpers/calculateFleschReadingScore.js +3 -9
- package/build/languageProcessing/languages/ru/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/ru/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/ru/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/ru/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/ru/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/ru/helpers/isPassiveSentence.js +6 -12
- package/build/languageProcessing/languages/ru/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/sk/Researcher.js +17 -25
- package/build/languageProcessing/languages/sk/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/sk/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/sk/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/sk/config/functionWords.js +5 -11
- package/build/languageProcessing/languages/sk/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/sk/config/internal/nonPassives.js +1 -7
- package/build/languageProcessing/languages/sk/config/internal/nonPassives.js.map +1 -1
- package/build/languageProcessing/languages/sk/config/internal/passiveVoiceAuxiliaries.js +2 -8
- package/build/languageProcessing/languages/sk/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
- package/build/languageProcessing/languages/sk/config/stopWords.js +1 -7
- package/build/languageProcessing/languages/sk/config/stopWords.js.map +1 -1
- package/build/languageProcessing/languages/sk/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/sk/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/sk/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/sk/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/sk/helpers/getClauses.js +9 -16
- package/build/languageProcessing/languages/sk/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/sk/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/sk/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/sk/helpers/internal/getParticiples.js +3 -9
- package/build/languageProcessing/languages/sk/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/sk/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/sk/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/sk/values/Clause.js +8 -14
- package/build/languageProcessing/languages/sk/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/sv/Researcher.js +17 -25
- package/build/languageProcessing/languages/sv/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/sv/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/sv/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/sv/config/functionWords.js +7 -13
- package/build/languageProcessing/languages/sv/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/sv/config/internal/passiveVerbs.js +2 -7
- package/build/languageProcessing/languages/sv/config/internal/passiveVerbs.js.map +1 -1
- package/build/languageProcessing/languages/sv/config/keyphraseLength.js +1 -7
- package/build/languageProcessing/languages/sv/config/keyphraseLength.js.map +1 -1
- package/build/languageProcessing/languages/sv/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/sv/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/sv/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/sv/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/sv/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/sv/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/sv/helpers/internal/stem.js +1 -7
- package/build/languageProcessing/languages/sv/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/sv/helpers/isPassiveSentence.js +6 -12
- package/build/languageProcessing/languages/sv/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/tr/Researcher.js +17 -25
- package/build/languageProcessing/languages/tr/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/tr/config/firstWordExceptions.js +1 -7
- package/build/languageProcessing/languages/tr/config/firstWordExceptions.js.map +1 -1
- package/build/languageProcessing/languages/tr/config/functionWords.js +4 -10
- package/build/languageProcessing/languages/tr/config/functionWords.js.map +1 -1
- package/build/languageProcessing/languages/tr/config/internal/nonPassiveExceptions.js +3 -8
- package/build/languageProcessing/languages/tr/config/internal/nonPassiveExceptions.js.map +1 -1
- package/build/languageProcessing/languages/tr/config/internal/passiveEndings.js +1 -7
- package/build/languageProcessing/languages/tr/config/internal/passiveEndings.js.map +1 -1
- package/build/languageProcessing/languages/tr/config/sentenceLength.js +1 -7
- package/build/languageProcessing/languages/tr/config/sentenceLength.js.map +1 -1
- package/build/languageProcessing/languages/tr/config/transitionWords.js +4 -10
- package/build/languageProcessing/languages/tr/config/transitionWords.js.map +1 -1
- package/build/languageProcessing/languages/tr/config/twoPartTransitionWords.js +2 -7
- package/build/languageProcessing/languages/tr/config/twoPartTransitionWords.js.map +1 -1
- package/build/languageProcessing/languages/tr/helpers/getStemmer.js +8 -14
- package/build/languageProcessing/languages/tr/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/tr/helpers/internal/stem.js +3 -9
- package/build/languageProcessing/languages/tr/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/tr/helpers/isPassiveSentence.js +9 -15
- package/build/languageProcessing/languages/tr/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/researches/altTagCount.js +10 -16
- package/build/languageProcessing/researches/altTagCount.js.map +1 -1
- package/build/languageProcessing/researches/checkRelatedKeywords.js +72 -0
- package/build/languageProcessing/researches/checkRelatedKeywords.js.map +1 -0
- package/build/languageProcessing/researches/countSentencesFromText.js +9 -15
- package/build/languageProcessing/researches/countSentencesFromText.js.map +1 -1
- package/build/languageProcessing/researches/findKeyphraseInSEOTitle.js +19 -26
- package/build/languageProcessing/researches/findKeyphraseInSEOTitle.js.map +1 -1
- package/build/languageProcessing/researches/findKeywordInFirstParagraph.js +17 -23
- package/build/languageProcessing/researches/findKeywordInFirstParagraph.js.map +1 -1
- package/build/languageProcessing/researches/findTransitionWords.js +16 -23
- package/build/languageProcessing/researches/findTransitionWords.js.map +1 -1
- package/build/languageProcessing/researches/functionWordsInKeyphrase.js +10 -16
- package/build/languageProcessing/researches/functionWordsInKeyphrase.js.map +1 -1
- package/build/languageProcessing/researches/getAnchorsWithKeyphrase.js +21 -28
- package/build/languageProcessing/researches/getAnchorsWithKeyphrase.js.map +1 -1
- package/build/languageProcessing/researches/getFleschReadingScore.js +18 -25
- package/build/languageProcessing/researches/getFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/researches/getKeywordDensity.js +7 -14
- package/build/languageProcessing/researches/getKeywordDensity.js.map +1 -1
- package/build/languageProcessing/researches/getLinkStatistics.js +7 -13
- package/build/languageProcessing/researches/getLinkStatistics.js.map +1 -1
- package/build/languageProcessing/researches/getLinks.js +7 -13
- package/build/languageProcessing/researches/getLinks.js.map +1 -1
- package/build/languageProcessing/researches/getLongCenterAlignedTexts.js +1 -7
- package/build/languageProcessing/researches/getLongCenterAlignedTexts.js.map +1 -1
- package/build/languageProcessing/researches/getParagraphLength.js +15 -21
- package/build/languageProcessing/researches/getParagraphLength.js.map +1 -1
- package/build/languageProcessing/researches/getParagraphs.js +4 -9
- package/build/languageProcessing/researches/getParagraphs.js.map +1 -1
- package/build/languageProcessing/researches/getPassiveVoiceResult.js +21 -30
- package/build/languageProcessing/researches/getPassiveVoiceResult.js.map +1 -1
- package/build/languageProcessing/researches/getProminentWordsForInsights.js +12 -18
- package/build/languageProcessing/researches/getProminentWordsForInsights.js.map +1 -1
- package/build/languageProcessing/researches/getProminentWordsForInternalLinking.js +20 -26
- package/build/languageProcessing/researches/getProminentWordsForInternalLinking.js.map +1 -1
- package/build/languageProcessing/researches/getSentenceBeginnings.js +30 -36
- package/build/languageProcessing/researches/getSentenceBeginnings.js.map +1 -1
- package/build/languageProcessing/researches/getSubheadingTextLengths.js +12 -18
- package/build/languageProcessing/researches/getSubheadingTextLengths.js.map +1 -1
- package/build/languageProcessing/researches/getWordForms.js +13 -19
- package/build/languageProcessing/researches/getWordForms.js.map +1 -1
- package/build/languageProcessing/researches/h1s.js +1 -7
- package/build/languageProcessing/researches/h1s.js.map +1 -1
- package/build/languageProcessing/researches/imageCount.js +4 -10
- package/build/languageProcessing/researches/imageCount.js.map +1 -1
- package/build/languageProcessing/researches/index.js +4 -27
- package/build/languageProcessing/researches/index.js.map +1 -1
- package/build/languageProcessing/researches/keyphraseDistribution.js +22 -32
- package/build/languageProcessing/researches/keyphraseDistribution.js.map +1 -1
- package/build/languageProcessing/researches/keyphraseLength.js +1 -7
- package/build/languageProcessing/researches/keyphraseLength.js.map +1 -1
- package/build/languageProcessing/researches/keywordCount.js +30 -39
- package/build/languageProcessing/researches/keywordCount.js.map +1 -1
- package/build/languageProcessing/researches/keywordCountInUrl.js +8 -16
- package/build/languageProcessing/researches/keywordCountInUrl.js.map +1 -1
- package/build/languageProcessing/researches/matchKeywordInSubheadings.js +15 -20
- package/build/languageProcessing/researches/matchKeywordInSubheadings.js.map +1 -1
- package/build/languageProcessing/researches/metaDescriptionKeyword.js +6 -12
- package/build/languageProcessing/researches/metaDescriptionKeyword.js.map +1 -1
- package/build/languageProcessing/researches/metaDescriptionLength.js +3 -9
- package/build/languageProcessing/researches/metaDescriptionLength.js.map +1 -1
- package/build/languageProcessing/researches/pageTitleWidth.js +1 -7
- package/build/languageProcessing/researches/pageTitleWidth.js.map +1 -1
- package/build/languageProcessing/researches/readingTime.js +7 -13
- package/build/languageProcessing/researches/readingTime.js.map +1 -1
- package/build/languageProcessing/researches/sentences.js +7 -13
- package/build/languageProcessing/researches/sentences.js.map +1 -1
- package/build/languageProcessing/researches/videoCount.js +1 -7
- package/build/languageProcessing/researches/videoCount.js.map +1 -1
- package/build/languageProcessing/researches/wordComplexity.js +15 -21
- package/build/languageProcessing/researches/wordComplexity.js.map +1 -1
- package/build/languageProcessing/researches/wordCountInText.js +10 -15
- package/build/languageProcessing/researches/wordCountInText.js.map +1 -1
- package/build/languageProcessing/values/Clause.js +1 -7
- package/build/languageProcessing/values/Clause.js.map +1 -1
- package/build/languageProcessing/values/ProminentWord.js +1 -7
- package/build/languageProcessing/values/ProminentWord.js.map +1 -1
- package/build/languageProcessing/values/Sentence.js +1 -7
- package/build/languageProcessing/values/Sentence.js.map +1 -1
- package/build/languageProcessing/values/index.js +4 -27
- package/build/languageProcessing/values/index.js.map +1 -1
- package/build/markers/addMark.js +1 -7
- package/build/markers/addMark.js.map +1 -1
- package/build/markers/addMarkSingleWord.js +7 -12
- package/build/markers/addMarkSingleWord.js.map +1 -1
- package/build/markers/index.js +3 -20
- package/build/markers/index.js.map +1 -1
- package/build/markers/removeDuplicateMarks.js +3 -8
- package/build/markers/removeDuplicateMarks.js.map +1 -1
- package/build/markers/removeMarks.js +1 -7
- package/build/markers/removeMarks.js.map +1 -1
- package/build/parse/build/build.js +17 -25
- package/build/parse/build/build.js.map +1 -1
- package/build/parse/build/index.js +7 -12
- package/build/parse/build/index.js.map +1 -1
- package/build/parse/build/private/adapt.js +15 -21
- package/build/parse/build/private/adapt.js.map +1 -1
- package/build/parse/build/private/adaptAttributes.js +3 -9
- package/build/parse/build/private/adaptAttributes.js.map +1 -1
- package/build/parse/build/private/alwaysFilterElements.js +9 -14
- package/build/parse/build/private/alwaysFilterElements.js.map +1 -1
- package/build/parse/build/private/combineIntoImplicitParagraphs.js +12 -18
- package/build/parse/build/private/combineIntoImplicitParagraphs.js.map +1 -1
- package/build/parse/build/private/filterBeforeTokenizing.js +5 -10
- package/build/parse/build/private/filterBeforeTokenizing.js.map +1 -1
- package/build/parse/build/private/filterHelpers.js +3 -11
- package/build/parse/build/private/filterHelpers.js.map +1 -1
- package/build/parse/build/private/filterTree.js +3 -8
- package/build/parse/build/private/filterTree.js.map +1 -1
- package/build/parse/build/private/getTextElementPositions.js +5 -10
- package/build/parse/build/private/getTextElementPositions.js.map +1 -1
- package/build/parse/build/private/helpers/parseClassAttribute.js +1 -7
- package/build/parse/build/private/helpers/parseClassAttribute.js.map +1 -1
- package/build/parse/build/private/isPhrasingContent.js +1 -7
- package/build/parse/build/private/isPhrasingContent.js.map +1 -1
- package/build/parse/build/private/parseBlocks.js +4 -11
- package/build/parse/build/private/parseBlocks.js.map +1 -1
- package/build/parse/build/private/tokenize.js +8 -14
- package/build/parse/build/private/tokenize.js.map +1 -1
- package/build/parse/language/LanguageProcessor.js +8 -15
- package/build/parse/language/LanguageProcessor.js.map +1 -1
- package/build/parse/structure/Heading.js +3 -9
- package/build/parse/structure/Heading.js.map +1 -1
- package/build/parse/structure/Node.js +8 -14
- package/build/parse/structure/Node.js.map +1 -1
- package/build/parse/structure/Paragraph.js +3 -9
- package/build/parse/structure/Paragraph.js.map +1 -1
- package/build/parse/structure/Sentence.js +1 -7
- package/build/parse/structure/Sentence.js.map +1 -1
- package/build/parse/structure/SourceCodeLocation.js +1 -7
- package/build/parse/structure/SourceCodeLocation.js.map +1 -1
- package/build/parse/structure/Text.js +3 -10
- package/build/parse/structure/Text.js.map +1 -1
- package/build/parse/structure/Token.js +3 -8
- package/build/parse/structure/Token.js.map +1 -1
- package/build/parse/structure/index.js +10 -33
- package/build/parse/structure/index.js.map +1 -1
- package/build/parse/traverse/findAllInTree.js +1 -7
- package/build/parse/traverse/findAllInTree.js.map +1 -1
- package/build/parse/traverse/index.js +8 -19
- package/build/parse/traverse/index.js.map +1 -1
- package/build/parse/traverse/innerText.js +3 -8
- package/build/parse/traverse/innerText.js.map +1 -1
- package/build/parsedPaper/ParsedPaper.js +1 -8
- package/build/parsedPaper/ParsedPaper.js.map +1 -1
- package/build/parsedPaper/assess/TreeAssessor.js +6 -12
- package/build/parsedPaper/assess/TreeAssessor.js.map +1 -1
- package/build/parsedPaper/assess/assessmentListFactories.js +1 -11
- package/build/parsedPaper/assess/assessmentListFactories.js.map +1 -1
- package/build/parsedPaper/assess/assessments/Assessment.js +15 -9
- package/build/parsedPaper/assess/assessments/Assessment.js.map +1 -1
- package/build/parsedPaper/assess/assessments/index.js +6 -13
- package/build/parsedPaper/assess/assessments/index.js.map +1 -1
- package/build/parsedPaper/assess/assessorFactories.js +16 -24
- package/build/parsedPaper/assess/assessorFactories.js.map +1 -1
- package/build/parsedPaper/assess/cornerstone/assessmentListFactories.js +1 -9
- package/build/parsedPaper/assess/cornerstone/assessmentListFactories.js.map +1 -1
- package/build/parsedPaper/assess/cornerstone/index.js +2 -10
- package/build/parsedPaper/assess/cornerstone/index.js.map +1 -1
- package/build/parsedPaper/assess/index.js +13 -29
- package/build/parsedPaper/assess/index.js.map +1 -1
- package/build/parsedPaper/build/PaperParser.js +5 -11
- package/build/parsedPaper/build/PaperParser.js.map +1 -1
- package/build/parsedPaper/build/linguisticParsing/Sentence.js +1 -7
- package/build/parsedPaper/build/linguisticParsing/Sentence.js.map +1 -1
- package/build/parsedPaper/build/linguisticParsing/SentenceTokenizer.js +16 -23
- package/build/parsedPaper/build/linguisticParsing/SentenceTokenizer.js.map +1 -1
- package/build/parsedPaper/build/linguisticParsing/parseText.js +3 -9
- package/build/parsedPaper/build/linguisticParsing/parseText.js.map +1 -1
- package/build/parsedPaper/build/tree/TreeBuilder.js +3 -9
- package/build/parsedPaper/build/tree/TreeBuilder.js.map +1 -1
- package/build/parsedPaper/build/tree/cleanup/calculateTextIndices.js +5 -10
- package/build/parsedPaper/build/tree/cleanup/calculateTextIndices.js.map +1 -1
- package/build/parsedPaper/build/tree/cleanup/getElementContent.js +1 -7
- package/build/parsedPaper/build/tree/cleanup/getElementContent.js.map +1 -1
- package/build/parsedPaper/build/tree/cleanup/postParsing.js +5 -11
- package/build/parsedPaper/build/tree/cleanup/postParsing.js.map +1 -1
- package/build/parsedPaper/build/tree/html/HTMLTreeConverter.js +21 -27
- package/build/parsedPaper/build/tree/html/HTMLTreeConverter.js.map +1 -1
- package/build/parsedPaper/build/tree/html/buildTree.js +7 -13
- package/build/parsedPaper/build/tree/html/buildTree.js.map +1 -1
- package/build/parsedPaper/build/tree/html/htmlConstants.js +4 -9
- package/build/parsedPaper/build/tree/html/htmlConstants.js.map +1 -1
- package/build/parsedPaper/build/tree/index.js +3 -8
- package/build/parsedPaper/build/tree/index.js.map +1 -1
- package/build/parsedPaper/build/tree/metadata/buildTree.js +12 -18
- package/build/parsedPaper/build/tree/metadata/buildTree.js.map +1 -1
- package/build/parsedPaper/research/TreeResearcher.js +4 -9
- package/build/parsedPaper/research/TreeResearcher.js.map +1 -1
- package/build/parsedPaper/research/index.js +10 -12
- package/build/parsedPaper/research/index.js.map +1 -1
- package/build/parsedPaper/research/researches/Headings.js +5 -11
- package/build/parsedPaper/research/researches/Headings.js.map +1 -1
- package/build/parsedPaper/research/researches/LinkStatistics.js +6 -12
- package/build/parsedPaper/research/researches/LinkStatistics.js.map +1 -1
- package/build/parsedPaper/research/researches/Research.js +5 -10
- package/build/parsedPaper/research/researches/Research.js.map +1 -1
- package/build/parsedPaper/research/researches/index.js +1 -13
- package/build/parsedPaper/research/researches/index.js.map +1 -1
- package/build/parsedPaper/structure/tree/FormattingElement.js +3 -9
- package/build/parsedPaper/structure/tree/FormattingElement.js.map +1 -1
- package/build/parsedPaper/structure/tree/SourceCodeLocation.js +1 -7
- package/build/parsedPaper/structure/tree/SourceCodeLocation.js.map +1 -1
- package/build/parsedPaper/structure/tree/TextContainer.js +5 -10
- package/build/parsedPaper/structure/tree/TextContainer.js.map +1 -1
- package/build/parsedPaper/structure/tree/index.js +9 -74
- package/build/parsedPaper/structure/tree/index.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/Heading.js +3 -9
- package/build/parsedPaper/structure/tree/nodes/Heading.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/LeafNode.js +5 -12
- package/build/parsedPaper/structure/tree/nodes/LeafNode.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/List.js +5 -11
- package/build/parsedPaper/structure/tree/nodes/List.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/ListItem.js +3 -10
- package/build/parsedPaper/structure/tree/nodes/ListItem.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/MetadataMiscellaneous.js +3 -9
- package/build/parsedPaper/structure/tree/nodes/MetadataMiscellaneous.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/MetadataText.js +3 -9
- package/build/parsedPaper/structure/tree/nodes/MetadataText.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/Node.js +6 -12
- package/build/parsedPaper/structure/tree/nodes/Node.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/Paragraph.js +3 -9
- package/build/parsedPaper/structure/tree/nodes/Paragraph.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/StructuredNode.js +3 -10
- package/build/parsedPaper/structure/tree/nodes/StructuredNode.js.map +1 -1
- package/build/parsedPaper/structure/tree/nodes/index.js +10 -69
- package/build/parsedPaper/structure/tree/nodes/index.js.map +1 -1
- package/build/scoring/assessments/assessment.js +17 -15
- package/build/scoring/assessments/assessment.js.map +1 -1
- package/build/scoring/assessments/index.js +53 -56
- package/build/scoring/assessments/index.js.map +1 -1
- package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js +30 -47
- package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/RelatedKeywordsAssessment.js +98 -0
- package/build/scoring/assessments/readability/RelatedKeywordsAssessment.js.map +1 -0
- package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js +22 -35
- package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js +24 -39
- package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/TransitionWordsAssessment.js +29 -47
- package/build/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/FAQsAssessment.js +162 -0
- package/build/scoring/assessments/seo/FAQsAssessment.js.map +1 -0
- package/build/scoring/assessments/seo/ImageCountAssessment.js +17 -33
- package/build/scoring/assessments/seo/ImageCountAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/InternalLinksAssessment.js +21 -35
- package/build/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js +20 -34
- package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeyphraseAssessment.js +18 -32
- package/build/scoring/assessments/seo/KeyphraseAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js +21 -34
- package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeywordDensityAssessment.js +26 -40
- package/build/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +23 -42
- package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js +19 -34
- package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js +25 -41
- package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js +16 -30
- package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/OutboundLinksAssessment.js +21 -40
- package/build/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/PageTitleWidthAssessment.js +17 -31
- package/build/scoring/assessments/seo/PageTitleWidthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/SchemaAssessment.js +95 -0
- package/build/scoring/assessments/seo/SchemaAssessment.js.map +1 -0
- package/build/scoring/assessments/seo/SingleH1Assessment.js +20 -33
- package/build/scoring/assessments/seo/SingleH1Assessment.js.map +1 -1
- package/build/scoring/assessments/seo/SingleTitleAssessment.js +20 -33
- package/build/scoring/assessments/seo/SingleTitleAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js +18 -35
- package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/TextImagesAssessment.js +20 -36
- package/build/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/TextLengthAssessment.js +21 -37
- package/build/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/UrlKeywordAssessment.js +20 -36
- package/build/scoring/assessments/seo/UrlKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/UrlLengthAssessment.js +19 -33
- package/build/scoring/assessments/seo/UrlLengthAssessment.js.map +1 -1
- package/build/scoring/assessors/assessor.js +53 -33
- package/build/scoring/assessors/assessor.js.map +1 -1
- package/build/scoring/assessors/avadaAssessor.js +37 -17
- package/build/scoring/assessors/avadaAssessor.js.map +1 -1
- package/build/scoring/assessors/contentAssessor.js +16 -22
- package/build/scoring/assessors/contentAssessor.js.map +1 -1
- package/build/scoring/assessors/index.js +4 -34
- package/build/scoring/assessors/index.js.map +1 -1
- package/build/scoring/assessors/seoAssessor.js +27 -32
- package/build/scoring/assessors/seoAssessor.js.map +1 -1
- package/build/scoring/helpers/assessments/checkForTooLongSentences.js +3 -8
- package/build/scoring/helpers/assessments/checkForTooLongSentences.js.map +1 -1
- package/build/scoring/helpers/assessments/inRange.js +2 -10
- package/build/scoring/helpers/assessments/inRange.js.map +1 -1
- package/build/scoring/helpers/assessments/keyphraseLengthFactor.js +1 -7
- package/build/scoring/helpers/assessments/keyphraseLengthFactor.js.map +1 -1
- package/build/scoring/helpers/assessments/recommendedKeywordCount.js +5 -11
- package/build/scoring/helpers/assessments/recommendedKeywordCount.js.map +1 -1
- package/build/scoring/helpers/index.js +27 -18
- package/build/scoring/helpers/index.js.map +1 -1
- package/build/scoring/interpreters/index.js +2 -13
- package/build/scoring/interpreters/index.js.map +1 -1
- package/build/scoring/interpreters/scoreToRating.js +1 -7
- package/build/scoring/interpreters/scoreToRating.js.map +1 -1
- package/build/scoring/renderers/AssessorPresenter.js +12 -18
- package/build/scoring/renderers/AssessorPresenter.js.map +1 -1
- package/build/scoring/scoreAggregators/ReadabilityScoreAggregator.js +8 -14
- package/build/scoring/scoreAggregators/ReadabilityScoreAggregator.js.map +1 -1
- package/build/scoring/scoreAggregators/SEOScoreAggregator.js +3 -9
- package/build/scoring/scoreAggregators/SEOScoreAggregator.js.map +1 -1
- package/build/scoring/scoreAggregators/ScoreAggregator.js +1 -7
- package/build/scoring/scoreAggregators/ScoreAggregator.js.map +1 -1
- package/build/scoring/scoreAggregators/index.js +3 -27
- package/build/scoring/scoreAggregators/index.js.map +1 -1
- package/build/values/AssessmentResult.js +31 -57
- package/build/values/AssessmentResult.js.map +1 -1
- package/build/values/Mark.js +9 -15
- package/build/values/Mark.js.map +1 -1
- package/build/values/Paper.js +115 -16
- package/build/values/Paper.js.map +1 -1
- package/build/values/index.js +4 -27
- package/build/values/index.js.map +1 -1
- package/build/vendor/turkishStemmer.js +1 -7
- package/build/vendor/turkishStemmer.js.map +1 -1
- package/package.json +10 -2
- package/build/bundledPlugins/index.js +0 -14
- package/build/bundledPlugins/index.js.map +0 -1
- package/build/bundledPlugins/previouslyUsedKeywords.js +0 -171
- package/build/bundledPlugins/previouslyUsedKeywords.js.map +0 -1
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = stem;
|
|
7
|
-
var _index = require("../../../index");
|
|
8
|
-
var _stemHelpers = require("./stemHelpers");
|
|
1
|
+
import { languageProcessing } from "../../../../../index.js";
|
|
9
2
|
const {
|
|
10
3
|
flattenSortLength,
|
|
11
4
|
buildFormRule,
|
|
12
5
|
createRulesFromArrays
|
|
13
|
-
} =
|
|
6
|
+
} = languageProcessing;
|
|
7
|
+
import { calculateTotalNumberOfSyllables, removeEnding, checkBeginningsList } from "./stemHelpers";
|
|
8
|
+
|
|
14
9
|
/**
|
|
15
10
|
* MIT License
|
|
16
11
|
*
|
|
@@ -54,14 +49,14 @@ const checkSingleSyllableWordSuffix = function (word, suffixesArray) {
|
|
|
54
49
|
*/
|
|
55
50
|
const stemSingleSyllableWordsPrefixes = function (word, morphologyData) {
|
|
56
51
|
// If the word gets prefix di-, stem the prefix here. E.g. dicekkanlah -> cekkanlah, dibomi -> bomi
|
|
57
|
-
if (word.startsWith('di') &&
|
|
52
|
+
if (word.startsWith('di') && checkBeginningsList(word, 2, morphologyData.stemming.singleSyllableWords)) {
|
|
58
53
|
return word.substring(2, word.length);
|
|
59
54
|
}
|
|
60
55
|
/*
|
|
61
56
|
* If the word gets prefix menge-/penge- and is followed by one of the words in the list, stem the prefix here.
|
|
62
57
|
* E.g. pengeboman -> boman
|
|
63
58
|
*/
|
|
64
|
-
if (/^[mp]enge/i.test(word) &&
|
|
59
|
+
if (/^[mp]enge/i.test(word) && checkBeginningsList(word, 5, morphologyData.stemming.singleSyllableWords)) {
|
|
65
60
|
return word.substring(5, word.length);
|
|
66
61
|
}
|
|
67
62
|
return word;
|
|
@@ -86,15 +81,15 @@ const stemSingleSyllableWords = function (word, morphologyData) {
|
|
|
86
81
|
word = stemSingleSyllableWordsPrefixes(word, morphologyData);
|
|
87
82
|
|
|
88
83
|
// Check if a word starts with one of the words in the list, has maximum 3 syllables, and ends in one of the single syllable suffixes
|
|
89
|
-
if (singleSyllableWords.some(shortWord => word.startsWith(shortWord)) &&
|
|
84
|
+
if (singleSyllableWords.some(shortWord => word.startsWith(shortWord)) && calculateTotalNumberOfSyllables(word) <= 3 && checkSingleSyllableWordSuffix(word, suffixCombination)) {
|
|
90
85
|
// If the word gets a particle suffix, stem the particle. E.g. cekkanlah -> cekkan, pelkan -> pel, vasmulah -> vasmu
|
|
91
|
-
word =
|
|
86
|
+
word = removeEnding(word, morphologyData.stemming.regexRules.removeParticle, morphologyData.stemming.doNotStemWords.doNotStemParticle, morphologyData);
|
|
92
87
|
|
|
93
88
|
// If the word gets a possessive pronoun suffix, stem the possessive pronoun. E.g. vasmu -> vas
|
|
94
|
-
word =
|
|
89
|
+
word = removeEnding(word, morphologyData.stemming.regexRules.removePronoun, morphologyData.stemming.doNotStemWords.doNotStemPronounSuffix, morphologyData);
|
|
95
90
|
|
|
96
91
|
// If the word ends in -kan/-an/-i suffix, stem the suffix. E.g. cekkan -> cek, bomi -> bom
|
|
97
|
-
const wordWithoutDerivationalSuffix =
|
|
92
|
+
const wordWithoutDerivationalSuffix = removeEnding(word, morphologyData.stemming.regexRules.removeSuffixes, morphologyData.stemming.doNotStemWords.doNotStemSuffix, morphologyData);
|
|
98
93
|
if (singleSyllableWords.includes(wordWithoutDerivationalSuffix)) {
|
|
99
94
|
word = wordWithoutDerivationalSuffix;
|
|
100
95
|
}
|
|
@@ -103,7 +98,7 @@ const stemSingleSyllableWords = function (word, morphologyData) {
|
|
|
103
98
|
* We only want to stem single syllable words here.
|
|
104
99
|
* Thus, if the output word has more than one syllable, we don't stem the input word at all.
|
|
105
100
|
*/
|
|
106
|
-
if (
|
|
101
|
+
if (calculateTotalNumberOfSyllables(word) > 1 || word.length === 1) {
|
|
107
102
|
word = inputWord;
|
|
108
103
|
}
|
|
109
104
|
return word;
|
|
@@ -131,7 +126,7 @@ const tryStemmingKeAndTer = function (morphologyData, word) {
|
|
|
131
126
|
return word;
|
|
132
127
|
}
|
|
133
128
|
// If word (without prefixes) is on the list of words beginning with -r, remove only -te instead of -ter.
|
|
134
|
-
if (
|
|
129
|
+
if (checkBeginningsList(word, 3, morphologyData.stemming.beginningModification.rBeginning)) {
|
|
135
130
|
return word.replace(/^ter/i, 'r');
|
|
136
131
|
}
|
|
137
132
|
// Otherwise, remove -ter.
|
|
@@ -153,17 +148,17 @@ const checkFirstOrderPrefixExceptions = function (word, morphologyData) {
|
|
|
153
148
|
|
|
154
149
|
// If a word starts with "men" or "pen" and is present in the nBeginning exception list, the prefix should be replaced with "n".
|
|
155
150
|
if (/^[mp]en/i.test(word)) {
|
|
156
|
-
if (
|
|
151
|
+
if (checkBeginningsList(word, 3, beginningModification.nBeginning)) {
|
|
157
152
|
return word.replace(/^[mp]en/i, 'n');
|
|
158
153
|
}
|
|
159
154
|
}
|
|
160
|
-
if (/^[mp]eng/i.test(word) &&
|
|
155
|
+
if (/^[mp]eng/i.test(word) && checkBeginningsList(word, 4, beginningModification.kBeginning)) {
|
|
161
156
|
return word.replace(/^[mp]eng/i, 'k');
|
|
162
157
|
}
|
|
163
158
|
if (/^[mp]em/i.test(word)) {
|
|
164
|
-
if (
|
|
159
|
+
if (checkBeginningsList(word, 3, beginningModification.pBeginning)) {
|
|
165
160
|
return word.replace(/^(mem|pem)/i, 'p');
|
|
166
|
-
} else if (
|
|
161
|
+
} else if (checkBeginningsList(word, 3, beginningModification.mBeginning)) {
|
|
167
162
|
return word.replace(/^(mem|pem)/i, 'm');
|
|
168
163
|
}
|
|
169
164
|
}
|
|
@@ -203,11 +198,11 @@ const removeFirstOrderPrefix = function (word, morphologyData) {
|
|
|
203
198
|
*/
|
|
204
199
|
const removeSecondOrderPrefix = function (word, morphologyData) {
|
|
205
200
|
// If a word starts with "ber" or "per" and is present in the rBeginning exception list, the prefix should be replaced with "r".
|
|
206
|
-
if ((word.startsWith('ber') || word.startsWith('per')) &&
|
|
201
|
+
if ((word.startsWith('ber') || word.startsWith('per')) && checkBeginningsList(word, 3, morphologyData.stemming.beginningModification.rBeginning)) {
|
|
207
202
|
return word.replace(/^(ber|per)/i, 'r');
|
|
208
203
|
}
|
|
209
204
|
// If a word starts with a first order prefix followed by peng- and is in the kBeginning exception list, then peng- should be replaced with k.
|
|
210
|
-
if (/^peng/i.test(word) &&
|
|
205
|
+
if (/^peng/i.test(word) && checkBeginningsList(word, 4, morphologyData.stemming.beginningModification.kBeginning)) {
|
|
211
206
|
return word.replace(/^peng/i, 'k');
|
|
212
207
|
}
|
|
213
208
|
const regex = createRulesFromArrays(morphologyData.stemming.regexRules.removeSecondOrderPrefixes);
|
|
@@ -247,8 +242,8 @@ const stemDerivational = function (word, morphologyData) {
|
|
|
247
242
|
word = removeSecondOrderPrefix(word, morphologyData);
|
|
248
243
|
}
|
|
249
244
|
// If the word has more than 2 syllables and ends in either -kan, -an, or -i suffixes, the suffix will be deleted here, e.g., anakan -> anak
|
|
250
|
-
if (
|
|
251
|
-
word =
|
|
245
|
+
if (calculateTotalNumberOfSyllables(word) > 2) {
|
|
246
|
+
word = removeEnding(word, removeSuffixRules, removeSuffixExceptions, morphologyData);
|
|
252
247
|
}
|
|
253
248
|
} else {
|
|
254
249
|
// If the word previously had a first order prefix, assign wordLength to the length of the word after prefix deletion.
|
|
@@ -257,8 +252,8 @@ const stemDerivational = function (word, morphologyData) {
|
|
|
257
252
|
* If the word after first order prefix deletion is bigger than 2 and ends in either -kan, -an, or -i suffixes,
|
|
258
253
|
* the suffix will be stemmed here. e.g. penyebaran - sebar.
|
|
259
254
|
*/
|
|
260
|
-
if (
|
|
261
|
-
word =
|
|
255
|
+
if (calculateTotalNumberOfSyllables(word) > 2) {
|
|
256
|
+
word = removeEnding(word, removeSuffixRules, removeSuffixExceptions, morphologyData);
|
|
262
257
|
}
|
|
263
258
|
/*
|
|
264
259
|
* If the word previously had a suffix, we check further if the word after first order prefix and suffix deletion has more than 2 syllables.
|
|
@@ -266,7 +261,7 @@ const stemDerivational = function (word, morphologyData) {
|
|
|
266
261
|
* be stemmed here unless the word is in the exception list of words with a beginning that looks like a second order prefix.
|
|
267
262
|
*/
|
|
268
263
|
if (wordLength !== word.length && !doNotStemSecondOrderPrefix.includes(word)) {
|
|
269
|
-
if (
|
|
264
|
+
if (calculateTotalNumberOfSyllables(word) > 2) {
|
|
270
265
|
word = removeSecondOrderPrefix(word, morphologyData);
|
|
271
266
|
}
|
|
272
267
|
}
|
|
@@ -288,7 +283,7 @@ const stemSingular = function (word, morphologyData) {
|
|
|
288
283
|
word = singleSyllableWords;
|
|
289
284
|
const doNotStemParticle = morphologyData.stemming.doNotStemWords.doNotStemParticle;
|
|
290
285
|
const doNotStemPronoun = morphologyData.stemming.doNotStemWords.doNotStemPronounSuffix;
|
|
291
|
-
if (
|
|
286
|
+
if (calculateTotalNumberOfSyllables(word) <= 2) {
|
|
292
287
|
return word;
|
|
293
288
|
}
|
|
294
289
|
|
|
@@ -303,16 +298,16 @@ const stemSingular = function (word, morphologyData) {
|
|
|
303
298
|
* If the word has more than 2 syllables and ends in of the particle endings (i.e. -kah, -lah, -pun), stem the particle here.
|
|
304
299
|
* e.g. bajumulah -> bajumu, bawalah -> bawa
|
|
305
300
|
*/
|
|
306
|
-
word =
|
|
301
|
+
word = removeEnding(word, morphologyData.stemming.regexRules.removeParticle, doNotStemParticle, morphologyData);
|
|
307
302
|
|
|
308
303
|
// If the word (still) has more than 2 syllables and ends in of the possessive pronoun endings (i.e. -ku, -mu, -nya), stem the ending here.
|
|
309
|
-
if (
|
|
304
|
+
if (calculateTotalNumberOfSyllables(word) > 2) {
|
|
310
305
|
// E.g. bajumu -> baju
|
|
311
|
-
word =
|
|
306
|
+
word = removeEnding(word, morphologyData.stemming.regexRules.removePronoun, doNotStemPronoun, morphologyData);
|
|
312
307
|
}
|
|
313
308
|
|
|
314
309
|
// If the word (still) has more than 2 syllables and has derivational affixes, the affix(es) will be stemmed here.
|
|
315
|
-
if (
|
|
310
|
+
if (calculateTotalNumberOfSyllables(word) > 2) {
|
|
316
311
|
word = stemDerivational(word, morphologyData);
|
|
317
312
|
}
|
|
318
313
|
return word;
|
|
@@ -379,7 +374,7 @@ const stemPlural = function (word, morphologyData) {
|
|
|
379
374
|
*
|
|
380
375
|
* @returns {string} The stem of an Indonesian word.
|
|
381
376
|
*/
|
|
382
|
-
function stem(word, morphologyData) {
|
|
377
|
+
export default function stem(word, morphologyData) {
|
|
383
378
|
// Check words that shouldn't receive any stemming.
|
|
384
379
|
if (morphologyData.stemming.shouldNotBeStemmed.includes(word)) {
|
|
385
380
|
return word;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stem.js","names":["_index","require","_stemHelpers","flattenSortLength","buildFormRule","createRulesFromArrays","languageProcessing","checkSingleSyllableWordSuffix","word","suffixesArray","suffix","match","stemSingleSyllableWordsPrefixes","morphologyData","startsWith","checkBeginningsList","stemming","singleSyllableWords","substring","length","test","stemSingleSyllableWords","suffixCombination","singleSyllableWordsSuffixes","inputWord","some","shortWord","calculateTotalNumberOfSyllables","removeEnding","regexRules","removeParticle","doNotStemWords","doNotStemParticle","removePronoun","doNotStemPronounSuffix","wordWithoutDerivationalSuffix","removeSuffixes","doNotStemSuffix","includes","tryStemmingKeAndTer","terException","doNotStemPrefix","doNotStemFirstOrderPrefix","doNotStemTer","wordWithTer","beginningModification","rBeginning","replace","checkFirstOrderPrefixExceptions","nBeginning","kBeginning","pBeginning","mBeginning","wordAfterKeTerCheck","removeFirstOrderPrefix","firstOrderPrefixException","regex","removeFirstOrderPrefixes","withRemovedFirstOrderPrefix","removeSecondOrderPrefix","removeSecondOrderPrefixes","withRemovedSecondOrderPrefix","stemDerivational","wordLength","removeSuffixRules","removeSuffixExceptions","doNotStemSecondOrderPrefix","wordWithPrefixLookAlike","stemSingular","doNotStemPronoun","firstDerivationalStem","stemPlural","hyphenIndex","indexOf","splitWord","split","firstPart","secondPart","firstPartBeginningTrimmed","secondPartBeginningTrimmed","nonPlurals","nonPluralReduplications","stem","shouldNotBeStemmed","stemmedPlural"],"sources":["../../../../../../src/languageProcessing/languages/id/helpers/internal/stem.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {flattenSortLength, buildFormRule, createRulesFromArrays} = languageProcessing;\n\nimport {calculateTotalNumberOfSyllables, removeEnding, checkBeginningsList} from './stemHelpers';\n\n/**\n * MIT License\n *\n * Adapted from: Copyright (c) 2013 Adinda Praditya\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software\n * and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction,\n * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\"\n */\n\n/**\n * Checks if a single syllable word has one of the suffixes/suffix combination.\n *\n * @param {string} word The word to check.\n * @param {Array} suffixesArray The array of suffixes\n * @returns {boolean} Whether the word ends in one of the suffixes or not.\n */\nconst checkSingleSyllableWordSuffix = function(word, suffixesArray) {\n for (const suffix of suffixesArray) {\n if (word.match(suffix)) {\n return true;\n }\n }\n};\n\n/**\n * Stems the prefix of the single syllable words, i.e. di-/penge-/menge-\n *\n * @param {string}\tword\t\t\tThe word to check.\n * @param {Object}\tmorphologyData\tThe Indonesian morphology data file.\n *\n * @returns {string} The stemmed word.\n */\nconst stemSingleSyllableWordsPrefixes = function(word, morphologyData) {\n // If the word gets prefix di-, stem the prefix here. E.g. dicekkanlah -> cekkanlah, dibomi -> bomi\n if (\n word.startsWith('di') &&\n checkBeginningsList(word, 2, morphologyData.stemming.singleSyllableWords)\n ) {\n return word.substring(2, word.length);\n }\n /*\n * If the word gets prefix menge-/penge- and is followed by one of the words in the list, stem the prefix here.\n * E.g. pengeboman -> boman\n */\n if (\n /^[mp]enge/i.test(word) &&\n checkBeginningsList(word, 5, morphologyData.stemming.singleSyllableWords)\n ) {\n return word.substring(5, word.length);\n }\n return word;\n};\n\n/**\n * Stems Indonesian single syllable words. This function concerns single syllable words\n * with this possible word format [di/penge/menge] + single syllable word + [kan/an/i] + [ku/mu/nya] + [kah/lah/pun], with [] being optional.\n * E.g. dipel -> pel, dipelkan -> pel, dipelkanlah -> pel, pelkan -> pel, pelmulah -> pel, pengeboman -> bom, mengesahkan -> sah\n *\n *\n * @param {string}\tword\t\t\tThe word to check.\n * @param {Object}\tmorphologyData\tThe Indonesian morphology data file.\n *\n * @returns {string} The stemmed word.\n */\nconst stemSingleSyllableWords = function(word, morphologyData) {\n const singleSyllableWords = morphologyData.stemming.singleSyllableWords;\n const suffixCombination = morphologyData.stemming.singleSyllableWordsSuffixes;\n const inputWord = word;\n // If the word starts with prefix di-/penge-/menge-, stem the prefix here. E.g. pengeboman -> boman, dipelkan -> pelkan\n word = stemSingleSyllableWordsPrefixes(word, morphologyData);\n\n // Check if a word starts with one of the words in the list, has maximum 3 syllables, and ends in one of the single syllable suffixes\n if (\n singleSyllableWords.some(shortWord => word.startsWith(shortWord)) &&\n calculateTotalNumberOfSyllables(word) <= 3 &&\n checkSingleSyllableWordSuffix(word, suffixCombination)\n ) {\n // If the word gets a particle suffix, stem the particle. E.g. cekkanlah -> cekkan, pelkan -> pel, vasmulah -> vasmu\n word = removeEnding(\n word,\n morphologyData.stemming.regexRules.removeParticle,\n morphologyData.stemming.doNotStemWords.doNotStemParticle,\n morphologyData\n );\n\n // If the word gets a possessive pronoun suffix, stem the possessive pronoun. E.g. vasmu -> vas\n word = removeEnding(\n word,\n morphologyData.stemming.regexRules.removePronoun,\n morphologyData.stemming.doNotStemWords.doNotStemPronounSuffix,\n morphologyData\n );\n\n // If the word ends in -kan/-an/-i suffix, stem the suffix. E.g. cekkan -> cek, bomi -> bom\n const wordWithoutDerivationalSuffix = removeEnding(\n word,\n morphologyData.stemming.regexRules.removeSuffixes,\n morphologyData.stemming.doNotStemWords.doNotStemSuffix,\n morphologyData\n );\n\n if (singleSyllableWords.includes(wordWithoutDerivationalSuffix)) {\n word = wordWithoutDerivationalSuffix;\n }\n }\n /*\n * We only want to stem single syllable words here.\n * Thus, if the output word has more than one syllable, we don't stem the input word at all.\n */\n if (calculateTotalNumberOfSyllables(word) > 1 || word.length === 1) {\n word = inputWord;\n }\n return word;\n};\n\n/**\n * Tries stemming prefixes ke- and ter-. Ke- is always stemmed, and ter- only if it is a prefix and not part of the stem.\n * Also if the stem of the word begins with r-, only te- is stemmed, not ter-.\n *\n * @param {Object}\tmorphologyData\tThe Indonesian morphology data file.\n * @param {string}\tword\t\t\tThe word to check.\n *\n * @returns {string|null}\tThe stem or null if the word did not start with ter/keter.\n */\nconst tryStemmingKeAndTer = function(morphologyData, word) {\n const terException =\n morphologyData.stemming.doNotStemWords.doNotStemPrefix.doNotStemFirstOrderPrefix.doNotStemTer;\n\n // If prefix -ter is preceded by prefix -ke, remove it first.\n if (word.startsWith('keter')) {\n word = word.substring(2, word.length);\n }\n if (word.startsWith('ter')) {\n // If word is on an exception list of words where -ter should not be stemmed, do not stem -ter and return the word.\n if (terException.some(wordWithTer => word.startsWith(wordWithTer))) {\n return word;\n }\n // If word (without prefixes) is on the list of words beginning with -r, remove only -te instead of -ter.\n if (checkBeginningsList(word, 3, morphologyData.stemming.beginningModification.rBeginning)) {\n return word.replace(/^ter/i, 'r');\n }\n // Otherwise, remove -ter.\n return word.substring(3, word.length);\n }\n};\n/**\n * Checks whether a word has a first order prefix and whether it is on an exception list of words which require a stem mofification\n * after removing the prefix. Returns the stem if the prefix was found and the word was matched on an exception list.\n *\n *\n * @param {string}\tword\t\t\tThe word to check.\n * @param {Object}\tmorphologyData\tThe Indonesian morphology data file.\n *\n * @returns {string|null}\tThe stem or null if a prefix was not found, or was found but the word was not on the exception list.\n */\nconst checkFirstOrderPrefixExceptions = function(word, morphologyData) {\n const beginningModification = morphologyData.stemming.beginningModification;\n\n // If a word starts with \"men\" or \"pen\" and is present in the nBeginning exception list, the prefix should be replaced with \"n\".\n if (/^[mp]en/i.test(word)) {\n if (checkBeginningsList(word, 3, beginningModification.nBeginning)) {\n return word.replace(/^[mp]en/i, 'n');\n }\n }\n if (/^[mp]eng/i.test(word) && checkBeginningsList(word, 4, beginningModification.kBeginning)) {\n return word.replace(/^[mp]eng/i, 'k');\n }\n\n if (/^[mp]em/i.test(word)) {\n if (checkBeginningsList(word, 3, beginningModification.pBeginning)) {\n return word.replace(/^(mem|pem)/i, 'p');\n } else if (checkBeginningsList(word, 3, beginningModification.mBeginning)) {\n return word.replace(/^(mem|pem)/i, 'm');\n }\n }\n // Stem prefix ke- if found. Stem te(r)- unless the word was found on the exception list of words with stem beginning in -ter.\n const wordAfterKeTerCheck = tryStemmingKeAndTer(morphologyData, word);\n if (wordAfterKeTerCheck) {\n return wordAfterKeTerCheck;\n }\n};\n\n/**\n * Stems the first-order prefix of a word based on regexRules. If the word is found in an exception list, implements a stem modification.\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stemmed word.\n */\nconst removeFirstOrderPrefix = function(word, morphologyData) {\n // Checks whether the word has a first order prefix and requires a stem modification.\n const firstOrderPrefixException = checkFirstOrderPrefixExceptions(word, morphologyData);\n\n if (firstOrderPrefixException) {\n return firstOrderPrefixException;\n }\n const regex = createRulesFromArrays(morphologyData.stemming.regexRules.removeFirstOrderPrefixes);\n const withRemovedFirstOrderPrefix = buildFormRule(word, regex);\n\n return withRemovedFirstOrderPrefix || word;\n};\n\n/**\n * Stems the second-order prefix of a word based on regexRules. If the word is found in an exception list, implements a stem modification.\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stemmed word.\n */\nconst removeSecondOrderPrefix = function(word, morphologyData) {\n // If a word starts with \"ber\" or \"per\" and is present in the rBeginning exception list, the prefix should be replaced with \"r\".\n if (\n (word.startsWith('ber') || word.startsWith('per')) &&\n checkBeginningsList(word, 3, morphologyData.stemming.beginningModification.rBeginning)\n ) {\n return word.replace(/^(ber|per)/i, 'r');\n }\n // If a word starts with a first order prefix followed by peng- and is in the kBeginning exception list, then peng- should be replaced with k.\n if (\n /^peng/i.test(word) &&\n checkBeginningsList(word, 4, morphologyData.stemming.beginningModification.kBeginning)\n ) {\n return word.replace(/^peng/i, 'k');\n }\n const regex = createRulesFromArrays(morphologyData.stemming.regexRules.removeSecondOrderPrefixes);\n const withRemovedSecondOrderPrefix = buildFormRule(word, regex);\n\n return withRemovedSecondOrderPrefix || word;\n};\n\n/**\n * Stems derivational affixes of Indonesian words.\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stemmed word.\n */\nconst stemDerivational = function(word, morphologyData) {\n let wordLength = word.length;\n const removeSuffixRules = morphologyData.stemming.regexRules.removeSuffixes;\n const removeSuffixExceptions = morphologyData.stemming.doNotStemWords.doNotStemSuffix;\n const doNotStemFirstOrderPrefix = flattenSortLength(\n morphologyData.stemming.doNotStemWords.doNotStemPrefix.doNotStemFirstOrderPrefix\n );\n const doNotStemSecondOrderPrefix = flattenSortLength(\n morphologyData.stemming.doNotStemWords.doNotStemPrefix.doNotStemSecondOrderPrefix\n );\n\n // If a word is in the list of words with a beginning that looks like a valid suffix, do not stem the suffix\n if (\n !doNotStemFirstOrderPrefix.some(wordWithPrefixLookAlike =>\n word.startsWith(wordWithPrefixLookAlike)\n )\n ) {\n /*\n * If the word has more than 2 syllables and starts with one of first order prefixes (i.e. meng-, meny-, men-, mem-, me-,\n * peng-, peny-, pen-, pem-, di-, ter-, ke- ), the prefix will be stemmed here. e.g. penyebaran -> sebaran, diperlebarkan -> perlebarkan\n */\n word = removeFirstOrderPrefix(word, morphologyData);\n }\n\n if (wordLength === word.length) {\n if (\n !doNotStemSecondOrderPrefix.some(wordWithPrefixLookAlike =>\n word.startsWith(wordWithPrefixLookAlike)\n )\n ) {\n /*\n * If the word does not start with one of the first order prefixes but starts with one of the second order prefixes,\n * the prefix will be stemmed here, e.g., peranakan -> anakan\n */\n word = removeSecondOrderPrefix(word, morphologyData);\n }\n // If the word has more than 2 syllables and ends in either -kan, -an, or -i suffixes, the suffix will be deleted here, e.g., anakan -> anak\n if (calculateTotalNumberOfSyllables(word) > 2) {\n word = removeEnding(word, removeSuffixRules, removeSuffixExceptions, morphologyData);\n }\n } else {\n // If the word previously had a first order prefix, assign wordLength to the length of the word after prefix deletion.\n wordLength = word.length;\n /*\n * If the word after first order prefix deletion is bigger than 2 and ends in either -kan, -an, or -i suffixes,\n * the suffix will be stemmed here. e.g. penyebaran - sebar.\n */\n if (calculateTotalNumberOfSyllables(word) > 2) {\n word = removeEnding(word, removeSuffixRules, removeSuffixExceptions, morphologyData);\n }\n /*\n * If the word previously had a suffix, we check further if the word after first order prefix and suffix deletion has more than 2 syllables.\n * If it does have more than 2 syllables and starts with one of the second order prefixes (i.e. ber-, be-, per-, pe-), the prefix will\n * be stemmed here unless the word is in the exception list of words with a beginning that looks like a second order prefix.\n */\n if (wordLength !== word.length && !doNotStemSecondOrderPrefix.includes(word)) {\n if (calculateTotalNumberOfSyllables(word) > 2) {\n word = removeSecondOrderPrefix(word, morphologyData);\n }\n }\n }\n return word;\n};\n\n/**\n * Stems Indonesian singular words.\n *\n * @param {string} word The singular word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stem of an Indonesian singular word.\n */\nconst stemSingular = function(word, morphologyData) {\n const singleSyllableWords = stemSingleSyllableWords(word, morphologyData);\n // Stem the single syllable words\n word = singleSyllableWords;\n\n const doNotStemParticle = morphologyData.stemming.doNotStemWords.doNotStemParticle;\n const doNotStemPronoun = morphologyData.stemming.doNotStemWords.doNotStemPronounSuffix;\n\n if (calculateTotalNumberOfSyllables(word) <= 2) {\n return word;\n }\n\n // Check if a word after its derivational affixes stemmed exists in the exception list.\n const firstDerivationalStem = stemDerivational(word, morphologyData);\n if (\n doNotStemParticle.includes(firstDerivationalStem) ||\n doNotStemPronoun.includes(firstDerivationalStem)\n ) {\n // If it does exist in the exception list, the ending that looks like a particle or a pronoun suffix should not be stemmed.\n return firstDerivationalStem;\n }\n\n /*\n * If the word has more than 2 syllables and ends in of the particle endings (i.e. -kah, -lah, -pun), stem the particle here.\n * e.g. bajumulah -> bajumu, bawalah -> bawa\n */\n word = removeEnding(\n word,\n morphologyData.stemming.regexRules.removeParticle,\n doNotStemParticle,\n morphologyData\n );\n\n // If the word (still) has more than 2 syllables and ends in of the possessive pronoun endings (i.e. -ku, -mu, -nya), stem the ending here.\n if (calculateTotalNumberOfSyllables(word) > 2) {\n // E.g. bajumu -> baju\n word = removeEnding(\n word,\n morphologyData.stemming.regexRules.removePronoun,\n doNotStemPronoun,\n morphologyData\n );\n }\n\n // If the word (still) has more than 2 syllables and has derivational affixes, the affix(es) will be stemmed here.\n if (calculateTotalNumberOfSyllables(word) > 2) {\n word = stemDerivational(word, morphologyData);\n }\n return word;\n};\n\n/**\n * Stems Indonesian plural words.\n *\n * @param {string} word The plural word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string|null} The stem of an Indonesian plural word or null if no plural was detected.\n */\nconst stemPlural = function(word, morphologyData) {\n const hyphenIndex = word.indexOf('-');\n\n // If there is no hyphen in the word, it can't be a reduplicated plural.\n if (hyphenIndex === -1) {\n return null;\n }\n\n const splitWord = word.split('-');\n\n if (splitWord.length === 2) {\n let firstPart = splitWord[0];\n let secondPart = splitWord[1];\n\n firstPart = stemSingular(firstPart, morphologyData);\n secondPart = stemSingular(secondPart, morphologyData);\n\n /*\n * To compare the first and second part and see whether it's actually a reduplication:\n * Trim the beginning of the word since it might be variable due to stem changes caused by prefixes.\n * For example, in \"meniru-nirukan\" the singular stemmer will correctly stem the first \"niru\" to \"tiru\" because\n * of the prefix \"me\". Since the second part of the word is stemmed individually, there is no \"me\" and hence\n * \"niru\" remains \"niru\". To still be able to link these two forms to each other,\n * we compare the two parts of the word after stripping the variable first or first and second letter.\n *\n */\n const firstPartBeginningTrimmed = firstPart.substring(1);\n const secondPartBeginningTrimmed =\n secondPart.startsWith('ng') || secondPart.startsWith('ny')\n ? secondPart.substring(2)\n : secondPart.substring(1);\n\n if (firstPartBeginningTrimmed === secondPartBeginningTrimmed) {\n const nonPlurals = morphologyData.stemming.nonPluralReduplications;\n\n // Check non-plural reduplication.\n if (nonPlurals.includes(firstPart) && nonPlurals.includes(secondPart)) {\n /*\n * In words such as \"mengira-ngira\" prefix \"me\" causes a modification on both words (k->ng). This will\n * be correctly stemmed for the first word, but not the second. Therefore, the correct base form\n * \"kira-kira\" is created based on a reduplication of the correctly stemmed first part, \"kira\".\n */\n return firstPart + '-' + firstPart;\n }\n\n // Return the stemmed singular form of a reduplicated plural.\n return firstPart;\n }\n }\n\n return null;\n};\n\n/**\n * Stems Indonesian words\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stem of an Indonesian word.\n */\nexport default function stem(word, morphologyData) {\n // Check words that shouldn't receive any stemming.\n if (morphologyData.stemming.shouldNotBeStemmed.includes(word)) {\n return word;\n }\n\n const stemmedPlural = stemPlural(word, morphologyData);\n\n if (stemmedPlural) {\n return stemmedPlural;\n }\n\n word = stemSingular(word, morphologyData);\n\n return word;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,YAAA,GAAAD,OAAA;AAFA,MAAM;EAACE,iBAAiB;EAAEC,aAAa;EAAEC;AAAqB,CAAC,GAAGC,yBAAkB;AAIpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,6BAA6B,GAAG,SAAAA,CAASC,IAAI,EAAEC,aAAa,EAAE;EAClE,KAAK,MAAMC,MAAM,IAAID,aAAa,EAAE;IAClC,IAAID,IAAI,CAACG,KAAK,CAACD,MAAM,CAAC,EAAE;MACtB,OAAO,IAAI;IACb;EACF;AACF,CAAC;;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B;EAEA5E,IAAI,GAAG4D,YAAY,CAAC5D,IAAI,EAAEK,cAAc,CAAC;EAEzC,OAAOL,IAAI;AACb","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"stem.js","names":["languageProcessing","flattenSortLength","buildFormRule","createRulesFromArrays","calculateTotalNumberOfSyllables","removeEnding","checkBeginningsList","checkSingleSyllableWordSuffix","word","suffixesArray","suffix","match","stemSingleSyllableWordsPrefixes","morphologyData","startsWith","stemming","singleSyllableWords","substring","length","test","stemSingleSyllableWords","suffixCombination","singleSyllableWordsSuffixes","inputWord","some","shortWord","regexRules","removeParticle","doNotStemWords","doNotStemParticle","removePronoun","doNotStemPronounSuffix","wordWithoutDerivationalSuffix","removeSuffixes","doNotStemSuffix","includes","tryStemmingKeAndTer","terException","doNotStemPrefix","doNotStemFirstOrderPrefix","doNotStemTer","wordWithTer","beginningModification","rBeginning","replace","checkFirstOrderPrefixExceptions","nBeginning","kBeginning","pBeginning","mBeginning","wordAfterKeTerCheck","removeFirstOrderPrefix","firstOrderPrefixException","regex","removeFirstOrderPrefixes","withRemovedFirstOrderPrefix","removeSecondOrderPrefix","removeSecondOrderPrefixes","withRemovedSecondOrderPrefix","stemDerivational","wordLength","removeSuffixRules","removeSuffixExceptions","doNotStemSecondOrderPrefix","wordWithPrefixLookAlike","stemSingular","doNotStemPronoun","firstDerivationalStem","stemPlural","hyphenIndex","indexOf","splitWord","split","firstPart","secondPart","firstPartBeginningTrimmed","secondPartBeginningTrimmed","nonPlurals","nonPluralReduplications","stem","shouldNotBeStemmed","stemmedPlural"],"sources":["../../../../../../src/languageProcessing/languages/id/helpers/internal/stem.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index.js';\nconst {flattenSortLength, buildFormRule, createRulesFromArrays} = languageProcessing;\n\nimport {calculateTotalNumberOfSyllables, removeEnding, checkBeginningsList} from './stemHelpers';\n\n/**\n * MIT License\n *\n * Adapted from: Copyright (c) 2013 Adinda Praditya\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software\n * and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction,\n * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\"\n */\n\n/**\n * Checks if a single syllable word has one of the suffixes/suffix combination.\n *\n * @param {string} word The word to check.\n * @param {Array} suffixesArray The array of suffixes\n * @returns {boolean} Whether the word ends in one of the suffixes or not.\n */\nconst checkSingleSyllableWordSuffix = function(word, suffixesArray) {\n for (const suffix of suffixesArray) {\n if (word.match(suffix)) {\n return true;\n }\n }\n};\n\n/**\n * Stems the prefix of the single syllable words, i.e. di-/penge-/menge-\n *\n * @param {string}\tword\t\t\tThe word to check.\n * @param {Object}\tmorphologyData\tThe Indonesian morphology data file.\n *\n * @returns {string} The stemmed word.\n */\nconst stemSingleSyllableWordsPrefixes = function(word, morphologyData) {\n // If the word gets prefix di-, stem the prefix here. E.g. dicekkanlah -> cekkanlah, dibomi -> bomi\n if (\n word.startsWith('di') &&\n checkBeginningsList(word, 2, morphologyData.stemming.singleSyllableWords)\n ) {\n return word.substring(2, word.length);\n }\n /*\n * If the word gets prefix menge-/penge- and is followed by one of the words in the list, stem the prefix here.\n * E.g. pengeboman -> boman\n */\n if (\n /^[mp]enge/i.test(word) &&\n checkBeginningsList(word, 5, morphologyData.stemming.singleSyllableWords)\n ) {\n return word.substring(5, word.length);\n }\n return word;\n};\n\n/**\n * Stems Indonesian single syllable words. This function concerns single syllable words\n * with this possible word format [di/penge/menge] + single syllable word + [kan/an/i] + [ku/mu/nya] + [kah/lah/pun], with [] being optional.\n * E.g. dipel -> pel, dipelkan -> pel, dipelkanlah -> pel, pelkan -> pel, pelmulah -> pel, pengeboman -> bom, mengesahkan -> sah\n *\n *\n * @param {string}\tword\t\t\tThe word to check.\n * @param {Object}\tmorphologyData\tThe Indonesian morphology data file.\n *\n * @returns {string} The stemmed word.\n */\nconst stemSingleSyllableWords = function(word, morphologyData) {\n const singleSyllableWords = morphologyData.stemming.singleSyllableWords;\n const suffixCombination = morphologyData.stemming.singleSyllableWordsSuffixes;\n const inputWord = word;\n // If the word starts with prefix di-/penge-/menge-, stem the prefix here. E.g. pengeboman -> boman, dipelkan -> pelkan\n word = stemSingleSyllableWordsPrefixes(word, morphologyData);\n\n // Check if a word starts with one of the words in the list, has maximum 3 syllables, and ends in one of the single syllable suffixes\n if (\n singleSyllableWords.some(shortWord => word.startsWith(shortWord)) &&\n calculateTotalNumberOfSyllables(word) <= 3 &&\n checkSingleSyllableWordSuffix(word, suffixCombination)\n ) {\n // If the word gets a particle suffix, stem the particle. E.g. cekkanlah -> cekkan, pelkan -> pel, vasmulah -> vasmu\n word = removeEnding(\n word,\n morphologyData.stemming.regexRules.removeParticle,\n morphologyData.stemming.doNotStemWords.doNotStemParticle,\n morphologyData\n );\n\n // If the word gets a possessive pronoun suffix, stem the possessive pronoun. E.g. vasmu -> vas\n word = removeEnding(\n word,\n morphologyData.stemming.regexRules.removePronoun,\n morphologyData.stemming.doNotStemWords.doNotStemPronounSuffix,\n morphologyData\n );\n\n // If the word ends in -kan/-an/-i suffix, stem the suffix. E.g. cekkan -> cek, bomi -> bom\n const wordWithoutDerivationalSuffix = removeEnding(\n word,\n morphologyData.stemming.regexRules.removeSuffixes,\n morphologyData.stemming.doNotStemWords.doNotStemSuffix,\n morphologyData\n );\n\n if (singleSyllableWords.includes(wordWithoutDerivationalSuffix)) {\n word = wordWithoutDerivationalSuffix;\n }\n }\n /*\n * We only want to stem single syllable words here.\n * Thus, if the output word has more than one syllable, we don't stem the input word at all.\n */\n if (calculateTotalNumberOfSyllables(word) > 1 || word.length === 1) {\n word = inputWord;\n }\n return word;\n};\n\n/**\n * Tries stemming prefixes ke- and ter-. Ke- is always stemmed, and ter- only if it is a prefix and not part of the stem.\n * Also if the stem of the word begins with r-, only te- is stemmed, not ter-.\n *\n * @param {Object}\tmorphologyData\tThe Indonesian morphology data file.\n * @param {string}\tword\t\t\tThe word to check.\n *\n * @returns {string|null}\tThe stem or null if the word did not start with ter/keter.\n */\nconst tryStemmingKeAndTer = function(morphologyData, word) {\n const terException =\n morphologyData.stemming.doNotStemWords.doNotStemPrefix.doNotStemFirstOrderPrefix.doNotStemTer;\n\n // If prefix -ter is preceded by prefix -ke, remove it first.\n if (word.startsWith('keter')) {\n word = word.substring(2, word.length);\n }\n if (word.startsWith('ter')) {\n // If word is on an exception list of words where -ter should not be stemmed, do not stem -ter and return the word.\n if (terException.some(wordWithTer => word.startsWith(wordWithTer))) {\n return word;\n }\n // If word (without prefixes) is on the list of words beginning with -r, remove only -te instead of -ter.\n if (checkBeginningsList(word, 3, morphologyData.stemming.beginningModification.rBeginning)) {\n return word.replace(/^ter/i, 'r');\n }\n // Otherwise, remove -ter.\n return word.substring(3, word.length);\n }\n};\n/**\n * Checks whether a word has a first order prefix and whether it is on an exception list of words which require a stem mofification\n * after removing the prefix. Returns the stem if the prefix was found and the word was matched on an exception list.\n *\n *\n * @param {string}\tword\t\t\tThe word to check.\n * @param {Object}\tmorphologyData\tThe Indonesian morphology data file.\n *\n * @returns {string|null}\tThe stem or null if a prefix was not found, or was found but the word was not on the exception list.\n */\nconst checkFirstOrderPrefixExceptions = function(word, morphologyData) {\n const beginningModification = morphologyData.stemming.beginningModification;\n\n // If a word starts with \"men\" or \"pen\" and is present in the nBeginning exception list, the prefix should be replaced with \"n\".\n if (/^[mp]en/i.test(word)) {\n if (checkBeginningsList(word, 3, beginningModification.nBeginning)) {\n return word.replace(/^[mp]en/i, 'n');\n }\n }\n if (/^[mp]eng/i.test(word) && checkBeginningsList(word, 4, beginningModification.kBeginning)) {\n return word.replace(/^[mp]eng/i, 'k');\n }\n\n if (/^[mp]em/i.test(word)) {\n if (checkBeginningsList(word, 3, beginningModification.pBeginning)) {\n return word.replace(/^(mem|pem)/i, 'p');\n } else if (checkBeginningsList(word, 3, beginningModification.mBeginning)) {\n return word.replace(/^(mem|pem)/i, 'm');\n }\n }\n // Stem prefix ke- if found. Stem te(r)- unless the word was found on the exception list of words with stem beginning in -ter.\n const wordAfterKeTerCheck = tryStemmingKeAndTer(morphologyData, word);\n if (wordAfterKeTerCheck) {\n return wordAfterKeTerCheck;\n }\n};\n\n/**\n * Stems the first-order prefix of a word based on regexRules. If the word is found in an exception list, implements a stem modification.\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stemmed word.\n */\nconst removeFirstOrderPrefix = function(word, morphologyData) {\n // Checks whether the word has a first order prefix and requires a stem modification.\n const firstOrderPrefixException = checkFirstOrderPrefixExceptions(word, morphologyData);\n\n if (firstOrderPrefixException) {\n return firstOrderPrefixException;\n }\n const regex = createRulesFromArrays(morphologyData.stemming.regexRules.removeFirstOrderPrefixes);\n const withRemovedFirstOrderPrefix = buildFormRule(word, regex);\n\n return withRemovedFirstOrderPrefix || word;\n};\n\n/**\n * Stems the second-order prefix of a word based on regexRules. If the word is found in an exception list, implements a stem modification.\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stemmed word.\n */\nconst removeSecondOrderPrefix = function(word, morphologyData) {\n // If a word starts with \"ber\" or \"per\" and is present in the rBeginning exception list, the prefix should be replaced with \"r\".\n if (\n (word.startsWith('ber') || word.startsWith('per')) &&\n checkBeginningsList(word, 3, morphologyData.stemming.beginningModification.rBeginning)\n ) {\n return word.replace(/^(ber|per)/i, 'r');\n }\n // If a word starts with a first order prefix followed by peng- and is in the kBeginning exception list, then peng- should be replaced with k.\n if (\n /^peng/i.test(word) &&\n checkBeginningsList(word, 4, morphologyData.stemming.beginningModification.kBeginning)\n ) {\n return word.replace(/^peng/i, 'k');\n }\n const regex = createRulesFromArrays(morphologyData.stemming.regexRules.removeSecondOrderPrefixes);\n const withRemovedSecondOrderPrefix = buildFormRule(word, regex);\n\n return withRemovedSecondOrderPrefix || word;\n};\n\n/**\n * Stems derivational affixes of Indonesian words.\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stemmed word.\n */\nconst stemDerivational = function(word, morphologyData) {\n let wordLength = word.length;\n const removeSuffixRules = morphologyData.stemming.regexRules.removeSuffixes;\n const removeSuffixExceptions = morphologyData.stemming.doNotStemWords.doNotStemSuffix;\n const doNotStemFirstOrderPrefix = flattenSortLength(\n morphologyData.stemming.doNotStemWords.doNotStemPrefix.doNotStemFirstOrderPrefix\n );\n const doNotStemSecondOrderPrefix = flattenSortLength(\n morphologyData.stemming.doNotStemWords.doNotStemPrefix.doNotStemSecondOrderPrefix\n );\n\n // If a word is in the list of words with a beginning that looks like a valid suffix, do not stem the suffix\n if (\n !doNotStemFirstOrderPrefix.some(wordWithPrefixLookAlike =>\n word.startsWith(wordWithPrefixLookAlike)\n )\n ) {\n /*\n * If the word has more than 2 syllables and starts with one of first order prefixes (i.e. meng-, meny-, men-, mem-, me-,\n * peng-, peny-, pen-, pem-, di-, ter-, ke- ), the prefix will be stemmed here. e.g. penyebaran -> sebaran, diperlebarkan -> perlebarkan\n */\n word = removeFirstOrderPrefix(word, morphologyData);\n }\n\n if (wordLength === word.length) {\n if (\n !doNotStemSecondOrderPrefix.some(wordWithPrefixLookAlike =>\n word.startsWith(wordWithPrefixLookAlike)\n )\n ) {\n /*\n * If the word does not start with one of the first order prefixes but starts with one of the second order prefixes,\n * the prefix will be stemmed here, e.g., peranakan -> anakan\n */\n word = removeSecondOrderPrefix(word, morphologyData);\n }\n // If the word has more than 2 syllables and ends in either -kan, -an, or -i suffixes, the suffix will be deleted here, e.g., anakan -> anak\n if (calculateTotalNumberOfSyllables(word) > 2) {\n word = removeEnding(word, removeSuffixRules, removeSuffixExceptions, morphologyData);\n }\n } else {\n // If the word previously had a first order prefix, assign wordLength to the length of the word after prefix deletion.\n wordLength = word.length;\n /*\n * If the word after first order prefix deletion is bigger than 2 and ends in either -kan, -an, or -i suffixes,\n * the suffix will be stemmed here. e.g. penyebaran - sebar.\n */\n if (calculateTotalNumberOfSyllables(word) > 2) {\n word = removeEnding(word, removeSuffixRules, removeSuffixExceptions, morphologyData);\n }\n /*\n * If the word previously had a suffix, we check further if the word after first order prefix and suffix deletion has more than 2 syllables.\n * If it does have more than 2 syllables and starts with one of the second order prefixes (i.e. ber-, be-, per-, pe-), the prefix will\n * be stemmed here unless the word is in the exception list of words with a beginning that looks like a second order prefix.\n */\n if (wordLength !== word.length && !doNotStemSecondOrderPrefix.includes(word)) {\n if (calculateTotalNumberOfSyllables(word) > 2) {\n word = removeSecondOrderPrefix(word, morphologyData);\n }\n }\n }\n return word;\n};\n\n/**\n * Stems Indonesian singular words.\n *\n * @param {string} word The singular word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stem of an Indonesian singular word.\n */\nconst stemSingular = function(word, morphologyData) {\n const singleSyllableWords = stemSingleSyllableWords(word, morphologyData);\n // Stem the single syllable words\n word = singleSyllableWords;\n\n const doNotStemParticle = morphologyData.stemming.doNotStemWords.doNotStemParticle;\n const doNotStemPronoun = morphologyData.stemming.doNotStemWords.doNotStemPronounSuffix;\n\n if (calculateTotalNumberOfSyllables(word) <= 2) {\n return word;\n }\n\n // Check if a word after its derivational affixes stemmed exists in the exception list.\n const firstDerivationalStem = stemDerivational(word, morphologyData);\n if (\n doNotStemParticle.includes(firstDerivationalStem) ||\n doNotStemPronoun.includes(firstDerivationalStem)\n ) {\n // If it does exist in the exception list, the ending that looks like a particle or a pronoun suffix should not be stemmed.\n return firstDerivationalStem;\n }\n\n /*\n * If the word has more than 2 syllables and ends in of the particle endings (i.e. -kah, -lah, -pun), stem the particle here.\n * e.g. bajumulah -> bajumu, bawalah -> bawa\n */\n word = removeEnding(\n word,\n morphologyData.stemming.regexRules.removeParticle,\n doNotStemParticle,\n morphologyData\n );\n\n // If the word (still) has more than 2 syllables and ends in of the possessive pronoun endings (i.e. -ku, -mu, -nya), stem the ending here.\n if (calculateTotalNumberOfSyllables(word) > 2) {\n // E.g. bajumu -> baju\n word = removeEnding(\n word,\n morphologyData.stemming.regexRules.removePronoun,\n doNotStemPronoun,\n morphologyData\n );\n }\n\n // If the word (still) has more than 2 syllables and has derivational affixes, the affix(es) will be stemmed here.\n if (calculateTotalNumberOfSyllables(word) > 2) {\n word = stemDerivational(word, morphologyData);\n }\n return word;\n};\n\n/**\n * Stems Indonesian plural words.\n *\n * @param {string} word The plural word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string|null} The stem of an Indonesian plural word or null if no plural was detected.\n */\nconst stemPlural = function(word, morphologyData) {\n const hyphenIndex = word.indexOf('-');\n\n // If there is no hyphen in the word, it can't be a reduplicated plural.\n if (hyphenIndex === -1) {\n return null;\n }\n\n const splitWord = word.split('-');\n\n if (splitWord.length === 2) {\n let firstPart = splitWord[0];\n let secondPart = splitWord[1];\n\n firstPart = stemSingular(firstPart, morphologyData);\n secondPart = stemSingular(secondPart, morphologyData);\n\n /*\n * To compare the first and second part and see whether it's actually a reduplication:\n * Trim the beginning of the word since it might be variable due to stem changes caused by prefixes.\n * For example, in \"meniru-nirukan\" the singular stemmer will correctly stem the first \"niru\" to \"tiru\" because\n * of the prefix \"me\". Since the second part of the word is stemmed individually, there is no \"me\" and hence\n * \"niru\" remains \"niru\". To still be able to link these two forms to each other,\n * we compare the two parts of the word after stripping the variable first or first and second letter.\n *\n */\n const firstPartBeginningTrimmed = firstPart.substring(1);\n const secondPartBeginningTrimmed =\n secondPart.startsWith('ng') || secondPart.startsWith('ny')\n ? secondPart.substring(2)\n : secondPart.substring(1);\n\n if (firstPartBeginningTrimmed === secondPartBeginningTrimmed) {\n const nonPlurals = morphologyData.stemming.nonPluralReduplications;\n\n // Check non-plural reduplication.\n if (nonPlurals.includes(firstPart) && nonPlurals.includes(secondPart)) {\n /*\n * In words such as \"mengira-ngira\" prefix \"me\" causes a modification on both words (k->ng). This will\n * be correctly stemmed for the first word, but not the second. Therefore, the correct base form\n * \"kira-kira\" is created based on a reduplication of the correctly stemmed first part, \"kira\".\n */\n return firstPart + '-' + firstPart;\n }\n\n // Return the stemmed singular form of a reduplicated plural.\n return firstPart;\n }\n }\n\n return null;\n};\n\n/**\n * Stems Indonesian words\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyData The object that contains regex-based rules and exception lists for Indonesian stemming.\n *\n * @returns {string} The stem of an Indonesian word.\n */\nexport default function stem(word, morphologyData) {\n // Check words that shouldn't receive any stemming.\n if (morphologyData.stemming.shouldNotBeStemmed.includes(word)) {\n return word;\n }\n\n const stemmedPlural = stemPlural(word, morphologyData);\n\n if (stemmedPlural) {\n return stemmedPlural;\n }\n\n word = stemSingular(word, morphologyData);\n\n return word;\n}\n"],"mappings":"AAAA,SAAQA,kBAAkB;AAC1B,MAAM;EAACC,iBAAiB;EAAEC,aAAa;EAAEC;AAAqB,CAAC,GAAGH,kBAAkB;AAEpF,SAAQI,+BAA+B,EAAEC,YAAY,EAAEC,mBAAmB;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,6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IAAI,GAAGyD,YAAY,CAACzD,IAAI,EAAEK,cAAc,CAAC;EAEzC,OAAOL,IAAI;AACb","ignoreList":[]}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.calculateTotalNumberOfSyllables = calculateTotalNumberOfSyllables;
|
|
7
|
-
exports.checkBeginningsList = checkBeginningsList;
|
|
8
|
-
exports.removeEnding = removeEnding;
|
|
9
|
-
var _index = require("../../../index");
|
|
1
|
+
import { languageProcessing } from "../../../../../index.js";
|
|
10
2
|
const {
|
|
11
3
|
buildFormRule,
|
|
12
4
|
createRulesFromArrays
|
|
13
|
-
} =
|
|
5
|
+
} = languageProcessing;
|
|
14
6
|
const vowelCharacters = ['a', 'e', 'i', 'o', 'u'];
|
|
15
7
|
|
|
16
8
|
/**
|
|
@@ -31,7 +23,7 @@ function isVowel(character) {
|
|
|
31
23
|
*
|
|
32
24
|
* @returns {int} The total number of syllables in the word.
|
|
33
25
|
*/
|
|
34
|
-
function calculateTotalNumberOfSyllables(word) {
|
|
26
|
+
export function calculateTotalNumberOfSyllables(word) {
|
|
35
27
|
let result = 0;
|
|
36
28
|
for (let i = 0; i < word.length; i++) {
|
|
37
29
|
if (isVowel(word[i])) {
|
|
@@ -51,7 +43,7 @@ function calculateTotalNumberOfSyllables(word) {
|
|
|
51
43
|
*
|
|
52
44
|
* @returns {string} The stemmed word.
|
|
53
45
|
*/
|
|
54
|
-
function removeEnding(word, regexRules, exceptions, morphologyData) {
|
|
46
|
+
export function removeEnding(word, regexRules, exceptions, morphologyData) {
|
|
55
47
|
if (exceptions.includes(word)) {
|
|
56
48
|
return word;
|
|
57
49
|
}
|
|
@@ -79,7 +71,7 @@ function removeEnding(word, regexRules, exceptions, morphologyData) {
|
|
|
79
71
|
*
|
|
80
72
|
* @returns {boolean} Whether the word is found in the list with beginnings.
|
|
81
73
|
*/
|
|
82
|
-
function checkBeginningsList(word, prefixLength, beginnings) {
|
|
74
|
+
export function checkBeginningsList(word, prefixLength, beginnings) {
|
|
83
75
|
const wordWithoutPrefix = word.slice(prefixLength);
|
|
84
76
|
return beginnings.some(beginning => wordWithoutPrefix.startsWith(beginning));
|
|
85
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stemHelpers.js","names":["
|
|
1
|
+
{"version":3,"file":"stemHelpers.js","names":["languageProcessing","buildFormRule","createRulesFromArrays","vowelCharacters","isVowel","character","includes","calculateTotalNumberOfSyllables","word","result","i","length","removeEnding","regexRules","exceptions","morphologyData","wordsWithKEnding","stemming","doNotStemWords","doNotStemK","endsWith","wordWithoutSuffixAn","substring","removePartRegex","withRemovedPart","checkBeginningsList","prefixLength","beginnings","wordWithoutPrefix","slice","some","beginning","startsWith"],"sources":["../../../../../../src/languageProcessing/languages/id/helpers/internal/stemHelpers.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index.js';\nconst {buildFormRule, createRulesFromArrays} = languageProcessing;\n\nconst vowelCharacters = ['a', 'e', 'i', 'o', 'u'];\n\n/**\n * Determines if an input character is a vowel.\n *\n * @param {string} character The character to check.\n *\n * @returns {boolean} Whether the input character is an Indonesian vowel.\n */\nfunction isVowel(character) {\n return vowelCharacters.includes(character);\n}\n\n/**\n * Calculates the total number of syllables in the input word.\n *\n * @param {string} word The word to calculate the number of syllables in.\n *\n * @returns {int} The total number of syllables in the word.\n */\nexport function calculateTotalNumberOfSyllables(word) {\n let result = 0;\n\n for (let i = 0; i < word.length; i++) {\n if (isVowel(word[i])) {\n result++;\n }\n }\n\n return result;\n}\n\n/**\n * Stems the ending of a word based on some regexRules after checking if the word is in the exception list.\n *\n * @param {string} word The word to stem.\n * @param {Array} regexRules The list of regex-based rules to apply to the word in order to stem it.\n * @param {string[]} exceptions The list of words that should not get the ending removed.\n * @param {Object} morphologyData The Indonesian morphology data file\n *\n * @returns {string} The stemmed word.\n */\nexport function removeEnding(word, regexRules, exceptions, morphologyData) {\n if (exceptions.includes(word)) {\n return word;\n }\n\n // Check words ending in -kan whether they are words whose stem ending in -k that get suffix -an or not.\n const wordsWithKEnding = morphologyData.stemming.doNotStemWords.doNotStemK;\n if (word.endsWith('kan')) {\n const wordWithoutSuffixAn = word.substring(0, word.length - 2);\n // If a word has stem ending -k and gets suffix -an, then only stem -an here.\n if (wordsWithKEnding.includes(wordWithoutSuffixAn)) {\n word = wordWithoutSuffixAn;\n }\n }\n\n const removePartRegex = createRulesFromArrays(regexRules);\n const withRemovedPart = buildFormRule(word, removePartRegex);\n return withRemovedPart || word;\n}\n\n/**\n * Checks if the beginning of the word is present in an exception list.\n *\n * @param {string} word The word to stem.\n * @param {int} prefixLength The length of the prefix to be trimmed before checking in the list.\n * @param {string[]} beginnings The list of word beginnings that should be checked.\n *\n * @returns {boolean} Whether the word is found in the list with beginnings.\n */\nexport function checkBeginningsList(word, prefixLength, beginnings) {\n const wordWithoutPrefix = word.slice(prefixLength);\n return beginnings.some(beginning => wordWithoutPrefix.startsWith(beginning));\n}\n"],"mappings":"AAAA,SAAQA,kBAAkB;AAC1B,MAAM;EAACC,aAAa;EAAEC;AAAqB,CAAC,GAAGF,kBAAkB;AAEjE,MAAMG,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,OAAOA,CAACC,SAAS,EAAE;EAC1B,OAAOF,eAAe,CAACG,QAAQ,CAACD,SAAS,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,+BAA+BA,CAACC,IAAI,EAAE;EACpD,IAAIC,MAAM,GAAG,CAAC;EAEd,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,IAAI,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACpC,IAAIN,OAAO,CAACI,IAAI,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
-
exports.default = isPassiveSentence;
|
|
7
|
-
var _index = require("../../../index");
|
|
8
|
-
var _nonPassiveVerbsStartingDi = _interopRequireDefault(require("../config/internal/nonPassiveVerbsStartingDi"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
1
|
+
import { languageProcessing } from "../../../../index.js";
|
|
10
2
|
const {
|
|
11
3
|
getWords
|
|
12
|
-
} =
|
|
4
|
+
} = languageProcessing;
|
|
5
|
+
import nonPassives from "../config/internal/nonPassiveVerbsStartingDi";
|
|
13
6
|
const passivePrefix = 'di';
|
|
14
7
|
|
|
15
8
|
/**
|
|
@@ -19,7 +12,7 @@ const passivePrefix = 'di';
|
|
|
19
12
|
*
|
|
20
13
|
* @returns {Boolean} Whether the sentence contains Indonesian passive voice.
|
|
21
14
|
*/
|
|
22
|
-
function isPassiveSentence(sentence) {
|
|
15
|
+
export default function isPassiveSentence(sentence) {
|
|
23
16
|
const words = getWords(sentence.toLowerCase());
|
|
24
17
|
let matchedPassives = words.filter(word => word.length > 4);
|
|
25
18
|
matchedPassives = matchedPassives.filter(word => word.startsWith(passivePrefix));
|
|
@@ -28,7 +21,7 @@ function isPassiveSentence(sentence) {
|
|
|
28
21
|
}
|
|
29
22
|
|
|
30
23
|
// Check exception list.
|
|
31
|
-
for (const nonPassive of
|
|
24
|
+
for (const nonPassive of nonPassives) {
|
|
32
25
|
matchedPassives = matchedPassives.filter(word => !word.startsWith(nonPassive));
|
|
33
26
|
}
|
|
34
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPassiveSentence.js","names":["
|
|
1
|
+
{"version":3,"file":"isPassiveSentence.js","names":["languageProcessing","getWords","nonPassives","passivePrefix","isPassiveSentence","sentence","words","toLowerCase","matchedPassives","filter","word","length","startsWith","nonPassive","matchedPassive","matchedPassivesShouldStay","passiveIndex","indexOf","wordPrecedingPassive"],"sources":["../../../../../src/languageProcessing/languages/id/helpers/isPassiveSentence.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index.js';\nconst {getWords} = languageProcessing;\n\nimport nonPassives from '../config/internal/nonPassiveVerbsStartingDi';\nconst passivePrefix = 'di';\n\n/**\n * Checks the passed sentence to see if it contains Indonesian passive verb-forms.\n *\n * @param {string} sentence The sentence to match against.\n *\n * @returns {Boolean} Whether the sentence contains Indonesian passive voice.\n */\nexport default function isPassiveSentence(sentence) {\n const words = getWords(sentence.toLowerCase());\n let matchedPassives = words.filter(word => word.length > 4);\n matchedPassives = matchedPassives.filter(word => word.startsWith(passivePrefix));\n if (matchedPassives.length === 0) {\n return false;\n }\n\n // Check exception list.\n for (const nonPassive of nonPassives) {\n matchedPassives = matchedPassives.filter(word => !word.startsWith(nonPassive));\n }\n\n // Check direct precedence exceptions.\n matchedPassives = matchedPassives.filter(function(matchedPassive) {\n let matchedPassivesShouldStay = true;\n const passiveIndex = words.indexOf(matchedPassive);\n const wordPrecedingPassive = words[passiveIndex - 1];\n if (wordPrecedingPassive === 'untuk') {\n matchedPassivesShouldStay = false;\n }\n return matchedPassivesShouldStay;\n });\n\n return matchedPassives.length !== 0;\n}\n"],"mappings":"AAAA,SAAQA,kBAAkB;AAC1B,MAAM;EAACC;AAAQ,CAAC,GAAGD,kBAAkB;AAErC,OAAOE,WAAW;AAClB,MAAMC,aAAa,GAAG,IAAI;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAACC,QAAQ,EAAE;EAClD,MAAMC,KAAK,GAAGL,QAAQ,CAACI,QAAQ,CAACE,WAAW,CAAC,CAAC,CAAC;EAC9C,IAAIC,eAAe,GAAGF,KAAK,CAACG,MAAM,CAACC,IAAI,IAAIA,IAAI,CAACC,MAAM,GAAG,CAAC,CAAC;EAC3DH,eAAe,GAAGA,eAAe,CAACC,MAAM,CAACC,IAAI,IAAIA,IAAI,CAACE,UAAU,CAACT,aAAa,CAAC,CAAC;EAChF,IAAIK,eAAe,CAACG,MAAM,KAAK,CAAC,EAAE;IAChC,OAAO,KAAK;EACd;;EAEA;EACA,KAAK,MAAME,UAAU,IAAIX,WAAW,EAAE;IACpCM,eAAe,GAAGA,eAAe,CAACC,MAAM,CAACC,IAAI,IAAI,CAACA,IAAI,CAACE,UAAU,CAACC,UAAU,CAAC,CAAC;EAChF;;EAEA;EACAL,eAAe,GAAGA,eAAe,CAACC,MAAM,CAAC,UAASK,cAAc,EAAE;IAChE,IAAIC,yBAAyB,GAAG,IAAI;IACpC,MAAMC,YAAY,GAAGV,KAAK,CAACW,OAAO,CAACH,cAAc,CAAC;IAClD,MAAMI,oBAAoB,GAAGZ,KAAK,CAACU,YAAY,GAAG,CAAC,CAAC;IACpD,IAAIE,oBAAoB,KAAK,OAAO,EAAE;MACpCH,yBAAyB,GAAG,KAAK;IACnC;IACA,OAAOA,yBAAyB;EAClC,CAAC,CAAC;EAEF,OAAOP,eAAe,CAACG,MAAM,KAAK,CAAC;AACrC","ignoreList":[]}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import createPunctuationTokens from "../../../helpers/word/createPunctuationTokens";
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _createPunctuationTokens = _interopRequireDefault(require("../../../helpers/word/createPunctuationTokens"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
3
|
/*
|
|
10
4
|
* The following regex matches a word separator. A word separator is either a whitespace, a tab, a non-breaking space,
|
|
11
5
|
* an en-dash or an em-dash.
|
|
@@ -47,7 +41,7 @@ function splitIntoTokensCustom(text) {
|
|
|
47
41
|
const rawTokens = text.split(WORD_SEPARATORS_REGEX).filter(x => x !== "");
|
|
48
42
|
|
|
49
43
|
// Remove punctuation from the beginning and end of word tokens, and make them into separate tokens.
|
|
50
|
-
return (
|
|
44
|
+
return createPunctuationTokens(rawTokens);
|
|
51
45
|
}
|
|
52
|
-
|
|
46
|
+
export default splitIntoTokensCustom;
|
|
53
47
|
//# sourceMappingURL=splitIntoTokensCustom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitIntoTokensCustom.js","names":["
|
|
1
|
+
{"version":3,"file":"splitIntoTokensCustom.js","names":["createPunctuationTokens","WORD_SEPARATORS_REGEX","splitIntoTokensCustom","text","rawTokens","split","filter","x"],"sources":["../../../../../src/languageProcessing/languages/id/helpers/splitIntoTokensCustom.js"],"sourcesContent":["import createPunctuationTokens from \"../../../helpers/word/createPunctuationTokens\";\n\n/*\n * The following regex matches a word separator. A word separator is either a whitespace, a tab, a non-breaking space,\n * an en-dash or an em-dash.\n * Brackets are added to deal correctly with shortcodes downstream.\n * The regex is used to split a text into tokens.\n * Do not add punctuation marks to this regex, as they are handled separately inside `createPunctuationTokens()`.\n * The word separator explicitly only contains characters that split two words and not a word and a space.\n * - A space is a word separator because it separates two words if it occurs between them. For example: \"foo bar\"\n * - A tab is a word separator because it separates two words if it occurs between them. For example: \"foo\tbar\"\n * - A non-breaking space (u00A0) is a word separator because it separates two words if it occurs between them. For example: \"foo\\u00A0bar\"\n * - An en-dash (u2013) and an em-dash (u2014) are word separators because they separate two words if they occur between them.\n * For example: \"foo–bar\".\n *\n * Hyphens are NOT word separators in Indonesian. They are most often used in a way that doesn't indicate a word boundary,\n * for example for reduplication (e.g. 'buku' meaning 'book' and 'buku-buku' meaning books).\n */\nconst WORD_SEPARATORS_REGEX = /([\\s\\t\\u00A0\\u2013\\u2014[\\]])/;\n\n/**\n * Tokenizes a text similarly to `getWords`, but in a way that's suitable for the HTML parser.\n * 1. It does not normalize whitespace.\n * This operation is too risky for the HTML parser because it may throw away characters and as a result, the token positions are corrupted.\n * 2. It does not remove punctuation marks but keeps them.\n *\n * This algorithm splits the text by word separators: tokens that are the border between two words.\n * This algorithm separates punctuation marks from words and keeps them as separate tokens.\n * It only splits them off if they appear at the start or the end of a word.\n *\n * @param {string} text The text to tokenize.\n *\n * @returns {string[]} \tAn array of tokens.\n */\nfunction splitIntoTokensCustom( text ) {\n\tif ( ! text ) {\n\t\treturn [];\n\t}\n\n\t// Split the sentence string into tokens. Those tokens are unrefined as they may contain punctuation.\n\tconst rawTokens = text.split( WORD_SEPARATORS_REGEX ).filter( x => x !== \"\" );\n\n\t// Remove punctuation from the beginning and end of word tokens, and make them into separate tokens.\n\treturn createPunctuationTokens( rawTokens );\n}\n\nexport default splitIntoTokensCustom;\n"],"mappings":"AAAA,OAAOA,uBAAuB;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,qBAAqB,GAAG,+BAA+B;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,qBAAqBA,CAAEC,IAAI,EAAG;EACtC,IAAK,CAAEA,IAAI,EAAG;IACb,OAAO,EAAE;EACV;;EAEA;EACA,MAAMC,SAAS,GAAGD,IAAI,CAACE,KAAK,CAAEJ,qBAAsB,CAAC,CAACK,MAAM,CAAEC,CAAC,IAAIA,CAAC,KAAK,EAAG,CAAC;;EAE7E;EACA,OAAOP,uBAAuB,CAAEI,SAAU,CAAC;AAC5C;AAEA,eAAeF,qBAAqB","ignoreList":[]}
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _index = require("../../../index");
|
|
8
|
-
var _firstWordExceptions = _interopRequireDefault(require("./config/firstWordExceptions"));
|
|
9
|
-
var _functionWords = require("./config/functionWords");
|
|
10
|
-
var _stopWords = _interopRequireDefault(require("./config/stopWords"));
|
|
11
|
-
var _transitionWords = _interopRequireDefault(require("./config/transitionWords"));
|
|
12
|
-
var _twoPartTransitionWords = _interopRequireDefault(require("./config/twoPartTransitionWords"));
|
|
13
|
-
var _syllables = _interopRequireDefault(require("./config/syllables.json"));
|
|
14
|
-
var _sentenceLength = _interopRequireDefault(require("./config/sentenceLength"));
|
|
15
|
-
var _getClauses = _interopRequireDefault(require("./helpers/getClauses"));
|
|
16
|
-
var _getStemmer = _interopRequireDefault(require("./helpers/getStemmer"));
|
|
17
|
-
var _calculateFleschReadingScore = _interopRequireDefault(require("./helpers/calculateFleschReadingScore"));
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
1
|
+
import { languageProcessing } from "../../../index.js";
|
|
19
2
|
const {
|
|
20
3
|
AbstractResearcher
|
|
21
|
-
} =
|
|
4
|
+
} = languageProcessing;
|
|
22
5
|
|
|
23
6
|
// All config
|
|
7
|
+
import firstWordExceptions from "./config/firstWordExceptions";
|
|
8
|
+
import { all as functionWords } from "./config/functionWords";
|
|
9
|
+
import stopWords from "./config/stopWords";
|
|
10
|
+
import transitionWords from "./config/transitionWords";
|
|
11
|
+
import twoPartTransitionWords from "./config/twoPartTransitionWords";
|
|
12
|
+
import syllables from "./config/syllables.json";
|
|
13
|
+
import sentenceLength from "./config/sentenceLength";
|
|
24
14
|
|
|
25
15
|
// All helpers
|
|
16
|
+
import getClauses from "./helpers/getClauses";
|
|
17
|
+
import getStemmer from "./helpers/getStemmer";
|
|
18
|
+
import fleschReadingScore from "./helpers/calculateFleschReadingScore";
|
|
26
19
|
|
|
27
20
|
/**
|
|
28
21
|
* The researcher contains all the researches, helpers, data, and config.
|
|
29
22
|
*/
|
|
30
|
-
class Researcher extends AbstractResearcher {
|
|
23
|
+
export default class Researcher extends AbstractResearcher {
|
|
31
24
|
/**
|
|
32
25
|
* Constructor
|
|
33
26
|
* @param {Paper} paper The Paper object that is needed within the researches.
|
|
@@ -38,20 +31,19 @@ class Researcher extends AbstractResearcher {
|
|
|
38
31
|
Object.assign(this.config, {
|
|
39
32
|
language: 'it',
|
|
40
33
|
passiveConstructionType: 'periphrastic',
|
|
41
|
-
firstWordExceptions
|
|
42
|
-
functionWords
|
|
43
|
-
stopWords
|
|
44
|
-
transitionWords
|
|
45
|
-
twoPartTransitionWords
|
|
46
|
-
syllables
|
|
47
|
-
sentenceLength
|
|
34
|
+
firstWordExceptions,
|
|
35
|
+
functionWords,
|
|
36
|
+
stopWords,
|
|
37
|
+
transitionWords,
|
|
38
|
+
twoPartTransitionWords,
|
|
39
|
+
syllables,
|
|
40
|
+
sentenceLength
|
|
48
41
|
});
|
|
49
42
|
Object.assign(this.helpers, {
|
|
50
|
-
getClauses
|
|
51
|
-
getStemmer
|
|
52
|
-
fleschReadingScore
|
|
43
|
+
getClauses,
|
|
44
|
+
getStemmer,
|
|
45
|
+
fleschReadingScore
|
|
53
46
|
});
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
|
-
exports.default = Researcher;
|
|
57
49
|
//# sourceMappingURL=Researcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Researcher.js","names":["
|
|
1
|
+
{"version":3,"file":"Researcher.js","names":["languageProcessing","AbstractResearcher","firstWordExceptions","all","functionWords","stopWords","transitionWords","twoPartTransitionWords","syllables","sentenceLength","getClauses","getStemmer","fleschReadingScore","Researcher","constructor","paper","Object","assign","config","language","passiveConstructionType","helpers"],"sources":["../../../../src/languageProcessing/languages/it/Researcher.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index.js';\nconst {AbstractResearcher} = languageProcessing;\n\n// All config\nimport firstWordExceptions from './config/firstWordExceptions';\nimport {all as functionWords} from './config/functionWords';\nimport stopWords from './config/stopWords';\nimport transitionWords from './config/transitionWords';\nimport twoPartTransitionWords from './config/twoPartTransitionWords';\nimport syllables from './config/syllables.json';\nimport sentenceLength from './config/sentenceLength';\n\n// All helpers\nimport getClauses from './helpers/getClauses';\nimport getStemmer from './helpers/getStemmer';\nimport fleschReadingScore from './helpers/calculateFleschReadingScore';\n\n/**\n * The researcher contains all the researches, helpers, data, and config.\n */\nexport default class Researcher extends AbstractResearcher {\n /**\n * Constructor\n * @param {Paper} paper The Paper object that is needed within the researches.\n * @constructor\n */\n constructor(paper) {\n super(paper);\n\n Object.assign(this.config, {\n language: 'it',\n passiveConstructionType: 'periphrastic',\n firstWordExceptions,\n functionWords,\n stopWords,\n transitionWords,\n twoPartTransitionWords,\n syllables,\n sentenceLength\n });\n\n Object.assign(this.helpers, {\n getClauses,\n getStemmer,\n fleschReadingScore\n });\n }\n}\n"],"mappings":"AAAA,SAAQA,kBAAkB;AAC1B,MAAM;EAACC;AAAkB,CAAC,GAAGD,kBAAkB;;AAE/C;AACA,OAAOE,mBAAmB;AAC1B,SAAQC,GAAG,IAAIC,aAAa;AAC5B,OAAOC,SAAS;AAChB,OAAOC,eAAe;AACtB,OAAOC,sBAAsB;AAC7B,OAAOC,SAAS;AAChB,OAAOC,cAAc;;AAErB;AACA,OAAOC,UAAU;AACjB,OAAOC,UAAU;AACjB,OAAOC,kBAAkB;;AAEzB;AACA;AACA;AACA,eAAe,MAAMC,UAAU,SAASZ,kBAAkB,CAAC;EACzD;AACF;AACA;AACA;AACA;EACEa,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACC,MAAM,EAAE;MACzBC,QAAQ,EAAE,IAAI;MACdC,uBAAuB,EAAE,cAAc;MACvClB,mBAAmB;MACnBE,aAAa;MACbC,SAAS;MACTC,eAAe;MACfC,sBAAsB;MACtBC,SAAS;MACTC;IACF,CAAC,CAAC;IAEFO,MAAM,CAACC,MAAM,CAAC,IAAI,CAACI,OAAO,EAAE;MAC1BX,UAAU;MACVC,UAAU;MACVC;IACF,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|