axyseo 2.0.0-alpha.3 → 2.1.1

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.
Files changed (1255) hide show
  1. package/build/config/diacritics.js +1 -7
  2. package/build/config/diacritics.js.map +1 -1
  3. package/build/config/getTransliterations.js +6 -14
  4. package/build/config/getTransliterations.js.map +1 -1
  5. package/build/config/transliterationsWPstyle.js +5 -12
  6. package/build/config/transliterationsWPstyle.js.map +1 -1
  7. package/build/config/wordBoundaries.js +1 -7
  8. package/build/config/wordBoundaries.js.map +1 -1
  9. package/build/config/wordBoundariesWithoutPunctuation.js +2 -8
  10. package/build/config/wordBoundariesWithoutPunctuation.js.map +1 -1
  11. package/build/const/analysis.js +32 -11
  12. package/build/const/analysis.js.map +1 -1
  13. package/build/errors/invalidType.js +1 -8
  14. package/build/errors/invalidType.js.map +1 -1
  15. package/build/errors/missingArgument.js +1 -8
  16. package/build/errors/missingArgument.js.map +1 -1
  17. package/build/helpers/createMeasurementElement.js +1 -8
  18. package/build/helpers/createMeasurementElement.js.map +1 -1
  19. package/build/helpers/domManipulation.js +3 -8
  20. package/build/helpers/domManipulation.js.map +1 -1
  21. package/build/helpers/errors.js +5 -10
  22. package/build/helpers/errors.js.map +1 -1
  23. package/build/helpers/factory.js +7 -13
  24. package/build/helpers/factory.js.map +1 -1
  25. package/build/helpers/formatNumber.js +1 -7
  26. package/build/helpers/formatNumber.js.map +1 -1
  27. package/build/helpers/formatString.js +4 -9
  28. package/build/helpers/formatString.js.map +1 -1
  29. package/build/helpers/getLanguagesWithWordComplexity.js +1 -7
  30. package/build/helpers/getLanguagesWithWordComplexity.js.map +1 -1
  31. package/build/helpers/getLanguagesWithWordFormSupport.js +1 -7
  32. package/build/helpers/getLanguagesWithWordFormSupport.js.map +1 -1
  33. package/build/helpers/getWordComplexityConfig.js +9 -15
  34. package/build/helpers/getWordComplexityConfig.js.map +1 -1
  35. package/build/helpers/getWordComplexityHelper.js +9 -15
  36. package/build/helpers/getWordComplexityHelper.js.map +1 -1
  37. package/build/helpers/htmlEntities.js +6 -11
  38. package/build/helpers/htmlEntities.js.map +1 -1
  39. package/build/helpers/includesAny.js +3 -8
  40. package/build/helpers/includesAny.js.map +1 -1
  41. package/build/helpers/index.js +30 -72
  42. package/build/helpers/index.js.map +1 -1
  43. package/build/helpers/shortlinker/Shortlinker.js +1 -8
  44. package/build/helpers/shortlinker/Shortlinker.js.map +1 -1
  45. package/build/helpers/shortlinker/index.js +1 -16
  46. package/build/helpers/shortlinker/index.js.map +1 -1
  47. package/build/helpers/shortlinker/singleton.js +5 -13
  48. package/build/helpers/shortlinker/singleton.js.map +1 -1
  49. package/build/helpers/types.js +2 -9
  50. package/build/helpers/types.js.map +1 -1
  51. package/build/index.js +25 -87
  52. package/build/index.js.map +1 -1
  53. package/build/languageProcessing/AbstractResearcher.js +88 -95
  54. package/build/languageProcessing/AbstractResearcher.js.map +1 -1
  55. package/build/languageProcessing/helpers/highlighting/getMarkingsInSentence.js +3 -10
  56. package/build/languageProcessing/helpers/highlighting/getMarkingsInSentence.js.map +1 -1
  57. package/build/languageProcessing/helpers/html/getFieldsToMark.js +6 -11
  58. package/build/languageProcessing/helpers/html/getFieldsToMark.js.map +1 -1
  59. package/build/languageProcessing/helpers/html/getSubheadingTexts.js +3 -8
  60. package/build/languageProcessing/helpers/html/getSubheadingTexts.js.map +1 -1
  61. package/build/languageProcessing/helpers/html/getSubheadings.js +2 -12
  62. package/build/languageProcessing/helpers/html/getSubheadings.js.map +1 -1
  63. package/build/languageProcessing/helpers/html/html.js +9 -17
  64. package/build/languageProcessing/helpers/html/html.js.map +1 -1
  65. package/build/languageProcessing/helpers/html/htmlParser.js +3 -10
  66. package/build/languageProcessing/helpers/html/htmlParser.js.map +1 -1
  67. package/build/languageProcessing/helpers/html/matchParagraphs.js +7 -12
  68. package/build/languageProcessing/helpers/html/matchParagraphs.js.map +1 -1
  69. package/build/languageProcessing/helpers/html/normalizeHTML.js +4 -10
  70. package/build/languageProcessing/helpers/html/normalizeHTML.js.map +1 -1
  71. package/build/languageProcessing/helpers/image/getAltAttribute.js +3 -9
  72. package/build/languageProcessing/helpers/image/getAltAttribute.js.map +1 -1
  73. package/build/languageProcessing/helpers/image/getImagesInTree.js +1 -7
  74. package/build/languageProcessing/helpers/image/getImagesInTree.js.map +1 -1
  75. package/build/languageProcessing/helpers/image/imageInText.js +5 -12
  76. package/build/languageProcessing/helpers/image/imageInText.js.map +1 -1
  77. package/build/languageProcessing/helpers/index.js +5 -40
  78. package/build/languageProcessing/helpers/index.js.map +1 -1
  79. package/build/languageProcessing/helpers/language/getLanguage.js +1 -7
  80. package/build/languageProcessing/helpers/language/getLanguage.js.map +1 -1
  81. package/build/languageProcessing/helpers/link/checkNofollow.js +3 -10
  82. package/build/languageProcessing/helpers/link/checkNofollow.js.map +1 -1
  83. package/build/languageProcessing/helpers/link/getAnchorsFromText.js +1 -7
  84. package/build/languageProcessing/helpers/link/getAnchorsFromText.js.map +1 -1
  85. package/build/languageProcessing/helpers/link/getLinkType.js +7 -13
  86. package/build/languageProcessing/helpers/link/getLinkType.js.map +1 -1
  87. package/build/languageProcessing/helpers/match/findKeywordFormsInString.js +10 -17
  88. package/build/languageProcessing/helpers/match/findKeywordFormsInString.js.map +1 -1
  89. package/build/languageProcessing/helpers/match/isDoubleQuoted.js +4 -10
  90. package/build/languageProcessing/helpers/match/isDoubleQuoted.js.map +1 -1
  91. package/build/languageProcessing/helpers/match/matchTextWithArray.js +6 -12
  92. package/build/languageProcessing/helpers/match/matchTextWithArray.js.map +1 -1
  93. package/build/languageProcessing/helpers/match/matchTextWithTransliteration.js +16 -22
  94. package/build/languageProcessing/helpers/match/matchTextWithTransliteration.js.map +1 -1
  95. package/build/languageProcessing/helpers/match/matchTextWithWord.js +17 -23
  96. package/build/languageProcessing/helpers/match/matchTextWithWord.js.map +1 -1
  97. package/build/languageProcessing/helpers/match/matchWordFormsWithSentence.js +7 -15
  98. package/build/languageProcessing/helpers/match/matchWordFormsWithSentence.js.map +1 -1
  99. package/build/languageProcessing/helpers/match/processExactMatchRequest.js +3 -9
  100. package/build/languageProcessing/helpers/match/processExactMatchRequest.js.map +1 -1
  101. package/build/languageProcessing/helpers/morphology/baseStemmer.js +1 -7
  102. package/build/languageProcessing/helpers/morphology/baseStemmer.js.map +1 -1
  103. package/build/languageProcessing/helpers/morphology/buildFormRule.js +1 -7
  104. package/build/languageProcessing/helpers/morphology/buildFormRule.js.map +1 -1
  105. package/build/languageProcessing/helpers/morphology/buildTopicStems.js +13 -23
  106. package/build/languageProcessing/helpers/morphology/buildTopicStems.js.map +1 -1
  107. package/build/languageProcessing/helpers/morphology/createRulesFromArrays.js +2 -9
  108. package/build/languageProcessing/helpers/morphology/createRulesFromArrays.js.map +1 -1
  109. package/build/languageProcessing/helpers/morphology/exceptionListHelpers.js +5 -13
  110. package/build/languageProcessing/helpers/morphology/exceptionListHelpers.js.map +1 -1
  111. package/build/languageProcessing/helpers/morphology/findMatchingEndingInArray.js +1 -7
  112. package/build/languageProcessing/helpers/morphology/findMatchingEndingInArray.js.map +1 -1
  113. package/build/languageProcessing/helpers/morphology/flattenSortLength.js +3 -8
  114. package/build/languageProcessing/helpers/morphology/flattenSortLength.js.map +1 -1
  115. package/build/languageProcessing/helpers/morphology/getAllWordsFromPaper.js +12 -18
  116. package/build/languageProcessing/helpers/morphology/getAllWordsFromPaper.js.map +1 -1
  117. package/build/languageProcessing/helpers/morphology/regexHelpers.js +3 -11
  118. package/build/languageProcessing/helpers/morphology/regexHelpers.js.map +1 -1
  119. package/build/languageProcessing/helpers/morphology/stemHelpers.js +2 -9
  120. package/build/languageProcessing/helpers/morphology/stemHelpers.js.map +1 -1
  121. package/build/languageProcessing/helpers/morphology/stemPrefixedFunctionWords.js +1 -7
  122. package/build/languageProcessing/helpers/morphology/stemPrefixedFunctionWords.js.map +1 -1
  123. package/build/languageProcessing/helpers/passiveVoice/periphrastic/directPrecedenceException.js +5 -11
  124. package/build/languageProcessing/helpers/passiveVoice/periphrastic/directPrecedenceException.js.map +1 -1
  125. package/build/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/getClausesSplitOnStopWords.js +9 -15
  126. package/build/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/getClausesSplitOnStopWords.js.map +1 -1
  127. package/build/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/nonDirectParticiplePrecedenceException.js +9 -15
  128. package/build/languageProcessing/helpers/passiveVoice/periphrastic/freeAuxiliaryParticipleOrder/nonDirectParticiplePrecedenceException.js.map +1 -1
  129. package/build/languageProcessing/helpers/passiveVoice/periphrastic/getClauses.js +28 -34
  130. package/build/languageProcessing/helpers/passiveVoice/periphrastic/getClauses.js.map +1 -1
  131. package/build/languageProcessing/helpers/passiveVoice/periphrastic/getIndicesWithRegex.js +1 -7
  132. package/build/languageProcessing/helpers/passiveVoice/periphrastic/getIndicesWithRegex.js.map +1 -1
  133. package/build/languageProcessing/helpers/passiveVoice/periphrastic/matchRegularParticiples.js +3 -8
  134. package/build/languageProcessing/helpers/passiveVoice/periphrastic/matchRegularParticiples.js.map +1 -1
  135. package/build/languageProcessing/helpers/passiveVoice/periphrastic/precedenceException.js +5 -11
  136. package/build/languageProcessing/helpers/passiveVoice/periphrastic/precedenceException.js.map +1 -1
  137. package/build/languageProcessing/helpers/prominentWords/determineProminentWords.js +16 -28
  138. package/build/languageProcessing/helpers/prominentWords/determineProminentWords.js.map +1 -1
  139. package/build/languageProcessing/helpers/regex/createRegexFromArray.js +10 -16
  140. package/build/languageProcessing/helpers/regex/createRegexFromArray.js.map +1 -1
  141. package/build/languageProcessing/helpers/regex/createRegexFromDoubleArray.js +4 -10
  142. package/build/languageProcessing/helpers/regex/createRegexFromDoubleArray.js.map +1 -1
  143. package/build/languageProcessing/helpers/regex/createWordRegex.js +12 -18
  144. package/build/languageProcessing/helpers/regex/createWordRegex.js.map +1 -1
  145. package/build/languageProcessing/helpers/regex/matchStringWithRegex.js +1 -7
  146. package/build/languageProcessing/helpers/regex/matchStringWithRegex.js.map +1 -1
  147. package/build/languageProcessing/helpers/regex/searchAndReplaceWithOneRegex.js +1 -7
  148. package/build/languageProcessing/helpers/regex/searchAndReplaceWithOneRegex.js.map +1 -1
  149. package/build/languageProcessing/helpers/sanitize/doubleQuotes.js +1 -7
  150. package/build/languageProcessing/helpers/sanitize/doubleQuotes.js.map +1 -1
  151. package/build/languageProcessing/helpers/sanitize/filterShortcodesFromTree.js +3 -11
  152. package/build/languageProcessing/helpers/sanitize/filterShortcodesFromTree.js.map +1 -1
  153. package/build/languageProcessing/helpers/sanitize/mergeListItems.js +1 -7
  154. package/build/languageProcessing/helpers/sanitize/mergeListItems.js.map +1 -1
  155. package/build/languageProcessing/helpers/sanitize/parseSynonyms.js +5 -11
  156. package/build/languageProcessing/helpers/sanitize/parseSynonyms.js.map +1 -1
  157. package/build/languageProcessing/helpers/sanitize/quotes.js +4 -12
  158. package/build/languageProcessing/helpers/sanitize/quotes.js.map +1 -1
  159. package/build/languageProcessing/helpers/sanitize/removeEmailAddresses.js +1 -7
  160. package/build/languageProcessing/helpers/sanitize/removeEmailAddresses.js.map +1 -1
  161. package/build/languageProcessing/helpers/sanitize/removePunctuation.js +7 -13
  162. package/build/languageProcessing/helpers/sanitize/removePunctuation.js.map +1 -1
  163. package/build/languageProcessing/helpers/sanitize/removePunctuationExceptQuotes.js +1 -7
  164. package/build/languageProcessing/helpers/sanitize/removePunctuationExceptQuotes.js.map +1 -1
  165. package/build/languageProcessing/helpers/sanitize/removeSentenceTerminators.js +1 -7
  166. package/build/languageProcessing/helpers/sanitize/removeSentenceTerminators.js.map +1 -1
  167. package/build/languageProcessing/helpers/sanitize/removeURLs.js +1 -7
  168. package/build/languageProcessing/helpers/sanitize/removeURLs.js.map +1 -1
  169. package/build/languageProcessing/helpers/sanitize/sanitizeLineBreakTag.js +1 -7
  170. package/build/languageProcessing/helpers/sanitize/sanitizeLineBreakTag.js.map +1 -1
  171. package/build/languageProcessing/helpers/sanitize/sanitizeString.js +5 -10
  172. package/build/languageProcessing/helpers/sanitize/sanitizeString.js.map +1 -1
  173. package/build/languageProcessing/helpers/sanitize/stripHTMLTags.js +7 -16
  174. package/build/languageProcessing/helpers/sanitize/stripHTMLTags.js.map +1 -1
  175. package/build/languageProcessing/helpers/sanitize/stripNonTextTags.js +4 -10
  176. package/build/languageProcessing/helpers/sanitize/stripNonTextTags.js.map +1 -1
  177. package/build/languageProcessing/helpers/sanitize/stripNumbers.js +4 -10
  178. package/build/languageProcessing/helpers/sanitize/stripNumbers.js.map +1 -1
  179. package/build/languageProcessing/helpers/sanitize/stripSpaces.js +1 -7
  180. package/build/languageProcessing/helpers/sanitize/stripSpaces.js.map +1 -1
  181. package/build/languageProcessing/helpers/sanitize/stripWordBoundaries.js +2 -10
  182. package/build/languageProcessing/helpers/sanitize/stripWordBoundaries.js.map +1 -1
  183. package/build/languageProcessing/helpers/sanitize/unifyWhitespace.js +2 -11
  184. package/build/languageProcessing/helpers/sanitize/unifyWhitespace.js.map +1 -1
  185. package/build/languageProcessing/helpers/sentence/SentenceTokenizer.js +22 -29
  186. package/build/languageProcessing/helpers/sentence/SentenceTokenizer.js.map +1 -1
  187. package/build/languageProcessing/helpers/sentence/countSentences.js +4 -10
  188. package/build/languageProcessing/helpers/sentence/countSentences.js.map +1 -1
  189. package/build/languageProcessing/helpers/sentence/getSentences.js +13 -20
  190. package/build/languageProcessing/helpers/sentence/getSentences.js.map +1 -1
  191. package/build/languageProcessing/helpers/sentence/getSentencesFromTree.js +2 -9
  192. package/build/languageProcessing/helpers/sentence/getSentencesFromTree.js.map +1 -1
  193. package/build/languageProcessing/helpers/sentence/memoizedSentenceTokenizer.js +4 -10
  194. package/build/languageProcessing/helpers/sentence/memoizedSentenceTokenizer.js.map +1 -1
  195. package/build/languageProcessing/helpers/sentence/sentencesLength.js +7 -13
  196. package/build/languageProcessing/helpers/sentence/sentencesLength.js.map +1 -1
  197. package/build/languageProcessing/helpers/syllables/DeviationFragment.js +5 -11
  198. package/build/languageProcessing/helpers/syllables/DeviationFragment.js.map +1 -1
  199. package/build/languageProcessing/helpers/syllables/countSyllables.js +23 -30
  200. package/build/languageProcessing/helpers/syllables/countSyllables.js.map +1 -1
  201. package/build/languageProcessing/helpers/syllables/syllableCountIterator.js +7 -14
  202. package/build/languageProcessing/helpers/syllables/syllableCountIterator.js.map +1 -1
  203. package/build/languageProcessing/helpers/syllables/syllableCountStep.js +5 -12
  204. package/build/languageProcessing/helpers/syllables/syllableCountStep.js.map +1 -1
  205. package/build/languageProcessing/helpers/transform/transformWordsWithHyphens.js +1 -7
  206. package/build/languageProcessing/helpers/transform/transformWordsWithHyphens.js.map +1 -1
  207. package/build/languageProcessing/helpers/transliterate/replaceDiacritics.js +4 -10
  208. package/build/languageProcessing/helpers/transliterate/replaceDiacritics.js.map +1 -1
  209. package/build/languageProcessing/helpers/transliterate/specialCharacterMappings.js +12 -23
  210. package/build/languageProcessing/helpers/transliterate/specialCharacterMappings.js.map +1 -1
  211. package/build/languageProcessing/helpers/transliterate/transliterate.js +3 -9
  212. package/build/languageProcessing/helpers/transliterate/transliterate.js.map +1 -1
  213. package/build/languageProcessing/helpers/transliterate/transliterateWPstyle.js +3 -9
  214. package/build/languageProcessing/helpers/transliterate/transliterateWPstyle.js.map +1 -1
  215. package/build/languageProcessing/helpers/url/parseSlug.js +1 -7
  216. package/build/languageProcessing/helpers/url/parseSlug.js.map +1 -1
  217. package/build/languageProcessing/helpers/url/url.js +7 -13
  218. package/build/languageProcessing/helpers/url/url.js.map +1 -1
  219. package/build/languageProcessing/helpers/word/addWordboundary.js +1 -7
  220. package/build/languageProcessing/helpers/word/addWordboundary.js.map +1 -1
  221. package/build/languageProcessing/helpers/word/areWordsInSentence.js +4 -10
  222. package/build/languageProcessing/helpers/word/areWordsInSentence.js.map +1 -1
  223. package/build/languageProcessing/helpers/word/countMetaDescriptionLength.js +1 -7
  224. package/build/languageProcessing/helpers/word/countMetaDescriptionLength.js.map +1 -1
  225. package/build/languageProcessing/helpers/word/countWords.js +4 -10
  226. package/build/languageProcessing/helpers/word/countWords.js.map +1 -1
  227. package/build/languageProcessing/helpers/word/createPunctuationTokens.js +5 -10
  228. package/build/languageProcessing/helpers/word/createPunctuationTokens.js.map +1 -1
  229. package/build/languageProcessing/helpers/word/filterWordsFromArray.js +4 -9
  230. package/build/languageProcessing/helpers/word/filterWordsFromArray.js.map +1 -1
  231. package/build/languageProcessing/helpers/word/followsIndex.js +5 -10
  232. package/build/languageProcessing/helpers/word/followsIndex.js.map +1 -1
  233. package/build/languageProcessing/helpers/word/getAllWordsFromTree.js +7 -13
  234. package/build/languageProcessing/helpers/word/getAllWordsFromTree.js.map +1 -1
  235. package/build/languageProcessing/helpers/word/getWords.js +9 -19
  236. package/build/languageProcessing/helpers/word/getWords.js.map +1 -1
  237. package/build/languageProcessing/helpers/word/includesIndex.js +5 -10
  238. package/build/languageProcessing/helpers/word/includesIndex.js.map +1 -1
  239. package/build/languageProcessing/helpers/word/indices.js +14 -25
  240. package/build/languageProcessing/helpers/word/indices.js.map +1 -1
  241. package/build/languageProcessing/helpers/word/markWordsInSentences.js +23 -35
  242. package/build/languageProcessing/helpers/word/markWordsInSentences.js.map +1 -1
  243. package/build/languageProcessing/helpers/word/matchWordInSentence.js +8 -15
  244. package/build/languageProcessing/helpers/word/matchWordInSentence.js.map +1 -1
  245. package/build/languageProcessing/helpers/word/splitIntoTokens.js +3 -9
  246. package/build/languageProcessing/helpers/word/splitIntoTokens.js.map +1 -1
  247. package/build/languageProcessing/index.js +41 -282
  248. package/build/languageProcessing/index.js.map +1 -1
  249. package/build/languageProcessing/languages/_default/Researcher.js +5 -13
  250. package/build/languageProcessing/languages/_default/Researcher.js.map +1 -1
  251. package/build/languageProcessing/languages/_default/helpers/getStemmer.js +3 -9
  252. package/build/languageProcessing/languages/_default/helpers/getStemmer.js.map +1 -1
  253. package/build/languageProcessing/languages/ar/Researcher.js +19 -27
  254. package/build/languageProcessing/languages/ar/Researcher.js.map +1 -1
  255. package/build/languageProcessing/languages/ar/config/firstWordExceptions.js +1 -7
  256. package/build/languageProcessing/languages/ar/config/firstWordExceptions.js.map +1 -1
  257. package/build/languageProcessing/languages/ar/config/functionWords.js +7 -13
  258. package/build/languageProcessing/languages/ar/config/functionWords.js.map +1 -1
  259. package/build/languageProcessing/languages/ar/config/internal/passiveVerbsWithLongVowel.js +1 -7
  260. package/build/languageProcessing/languages/ar/config/internal/passiveVerbsWithLongVowel.js.map +1 -1
  261. package/build/languageProcessing/languages/ar/config/prefixedFunctionWords.js +2 -8
  262. package/build/languageProcessing/languages/ar/config/prefixedFunctionWords.js.map +1 -1
  263. package/build/languageProcessing/languages/ar/config/transitionWords.js +4 -10
  264. package/build/languageProcessing/languages/ar/config/transitionWords.js.map +1 -1
  265. package/build/languageProcessing/languages/ar/config/twoPartTransitionWords.js +2 -7
  266. package/build/languageProcessing/languages/ar/config/twoPartTransitionWords.js.map +1 -1
  267. package/build/languageProcessing/languages/ar/helpers/createBasicWordForms.js +6 -11
  268. package/build/languageProcessing/languages/ar/helpers/createBasicWordForms.js.map +1 -1
  269. package/build/languageProcessing/languages/ar/helpers/getStemmer.js +8 -14
  270. package/build/languageProcessing/languages/ar/helpers/getStemmer.js.map +1 -1
  271. package/build/languageProcessing/languages/ar/helpers/internal/stem.js +1 -7
  272. package/build/languageProcessing/languages/ar/helpers/internal/stem.js.map +1 -1
  273. package/build/languageProcessing/languages/ar/helpers/isPassiveSentence.js +5 -12
  274. package/build/languageProcessing/languages/ar/helpers/isPassiveSentence.js.map +1 -1
  275. package/build/languageProcessing/languages/ca/Researcher.js +11 -19
  276. package/build/languageProcessing/languages/ca/Researcher.js.map +1 -1
  277. package/build/languageProcessing/languages/ca/config/sentenceLength.js +1 -7
  278. package/build/languageProcessing/languages/ca/config/sentenceLength.js.map +1 -1
  279. package/build/languageProcessing/languages/ca/config/transitionWords.js +4 -10
  280. package/build/languageProcessing/languages/ca/config/transitionWords.js.map +1 -1
  281. package/build/languageProcessing/languages/ca/config/twoPartTransitionWords.js +2 -7
  282. package/build/languageProcessing/languages/ca/config/twoPartTransitionWords.js.map +1 -1
  283. package/build/languageProcessing/languages/ca/helpers/getStemmer.js +3 -9
  284. package/build/languageProcessing/languages/ca/helpers/getStemmer.js.map +1 -1
  285. package/build/languageProcessing/languages/cs/Researcher.js +17 -25
  286. package/build/languageProcessing/languages/cs/Researcher.js.map +1 -1
  287. package/build/languageProcessing/languages/cs/config/firstWordExceptions.js +1 -7
  288. package/build/languageProcessing/languages/cs/config/firstWordExceptions.js.map +1 -1
  289. package/build/languageProcessing/languages/cs/config/functionWords.js +4 -10
  290. package/build/languageProcessing/languages/cs/config/functionWords.js.map +1 -1
  291. package/build/languageProcessing/languages/cs/config/internal/passiveVoiceAuxiliaries.js +2 -8
  292. package/build/languageProcessing/languages/cs/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  293. package/build/languageProcessing/languages/cs/config/internal/passiveVoiceEndings.js +2 -8
  294. package/build/languageProcessing/languages/cs/config/internal/passiveVoiceEndings.js.map +1 -1
  295. package/build/languageProcessing/languages/cs/config/stopWords.js +1 -7
  296. package/build/languageProcessing/languages/cs/config/stopWords.js.map +1 -1
  297. package/build/languageProcessing/languages/cs/config/transitionWords.js +4 -10
  298. package/build/languageProcessing/languages/cs/config/transitionWords.js.map +1 -1
  299. package/build/languageProcessing/languages/cs/config/twoPartTransitionWords.js +2 -7
  300. package/build/languageProcessing/languages/cs/config/twoPartTransitionWords.js.map +1 -1
  301. package/build/languageProcessing/languages/cs/helpers/getClauses.js +9 -16
  302. package/build/languageProcessing/languages/cs/helpers/getClauses.js.map +1 -1
  303. package/build/languageProcessing/languages/cs/helpers/getStemmer.js +8 -14
  304. package/build/languageProcessing/languages/cs/helpers/getStemmer.js.map +1 -1
  305. package/build/languageProcessing/languages/cs/helpers/internal/getParticiples.js +6 -12
  306. package/build/languageProcessing/languages/cs/helpers/internal/getParticiples.js.map +1 -1
  307. package/build/languageProcessing/languages/cs/helpers/internal/stem.js +1 -7
  308. package/build/languageProcessing/languages/cs/helpers/internal/stem.js.map +1 -1
  309. package/build/languageProcessing/languages/cs/values/Clause.js +5 -12
  310. package/build/languageProcessing/languages/cs/values/Clause.js.map +1 -1
  311. package/build/languageProcessing/languages/de/Researcher.js +27 -35
  312. package/build/languageProcessing/languages/de/Researcher.js.map +1 -1
  313. package/build/languageProcessing/languages/de/config/firstWordExceptions.js +1 -7
  314. package/build/languageProcessing/languages/de/config/firstWordExceptions.js.map +1 -1
  315. package/build/languageProcessing/languages/de/config/functionWords.js +11 -19
  316. package/build/languageProcessing/languages/de/config/functionWords.js.map +1 -1
  317. package/build/languageProcessing/languages/de/config/internal/exceptionsParticiplesActive.js +1 -7
  318. package/build/languageProcessing/languages/de/config/internal/exceptionsParticiplesActive.js.map +1 -1
  319. package/build/languageProcessing/languages/de/config/internal/passiveVoiceAuxiliaries.js +4 -10
  320. package/build/languageProcessing/languages/de/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  321. package/build/languageProcessing/languages/de/config/internal/passiveVoiceIrregulars.js +1 -7
  322. package/build/languageProcessing/languages/de/config/internal/passiveVoiceIrregulars.js.map +1 -1
  323. package/build/languageProcessing/languages/de/config/internal/passiveVoiceRegex.js +1 -7
  324. package/build/languageProcessing/languages/de/config/internal/passiveVoiceRegex.js.map +1 -1
  325. package/build/languageProcessing/languages/de/config/keyphraseLength.js +1 -7
  326. package/build/languageProcessing/languages/de/config/keyphraseLength.js.map +1 -1
  327. package/build/languageProcessing/languages/de/config/stopWords.js +1 -7
  328. package/build/languageProcessing/languages/de/config/stopWords.js.map +1 -1
  329. package/build/languageProcessing/languages/de/config/transitionWords.js +4 -10
  330. package/build/languageProcessing/languages/de/config/transitionWords.js.map +1 -1
  331. package/build/languageProcessing/languages/de/config/twoPartTransitionWords.js +2 -7
  332. package/build/languageProcessing/languages/de/config/twoPartTransitionWords.js.map +1 -1
  333. package/build/languageProcessing/languages/de/config/wordComplexity.js +1 -7
  334. package/build/languageProcessing/languages/de/config/wordComplexity.js.map +1 -1
  335. package/build/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js +3 -9
  336. package/build/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js.map +1 -1
  337. package/build/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js +1 -7
  338. package/build/languageProcessing/languages/de/helpers/checkIfWordIsComplex.js.map +1 -1
  339. package/build/languageProcessing/languages/de/helpers/checkIfWordIsFunction.js +3 -8
  340. package/build/languageProcessing/languages/de/helpers/checkIfWordIsFunction.js.map +1 -1
  341. package/build/languageProcessing/languages/de/helpers/getClauses.js +9 -16
  342. package/build/languageProcessing/languages/de/helpers/getClauses.js.map +1 -1
  343. package/build/languageProcessing/languages/de/helpers/getStemmer.js +8 -14
  344. package/build/languageProcessing/languages/de/helpers/getStemmer.js.map +1 -1
  345. package/build/languageProcessing/languages/de/helpers/internal/SentenceTokenizer.js +4 -11
  346. package/build/languageProcessing/languages/de/helpers/internal/SentenceTokenizer.js.map +1 -1
  347. package/build/languageProcessing/languages/de/helpers/internal/detectAndStemRegularParticiple.js +4 -10
  348. package/build/languageProcessing/languages/de/helpers/internal/detectAndStemRegularParticiple.js.map +1 -1
  349. package/build/languageProcessing/languages/de/helpers/internal/determineStem.js +10 -16
  350. package/build/languageProcessing/languages/de/helpers/internal/determineStem.js.map +1 -1
  351. package/build/languageProcessing/languages/de/helpers/internal/getParticiples.js +9 -16
  352. package/build/languageProcessing/languages/de/helpers/internal/getParticiples.js.map +1 -1
  353. package/build/languageProcessing/languages/de/helpers/internal/stem.js +1 -7
  354. package/build/languageProcessing/languages/de/helpers/internal/stem.js.map +1 -1
  355. package/build/languageProcessing/languages/de/helpers/memoizedSentenceTokenizer.js +4 -10
  356. package/build/languageProcessing/languages/de/helpers/memoizedSentenceTokenizer.js.map +1 -1
  357. package/build/languageProcessing/languages/de/values/Clause.js +11 -18
  358. package/build/languageProcessing/languages/de/values/Clause.js.map +1 -1
  359. package/build/languageProcessing/languages/el/Researcher.js +18 -26
  360. package/build/languageProcessing/languages/el/Researcher.js.map +1 -1
  361. package/build/languageProcessing/languages/el/config/firstWordExceptions.js +1 -7
  362. package/build/languageProcessing/languages/el/config/firstWordExceptions.js.map +1 -1
  363. package/build/languageProcessing/languages/el/config/functionWords.js +4 -10
  364. package/build/languageProcessing/languages/el/config/functionWords.js.map +1 -1
  365. package/build/languageProcessing/languages/el/config/internal/auxiliaries.js +1 -7
  366. package/build/languageProcessing/languages/el/config/internal/auxiliaries.js.map +1 -1
  367. package/build/languageProcessing/languages/el/config/internal/morphologicalPassiveSuffixes.js +1 -7
  368. package/build/languageProcessing/languages/el/config/internal/morphologicalPassiveSuffixes.js.map +1 -1
  369. package/build/languageProcessing/languages/el/config/internal/nonPassiveVerbStems.js +1 -7
  370. package/build/languageProcessing/languages/el/config/internal/nonPassiveVerbStems.js.map +1 -1
  371. package/build/languageProcessing/languages/el/config/stopWords.js +1 -7
  372. package/build/languageProcessing/languages/el/config/stopWords.js.map +1 -1
  373. package/build/languageProcessing/languages/el/config/transitionWords.js +4 -10
  374. package/build/languageProcessing/languages/el/config/transitionWords.js.map +1 -1
  375. package/build/languageProcessing/languages/el/config/twoPartTransitionWords.js +2 -7
  376. package/build/languageProcessing/languages/el/config/twoPartTransitionWords.js.map +1 -1
  377. package/build/languageProcessing/languages/el/helpers/getClauses.js +9 -16
  378. package/build/languageProcessing/languages/el/helpers/getClauses.js.map +1 -1
  379. package/build/languageProcessing/languages/el/helpers/getStemmer.js +7 -14
  380. package/build/languageProcessing/languages/el/helpers/getStemmer.js.map +1 -1
  381. package/build/languageProcessing/languages/el/helpers/internal/getParticiples.js +3 -9
  382. package/build/languageProcessing/languages/el/helpers/internal/getParticiples.js.map +1 -1
  383. package/build/languageProcessing/languages/el/helpers/internal/stem.js +4 -13
  384. package/build/languageProcessing/languages/el/helpers/internal/stem.js.map +1 -1
  385. package/build/languageProcessing/languages/el/helpers/isPassiveSentence.js +7 -14
  386. package/build/languageProcessing/languages/el/helpers/isPassiveSentence.js.map +1 -1
  387. package/build/languageProcessing/languages/el/values/Clause.js +6 -12
  388. package/build/languageProcessing/languages/el/values/Clause.js.map +1 -1
  389. package/build/languageProcessing/languages/en/Researcher.js +21 -29
  390. package/build/languageProcessing/languages/en/Researcher.js.map +1 -1
  391. package/build/languageProcessing/languages/en/config/abbreviations.js +2 -8
  392. package/build/languageProcessing/languages/en/config/abbreviations.js.map +1 -1
  393. package/build/languageProcessing/languages/en/config/firstWordExceptions.js +1 -7
  394. package/build/languageProcessing/languages/en/config/firstWordExceptions.js.map +1 -1
  395. package/build/languageProcessing/languages/en/config/functionWords.js +11 -18
  396. package/build/languageProcessing/languages/en/config/functionWords.js.map +1 -1
  397. package/build/languageProcessing/languages/en/config/internal/passiveVoiceAuxiliaries.js +6 -12
  398. package/build/languageProcessing/languages/en/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  399. package/build/languageProcessing/languages/en/config/internal/passiveVoiceIrregulars.js +1 -7
  400. package/build/languageProcessing/languages/en/config/internal/passiveVoiceIrregulars.js.map +1 -1
  401. package/build/languageProcessing/languages/en/config/internal/passiveVoiceNonVerbEndingEd.js +1 -7
  402. package/build/languageProcessing/languages/en/config/internal/passiveVoiceNonVerbEndingEd.js.map +1 -1
  403. package/build/languageProcessing/languages/en/config/regularParticiplesRegex.js +1 -7
  404. package/build/languageProcessing/languages/en/config/regularParticiplesRegex.js.map +1 -1
  405. package/build/languageProcessing/languages/en/config/stopWords.js +1 -7
  406. package/build/languageProcessing/languages/en/config/stopWords.js.map +1 -1
  407. package/build/languageProcessing/languages/en/config/transitionWords.js +4 -10
  408. package/build/languageProcessing/languages/en/config/transitionWords.js.map +1 -1
  409. package/build/languageProcessing/languages/en/config/twoPartTransitionWords.js +2 -7
  410. package/build/languageProcessing/languages/en/config/twoPartTransitionWords.js.map +1 -1
  411. package/build/languageProcessing/languages/en/config/wordComplexity.js +1 -7
  412. package/build/languageProcessing/languages/en/config/wordComplexity.js.map +1 -1
  413. package/build/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js +3 -9
  414. package/build/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js.map +1 -1
  415. package/build/languageProcessing/languages/en/helpers/checkIfWordIsComplex.js +4 -10
  416. package/build/languageProcessing/languages/en/helpers/checkIfWordIsComplex.js.map +1 -1
  417. package/build/languageProcessing/languages/en/helpers/getClauses.js +15 -22
  418. package/build/languageProcessing/languages/en/helpers/getClauses.js.map +1 -1
  419. package/build/languageProcessing/languages/en/helpers/getStemmer.js +8 -14
  420. package/build/languageProcessing/languages/en/helpers/getStemmer.js.map +1 -1
  421. package/build/languageProcessing/languages/en/helpers/internal/determineStem.js +21 -32
  422. package/build/languageProcessing/languages/en/helpers/internal/determineStem.js.map +1 -1
  423. package/build/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js +6 -13
  424. package/build/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js.map +1 -1
  425. package/build/languageProcessing/languages/en/helpers/internal/getParticiples.js +8 -14
  426. package/build/languageProcessing/languages/en/helpers/internal/getParticiples.js.map +1 -1
  427. package/build/languageProcessing/languages/en/helpers/internal/getVerbStem.js +6 -16
  428. package/build/languageProcessing/languages/en/helpers/internal/getVerbStem.js.map +1 -1
  429. package/build/languageProcessing/languages/en/values/Clause.js +10 -17
  430. package/build/languageProcessing/languages/en/values/Clause.js.map +1 -1
  431. package/build/languageProcessing/languages/es/Researcher.js +23 -31
  432. package/build/languageProcessing/languages/es/Researcher.js.map +1 -1
  433. package/build/languageProcessing/languages/es/config/firstWordExceptions.js +1 -7
  434. package/build/languageProcessing/languages/es/config/firstWordExceptions.js.map +1 -1
  435. package/build/languageProcessing/languages/es/config/functionWords.js +11 -17
  436. package/build/languageProcessing/languages/es/config/functionWords.js.map +1 -1
  437. package/build/languageProcessing/languages/es/config/internal/passiveVoiceAuxiliaries.js +1 -7
  438. package/build/languageProcessing/languages/es/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  439. package/build/languageProcessing/languages/es/config/internal/passiveVoiceParticiples.js +1 -7
  440. package/build/languageProcessing/languages/es/config/internal/passiveVoiceParticiples.js.map +1 -1
  441. package/build/languageProcessing/languages/es/config/sentenceLength.js +1 -7
  442. package/build/languageProcessing/languages/es/config/sentenceLength.js.map +1 -1
  443. package/build/languageProcessing/languages/es/config/stopWords.js +1 -7
  444. package/build/languageProcessing/languages/es/config/stopWords.js.map +1 -1
  445. package/build/languageProcessing/languages/es/config/transitionWords.js +4 -10
  446. package/build/languageProcessing/languages/es/config/transitionWords.js.map +1 -1
  447. package/build/languageProcessing/languages/es/config/twoPartTransitionWords.js +2 -7
  448. package/build/languageProcessing/languages/es/config/twoPartTransitionWords.js.map +1 -1
  449. package/build/languageProcessing/languages/es/config/wordComplexity.js +1 -7
  450. package/build/languageProcessing/languages/es/config/wordComplexity.js.map +1 -1
  451. package/build/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js +3 -9
  452. package/build/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js.map +1 -1
  453. package/build/languageProcessing/languages/es/helpers/checkIfWordIsComplex.js +1 -7
  454. package/build/languageProcessing/languages/es/helpers/checkIfWordIsComplex.js.map +1 -1
  455. package/build/languageProcessing/languages/es/helpers/getClauses.js +10 -17
  456. package/build/languageProcessing/languages/es/helpers/getClauses.js.map +1 -1
  457. package/build/languageProcessing/languages/es/helpers/getStemmer.js +8 -14
  458. package/build/languageProcessing/languages/es/helpers/getStemmer.js.map +1 -1
  459. package/build/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js +7 -13
  460. package/build/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js.map +1 -1
  461. package/build/languageProcessing/languages/es/helpers/internal/getParticiples.js +6 -12
  462. package/build/languageProcessing/languages/es/helpers/internal/getParticiples.js.map +1 -1
  463. package/build/languageProcessing/languages/es/helpers/internal/stem.js +5 -13
  464. package/build/languageProcessing/languages/es/helpers/internal/stem.js.map +1 -1
  465. package/build/languageProcessing/languages/es/values/Clause.js +7 -14
  466. package/build/languageProcessing/languages/es/values/Clause.js.map +1 -1
  467. package/build/languageProcessing/languages/fa/Researcher.js +19 -27
  468. package/build/languageProcessing/languages/fa/Researcher.js.map +1 -1
  469. package/build/languageProcessing/languages/fa/config/firstWordExceptions.js +1 -7
  470. package/build/languageProcessing/languages/fa/config/firstWordExceptions.js.map +1 -1
  471. package/build/languageProcessing/languages/fa/config/functionWords.js +4 -10
  472. package/build/languageProcessing/languages/fa/config/functionWords.js.map +1 -1
  473. package/build/languageProcessing/languages/fa/config/internal/participles.js +1 -7
  474. package/build/languageProcessing/languages/fa/config/internal/participles.js.map +1 -1
  475. package/build/languageProcessing/languages/fa/config/sentenceLength.js +1 -7
  476. package/build/languageProcessing/languages/fa/config/sentenceLength.js.map +1 -1
  477. package/build/languageProcessing/languages/fa/config/transitionWords.js +4 -10
  478. package/build/languageProcessing/languages/fa/config/transitionWords.js.map +1 -1
  479. package/build/languageProcessing/languages/fa/config/twoPartTransitionWords.js +2 -7
  480. package/build/languageProcessing/languages/fa/config/twoPartTransitionWords.js.map +1 -1
  481. package/build/languageProcessing/languages/fa/helpers/createBasicWordForms.js +3 -9
  482. package/build/languageProcessing/languages/fa/helpers/createBasicWordForms.js.map +1 -1
  483. package/build/languageProcessing/languages/fa/helpers/getStemmer.js +3 -9
  484. package/build/languageProcessing/languages/fa/helpers/getStemmer.js.map +1 -1
  485. package/build/languageProcessing/languages/fa/helpers/isPassiveSentence.js +6 -12
  486. package/build/languageProcessing/languages/fa/helpers/isPassiveSentence.js.map +1 -1
  487. package/build/languageProcessing/languages/fr/Researcher.js +21 -29
  488. package/build/languageProcessing/languages/fr/Researcher.js.map +1 -1
  489. package/build/languageProcessing/languages/fr/config/firstWordExceptions.js +1 -7
  490. package/build/languageProcessing/languages/fr/config/firstWordExceptions.js.map +1 -1
  491. package/build/languageProcessing/languages/fr/config/functionWords.js +11 -17
  492. package/build/languageProcessing/languages/fr/config/functionWords.js.map +1 -1
  493. package/build/languageProcessing/languages/fr/config/internal/exceptionsParticiplesActive.js +4 -9
  494. package/build/languageProcessing/languages/fr/config/internal/exceptionsParticiplesActive.js.map +1 -1
  495. package/build/languageProcessing/languages/fr/config/internal/passiveVoiceAuxiliaries.js +1 -7
  496. package/build/languageProcessing/languages/fr/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  497. package/build/languageProcessing/languages/fr/config/internal/passiveVoiceIrregulars.js +4 -9
  498. package/build/languageProcessing/languages/fr/config/internal/passiveVoiceIrregulars.js.map +1 -1
  499. package/build/languageProcessing/languages/fr/config/stopWords.js +1 -7
  500. package/build/languageProcessing/languages/fr/config/stopWords.js.map +1 -1
  501. package/build/languageProcessing/languages/fr/config/transitionWords.js +4 -10
  502. package/build/languageProcessing/languages/fr/config/transitionWords.js.map +1 -1
  503. package/build/languageProcessing/languages/fr/config/twoPartTransitionWords.js +2 -7
  504. package/build/languageProcessing/languages/fr/config/twoPartTransitionWords.js.map +1 -1
  505. package/build/languageProcessing/languages/fr/config/wordComplexity.js +1 -7
  506. package/build/languageProcessing/languages/fr/config/wordComplexity.js.map +1 -1
  507. package/build/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js +3 -9
  508. package/build/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js.map +1 -1
  509. package/build/languageProcessing/languages/fr/helpers/checkIfWordIsComplex.js +3 -9
  510. package/build/languageProcessing/languages/fr/helpers/checkIfWordIsComplex.js.map +1 -1
  511. package/build/languageProcessing/languages/fr/helpers/getClauses.js +10 -17
  512. package/build/languageProcessing/languages/fr/helpers/getClauses.js.map +1 -1
  513. package/build/languageProcessing/languages/fr/helpers/getStemmer.js +8 -14
  514. package/build/languageProcessing/languages/fr/helpers/getStemmer.js.map +1 -1
  515. package/build/languageProcessing/languages/fr/helpers/internal/getParticiples.js +11 -16
  516. package/build/languageProcessing/languages/fr/helpers/internal/getParticiples.js.map +1 -1
  517. package/build/languageProcessing/languages/fr/helpers/internal/stem.js +3 -10
  518. package/build/languageProcessing/languages/fr/helpers/internal/stem.js.map +1 -1
  519. package/build/languageProcessing/languages/fr/values/Clause.js +14 -20
  520. package/build/languageProcessing/languages/fr/values/Clause.js.map +1 -1
  521. package/build/languageProcessing/languages/he/Researcher.js +21 -29
  522. package/build/languageProcessing/languages/he/Researcher.js.map +1 -1
  523. package/build/languageProcessing/languages/he/config/firstWordExceptions.js +1 -7
  524. package/build/languageProcessing/languages/he/config/firstWordExceptions.js.map +1 -1
  525. package/build/languageProcessing/languages/he/config/functionWords.js +4 -11
  526. package/build/languageProcessing/languages/he/config/functionWords.js.map +1 -1
  527. package/build/languageProcessing/languages/he/config/internal/regularRootsHufal.js +1 -7
  528. package/build/languageProcessing/languages/he/config/internal/regularRootsHufal.js.map +1 -1
  529. package/build/languageProcessing/languages/he/config/internal/regularRootsNifal.js +1 -7
  530. package/build/languageProcessing/languages/he/config/internal/regularRootsNifal.js.map +1 -1
  531. package/build/languageProcessing/languages/he/config/internal/regularRootsPual.js +1 -7
  532. package/build/languageProcessing/languages/he/config/internal/regularRootsPual.js.map +1 -1
  533. package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsHufal.js +1 -7
  534. package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsHufal.js.map +1 -1
  535. package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsNifal.js +1 -7
  536. package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsNifal.js.map +1 -1
  537. package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsPual.js +1 -7
  538. package/build/languageProcessing/languages/he/config/passiveVoice/regularRootsPual.js.map +1 -1
  539. package/build/languageProcessing/languages/he/config/prefixedFunctionWords.js +2 -8
  540. package/build/languageProcessing/languages/he/config/prefixedFunctionWords.js.map +1 -1
  541. package/build/languageProcessing/languages/he/config/sentenceLength.js +1 -7
  542. package/build/languageProcessing/languages/he/config/sentenceLength.js.map +1 -1
  543. package/build/languageProcessing/languages/he/config/transitionWords.js +4 -10
  544. package/build/languageProcessing/languages/he/config/transitionWords.js.map +1 -1
  545. package/build/languageProcessing/languages/he/config/twoPartTransitionWords.js +2 -7
  546. package/build/languageProcessing/languages/he/config/twoPartTransitionWords.js.map +1 -1
  547. package/build/languageProcessing/languages/he/helpers/createBasicWordForms.js +6 -11
  548. package/build/languageProcessing/languages/he/helpers/createBasicWordForms.js.map +1 -1
  549. package/build/languageProcessing/languages/he/helpers/getStemmer.js +8 -14
  550. package/build/languageProcessing/languages/he/helpers/getStemmer.js.map +1 -1
  551. package/build/languageProcessing/languages/he/helpers/internal/stem.js +1 -7
  552. package/build/languageProcessing/languages/he/helpers/internal/stem.js.map +1 -1
  553. package/build/languageProcessing/languages/he/helpers/isPassiveSentence.js +10 -16
  554. package/build/languageProcessing/languages/he/helpers/isPassiveSentence.js.map +1 -1
  555. package/build/languageProcessing/languages/he/helpers/stem.js +1 -7
  556. package/build/languageProcessing/languages/he/helpers/stem.js.map +1 -1
  557. package/build/languageProcessing/languages/hu/Researcher.js +19 -27
  558. package/build/languageProcessing/languages/hu/Researcher.js.map +1 -1
  559. package/build/languageProcessing/languages/hu/config/firstWordExceptions.js +1 -7
  560. package/build/languageProcessing/languages/hu/config/firstWordExceptions.js.map +1 -1
  561. package/build/languageProcessing/languages/hu/config/functionWords.js +4 -10
  562. package/build/languageProcessing/languages/hu/config/functionWords.js.map +1 -1
  563. package/build/languageProcessing/languages/hu/config/internal/auxiliaries.js +1 -7
  564. package/build/languageProcessing/languages/hu/config/internal/auxiliaries.js.map +1 -1
  565. package/build/languageProcessing/languages/hu/config/internal/morphologicalPassiveAffixes.js +3 -9
  566. package/build/languageProcessing/languages/hu/config/internal/morphologicalPassiveAffixes.js.map +1 -1
  567. package/build/languageProcessing/languages/hu/config/internal/nonPassivesInVaAndVe.js +2 -7
  568. package/build/languageProcessing/languages/hu/config/internal/nonPassivesInVaAndVe.js.map +1 -1
  569. package/build/languageProcessing/languages/hu/config/internal/odikVerbs.js +1 -7
  570. package/build/languageProcessing/languages/hu/config/internal/odikVerbs.js.map +1 -1
  571. package/build/languageProcessing/languages/hu/config/internal/participles.js +2 -7
  572. package/build/languageProcessing/languages/hu/config/internal/participles.js.map +1 -1
  573. package/build/languageProcessing/languages/hu/config/stopWords.js +2 -7
  574. package/build/languageProcessing/languages/hu/config/stopWords.js.map +1 -1
  575. package/build/languageProcessing/languages/hu/config/transitionWords.js +4 -10
  576. package/build/languageProcessing/languages/hu/config/transitionWords.js.map +1 -1
  577. package/build/languageProcessing/languages/hu/config/twoPartTransitionWords.js +2 -7
  578. package/build/languageProcessing/languages/hu/config/twoPartTransitionWords.js.map +1 -1
  579. package/build/languageProcessing/languages/hu/helpers/getClauses.js +9 -16
  580. package/build/languageProcessing/languages/hu/helpers/getClauses.js.map +1 -1
  581. package/build/languageProcessing/languages/hu/helpers/getStemmer.js +8 -14
  582. package/build/languageProcessing/languages/hu/helpers/getStemmer.js.map +1 -1
  583. package/build/languageProcessing/languages/hu/helpers/internal/getParticiples.js +6 -12
  584. package/build/languageProcessing/languages/hu/helpers/internal/getParticiples.js.map +1 -1
  585. package/build/languageProcessing/languages/hu/helpers/internal/stem.js +1 -7
  586. package/build/languageProcessing/languages/hu/helpers/internal/stem.js.map +1 -1
  587. package/build/languageProcessing/languages/hu/helpers/isPassiveSentence.js +9 -15
  588. package/build/languageProcessing/languages/hu/helpers/isPassiveSentence.js.map +1 -1
  589. package/build/languageProcessing/languages/hu/values/Clause.js +8 -14
  590. package/build/languageProcessing/languages/hu/values/Clause.js.map +1 -1
  591. package/build/languageProcessing/languages/id/Researcher.js +17 -25
  592. package/build/languageProcessing/languages/id/Researcher.js.map +1 -1
  593. package/build/languageProcessing/languages/id/config/firstWordExceptions.js +1 -7
  594. package/build/languageProcessing/languages/id/config/firstWordExceptions.js.map +1 -1
  595. package/build/languageProcessing/languages/id/config/functionWords.js +8 -16
  596. package/build/languageProcessing/languages/id/config/functionWords.js.map +1 -1
  597. package/build/languageProcessing/languages/id/config/internal/nonPassiveVerbsStartingDi.js +1 -7
  598. package/build/languageProcessing/languages/id/config/internal/nonPassiveVerbsStartingDi.js.map +1 -1
  599. package/build/languageProcessing/languages/id/config/transitionWords.js +4 -10
  600. package/build/languageProcessing/languages/id/config/transitionWords.js.map +1 -1
  601. package/build/languageProcessing/languages/id/config/twoPartTransitionWords.js +2 -7
  602. package/build/languageProcessing/languages/id/config/twoPartTransitionWords.js.map +1 -1
  603. package/build/languageProcessing/languages/id/helpers/getStemmer.js +8 -14
  604. package/build/languageProcessing/languages/id/helpers/getStemmer.js.map +1 -1
  605. package/build/languageProcessing/languages/id/helpers/internal/stem.js +29 -34
  606. package/build/languageProcessing/languages/id/helpers/internal/stem.js.map +1 -1
  607. package/build/languageProcessing/languages/id/helpers/internal/stemHelpers.js +5 -13
  608. package/build/languageProcessing/languages/id/helpers/internal/stemHelpers.js.map +1 -1
  609. package/build/languageProcessing/languages/id/helpers/isPassiveSentence.js +5 -12
  610. package/build/languageProcessing/languages/id/helpers/isPassiveSentence.js.map +1 -1
  611. package/build/languageProcessing/languages/id/helpers/splitIntoTokensCustom.js +3 -9
  612. package/build/languageProcessing/languages/id/helpers/splitIntoTokensCustom.js.map +1 -1
  613. package/build/languageProcessing/languages/it/Researcher.js +23 -31
  614. package/build/languageProcessing/languages/it/Researcher.js.map +1 -1
  615. package/build/languageProcessing/languages/it/config/firstWordExceptions.js +1 -7
  616. package/build/languageProcessing/languages/it/config/firstWordExceptions.js.map +1 -1
  617. package/build/languageProcessing/languages/it/config/functionWords.js +11 -17
  618. package/build/languageProcessing/languages/it/config/functionWords.js.map +1 -1
  619. package/build/languageProcessing/languages/it/config/internal/passiveVoiceAuxiliaries.js +1 -7
  620. package/build/languageProcessing/languages/it/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  621. package/build/languageProcessing/languages/it/config/internal/passiveVoiceParticiples.js +1 -7
  622. package/build/languageProcessing/languages/it/config/internal/passiveVoiceParticiples.js.map +1 -1
  623. package/build/languageProcessing/languages/it/config/sentenceLength.js +1 -7
  624. package/build/languageProcessing/languages/it/config/sentenceLength.js.map +1 -1
  625. package/build/languageProcessing/languages/it/config/stopWords.js +1 -7
  626. package/build/languageProcessing/languages/it/config/stopWords.js.map +1 -1
  627. package/build/languageProcessing/languages/it/config/transitionWords.js +4 -10
  628. package/build/languageProcessing/languages/it/config/transitionWords.js.map +1 -1
  629. package/build/languageProcessing/languages/it/config/twoPartTransitionWords.js +1 -7
  630. package/build/languageProcessing/languages/it/config/twoPartTransitionWords.js.map +1 -1
  631. package/build/languageProcessing/languages/it/helpers/calculateFleschReadingScore.js +3 -9
  632. package/build/languageProcessing/languages/it/helpers/calculateFleschReadingScore.js.map +1 -1
  633. package/build/languageProcessing/languages/it/helpers/getClauses.js +10 -17
  634. package/build/languageProcessing/languages/it/helpers/getClauses.js.map +1 -1
  635. package/build/languageProcessing/languages/it/helpers/getStemmer.js +8 -14
  636. package/build/languageProcessing/languages/it/helpers/getStemmer.js.map +1 -1
  637. package/build/languageProcessing/languages/it/helpers/internal/getParticiples.js +6 -12
  638. package/build/languageProcessing/languages/it/helpers/internal/getParticiples.js.map +1 -1
  639. package/build/languageProcessing/languages/it/helpers/internal/stem.js +3 -9
  640. package/build/languageProcessing/languages/it/helpers/internal/stem.js.map +1 -1
  641. package/build/languageProcessing/languages/it/values/Clause.js +7 -14
  642. package/build/languageProcessing/languages/it/values/Clause.js.map +1 -1
  643. package/build/languageProcessing/languages/ja/Researcher.js +51 -59
  644. package/build/languageProcessing/languages/ja/Researcher.js.map +1 -1
  645. package/build/languageProcessing/languages/ja/config/assessmentApplicabilityCharacterCount.js +1 -7
  646. package/build/languageProcessing/languages/ja/config/assessmentApplicabilityCharacterCount.js.map +1 -1
  647. package/build/languageProcessing/languages/ja/config/firstWordExceptions.js +1 -7
  648. package/build/languageProcessing/languages/ja/config/firstWordExceptions.js.map +1 -1
  649. package/build/languageProcessing/languages/ja/config/functionWords.js +1 -7
  650. package/build/languageProcessing/languages/ja/config/functionWords.js.map +1 -1
  651. package/build/languageProcessing/languages/ja/config/keyphraseLength.js +1 -7
  652. package/build/languageProcessing/languages/ja/config/keyphraseLength.js.map +1 -1
  653. package/build/languageProcessing/languages/ja/config/metaDescriptionLength.js +1 -7
  654. package/build/languageProcessing/languages/ja/config/metaDescriptionLength.js.map +1 -1
  655. package/build/languageProcessing/languages/ja/config/paragraphLength.js +1 -7
  656. package/build/languageProcessing/languages/ja/config/paragraphLength.js.map +1 -1
  657. package/build/languageProcessing/languages/ja/config/sentenceLength.js +1 -7
  658. package/build/languageProcessing/languages/ja/config/sentenceLength.js.map +1 -1
  659. package/build/languageProcessing/languages/ja/config/subheadingsTooLong.js +1 -7
  660. package/build/languageProcessing/languages/ja/config/subheadingsTooLong.js.map +1 -1
  661. package/build/languageProcessing/languages/ja/config/textLength.js +1 -7
  662. package/build/languageProcessing/languages/ja/config/textLength.js.map +1 -1
  663. package/build/languageProcessing/languages/ja/config/topicLength.js +1 -7
  664. package/build/languageProcessing/languages/ja/config/topicLength.js.map +1 -1
  665. package/build/languageProcessing/languages/ja/config/transitionWords.js +2 -7
  666. package/build/languageProcessing/languages/ja/config/transitionWords.js.map +1 -1
  667. package/build/languageProcessing/languages/ja/customResearches/findKeyphraseInSEOTitle.js +16 -22
  668. package/build/languageProcessing/languages/ja/customResearches/findKeyphraseInSEOTitle.js.map +1 -1
  669. package/build/languageProcessing/languages/ja/customResearches/getKeyphraseLength.js +5 -11
  670. package/build/languageProcessing/languages/ja/customResearches/getKeyphraseLength.js.map +1 -1
  671. package/build/languageProcessing/languages/ja/customResearches/getWordForms.js +11 -17
  672. package/build/languageProcessing/languages/ja/customResearches/getWordForms.js.map +1 -1
  673. package/build/languageProcessing/languages/ja/customResearches/textLength.js +3 -9
  674. package/build/languageProcessing/languages/ja/customResearches/textLength.js.map +1 -1
  675. package/build/languageProcessing/languages/ja/helpers/countCharacters.js +6 -12
  676. package/build/languageProcessing/languages/ja/helpers/countCharacters.js.map +1 -1
  677. package/build/languageProcessing/languages/ja/helpers/customGetStemmer.js +8 -14
  678. package/build/languageProcessing/languages/ja/helpers/customGetStemmer.js.map +1 -1
  679. package/build/languageProcessing/languages/ja/helpers/getContentWords.js +5 -11
  680. package/build/languageProcessing/languages/ja/helpers/getContentWords.js.map +1 -1
  681. package/build/languageProcessing/languages/ja/helpers/getWords.js +8 -15
  682. package/build/languageProcessing/languages/ja/helpers/getWords.js.map +1 -1
  683. package/build/languageProcessing/languages/ja/helpers/internal/SentenceTokenizer.js +6 -13
  684. package/build/languageProcessing/languages/ja/helpers/internal/SentenceTokenizer.js.map +1 -1
  685. package/build/languageProcessing/languages/ja/helpers/internal/createWordForms.js +4 -9
  686. package/build/languageProcessing/languages/ja/helpers/internal/createWordForms.js.map +1 -1
  687. package/build/languageProcessing/languages/ja/helpers/internal/determineStem.js +3 -9
  688. package/build/languageProcessing/languages/ja/helpers/internal/determineStem.js.map +1 -1
  689. package/build/languageProcessing/languages/ja/helpers/matchTextWithWord.js +7 -13
  690. package/build/languageProcessing/languages/ja/helpers/matchTextWithWord.js.map +1 -1
  691. package/build/languageProcessing/languages/ja/helpers/matchTransitionWords.js +3 -9
  692. package/build/languageProcessing/languages/ja/helpers/matchTransitionWords.js.map +1 -1
  693. package/build/languageProcessing/languages/ja/helpers/memoizedSentenceTokenizer.js +4 -10
  694. package/build/languageProcessing/languages/ja/helpers/memoizedSentenceTokenizer.js.map +1 -1
  695. package/build/languageProcessing/languages/ja/helpers/splitIntoTokensCustom.js +5 -11
  696. package/build/languageProcessing/languages/ja/helpers/splitIntoTokensCustom.js.map +1 -1
  697. package/build/languageProcessing/languages/ja/helpers/wordsCharacterCount.js +1 -7
  698. package/build/languageProcessing/languages/ja/helpers/wordsCharacterCount.js.map +1 -1
  699. package/build/languageProcessing/languages/nb/Researcher.js +17 -25
  700. package/build/languageProcessing/languages/nb/Researcher.js.map +1 -1
  701. package/build/languageProcessing/languages/nb/config/firstWordExceptions.js +1 -7
  702. package/build/languageProcessing/languages/nb/config/firstWordExceptions.js.map +1 -1
  703. package/build/languageProcessing/languages/nb/config/functionWords.js +5 -11
  704. package/build/languageProcessing/languages/nb/config/functionWords.js.map +1 -1
  705. package/build/languageProcessing/languages/nb/config/internal/participles.js +2 -7
  706. package/build/languageProcessing/languages/nb/config/internal/participles.js.map +1 -1
  707. package/build/languageProcessing/languages/nb/config/internal/passiveVoiceAuxiliaries.js +1 -7
  708. package/build/languageProcessing/languages/nb/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  709. package/build/languageProcessing/languages/nb/config/stopWords.js +1 -7
  710. package/build/languageProcessing/languages/nb/config/stopWords.js.map +1 -1
  711. package/build/languageProcessing/languages/nb/config/transitionWords.js +4 -10
  712. package/build/languageProcessing/languages/nb/config/transitionWords.js.map +1 -1
  713. package/build/languageProcessing/languages/nb/config/twoPartTransitionWords.js +2 -7
  714. package/build/languageProcessing/languages/nb/config/twoPartTransitionWords.js.map +1 -1
  715. package/build/languageProcessing/languages/nb/helpers/getClauses.js +11 -18
  716. package/build/languageProcessing/languages/nb/helpers/getClauses.js.map +1 -1
  717. package/build/languageProcessing/languages/nb/helpers/getStemmer.js +8 -14
  718. package/build/languageProcessing/languages/nb/helpers/getStemmer.js.map +1 -1
  719. package/build/languageProcessing/languages/nb/helpers/internal/getParticiples.js +8 -14
  720. package/build/languageProcessing/languages/nb/helpers/internal/getParticiples.js.map +1 -1
  721. package/build/languageProcessing/languages/nb/helpers/internal/stem.js +1 -7
  722. package/build/languageProcessing/languages/nb/helpers/internal/stem.js.map +1 -1
  723. package/build/languageProcessing/languages/nb/values/Clause.js +8 -14
  724. package/build/languageProcessing/languages/nb/values/Clause.js.map +1 -1
  725. package/build/languageProcessing/languages/nl/Researcher.js +23 -31
  726. package/build/languageProcessing/languages/nl/Researcher.js.map +1 -1
  727. package/build/languageProcessing/languages/nl/config/firstWordExceptions.js +1 -7
  728. package/build/languageProcessing/languages/nl/config/firstWordExceptions.js.map +1 -1
  729. package/build/languageProcessing/languages/nl/config/functionWords.js +10 -16
  730. package/build/languageProcessing/languages/nl/config/functionWords.js.map +1 -1
  731. package/build/languageProcessing/languages/nl/config/internal/nonParticiples.js +1 -7
  732. package/build/languageProcessing/languages/nl/config/internal/nonParticiples.js.map +1 -1
  733. package/build/languageProcessing/languages/nl/config/internal/passiveVoiceAuxiliaries.js +1 -7
  734. package/build/languageProcessing/languages/nl/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  735. package/build/languageProcessing/languages/nl/config/internal/passiveVoiceIrregulars.js +1 -7
  736. package/build/languageProcessing/languages/nl/config/internal/passiveVoiceIrregulars.js.map +1 -1
  737. package/build/languageProcessing/languages/nl/config/keyphraseLength.js +1 -7
  738. package/build/languageProcessing/languages/nl/config/keyphraseLength.js.map +1 -1
  739. package/build/languageProcessing/languages/nl/config/stopWords.js +1 -7
  740. package/build/languageProcessing/languages/nl/config/stopWords.js.map +1 -1
  741. package/build/languageProcessing/languages/nl/config/transitionWords.js +4 -10
  742. package/build/languageProcessing/languages/nl/config/transitionWords.js.map +1 -1
  743. package/build/languageProcessing/languages/nl/config/twoPartTransitionWords.js +1 -7
  744. package/build/languageProcessing/languages/nl/config/twoPartTransitionWords.js.map +1 -1
  745. package/build/languageProcessing/languages/nl/helpers/calculateFleschReadingScore.js +3 -9
  746. package/build/languageProcessing/languages/nl/helpers/calculateFleschReadingScore.js.map +1 -1
  747. package/build/languageProcessing/languages/nl/helpers/getClauses.js +9 -16
  748. package/build/languageProcessing/languages/nl/helpers/getClauses.js.map +1 -1
  749. package/build/languageProcessing/languages/nl/helpers/getStemmer.js +8 -14
  750. package/build/languageProcessing/languages/nl/helpers/getStemmer.js.map +1 -1
  751. package/build/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js +7 -13
  752. package/build/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js.map +1 -1
  753. package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js +8 -14
  754. package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js.map +1 -1
  755. package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemSuffixes.js +10 -15
  756. package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemSuffixes.js.map +1 -1
  757. package/build/languageProcessing/languages/nl/helpers/internal/determineStem.js +10 -16
  758. package/build/languageProcessing/languages/nl/helpers/internal/determineStem.js.map +1 -1
  759. package/build/languageProcessing/languages/nl/helpers/internal/getParticiples.js +7 -13
  760. package/build/languageProcessing/languages/nl/helpers/internal/getParticiples.js.map +1 -1
  761. package/build/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js +7 -12
  762. package/build/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js.map +1 -1
  763. package/build/languageProcessing/languages/nl/helpers/internal/stem.js +17 -23
  764. package/build/languageProcessing/languages/nl/helpers/internal/stem.js.map +1 -1
  765. package/build/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js +4 -11
  766. package/build/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js.map +1 -1
  767. package/build/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js +8 -14
  768. package/build/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js.map +1 -1
  769. package/build/languageProcessing/languages/nl/values/Clause.js +10 -16
  770. package/build/languageProcessing/languages/nl/values/Clause.js.map +1 -1
  771. package/build/languageProcessing/languages/pl/Researcher.js +19 -27
  772. package/build/languageProcessing/languages/pl/Researcher.js.map +1 -1
  773. package/build/languageProcessing/languages/pl/config/firstWordExceptions.js +1 -7
  774. package/build/languageProcessing/languages/pl/config/firstWordExceptions.js.map +1 -1
  775. package/build/languageProcessing/languages/pl/config/functionWords.js +9 -16
  776. package/build/languageProcessing/languages/pl/config/functionWords.js.map +1 -1
  777. package/build/languageProcessing/languages/pl/config/internal/auxiliaries.js +1 -7
  778. package/build/languageProcessing/languages/pl/config/internal/auxiliaries.js.map +1 -1
  779. package/build/languageProcessing/languages/pl/config/internal/participles.js +1 -7
  780. package/build/languageProcessing/languages/pl/config/internal/participles.js.map +1 -1
  781. package/build/languageProcessing/languages/pl/config/sentenceLength.js +1 -7
  782. package/build/languageProcessing/languages/pl/config/sentenceLength.js.map +1 -1
  783. package/build/languageProcessing/languages/pl/config/stopWords.js +1 -7
  784. package/build/languageProcessing/languages/pl/config/stopWords.js.map +1 -1
  785. package/build/languageProcessing/languages/pl/config/transitionWords.js +4 -10
  786. package/build/languageProcessing/languages/pl/config/transitionWords.js.map +1 -1
  787. package/build/languageProcessing/languages/pl/config/twoPartTransitionWords.js +2 -7
  788. package/build/languageProcessing/languages/pl/config/twoPartTransitionWords.js.map +1 -1
  789. package/build/languageProcessing/languages/pl/helpers/getClauses.js +9 -16
  790. package/build/languageProcessing/languages/pl/helpers/getClauses.js.map +1 -1
  791. package/build/languageProcessing/languages/pl/helpers/getStemmer.js +8 -14
  792. package/build/languageProcessing/languages/pl/helpers/getStemmer.js.map +1 -1
  793. package/build/languageProcessing/languages/pl/helpers/internal/getParticiples.js +7 -13
  794. package/build/languageProcessing/languages/pl/helpers/internal/getParticiples.js.map +1 -1
  795. package/build/languageProcessing/languages/pl/helpers/internal/stem.js +1 -7
  796. package/build/languageProcessing/languages/pl/helpers/internal/stem.js.map +1 -1
  797. package/build/languageProcessing/languages/pl/values/Clause.js +8 -14
  798. package/build/languageProcessing/languages/pl/values/Clause.js.map +1 -1
  799. package/build/languageProcessing/languages/pt/Researcher.js +23 -31
  800. package/build/languageProcessing/languages/pt/Researcher.js.map +1 -1
  801. package/build/languageProcessing/languages/pt/config/firstWordExceptions.js +1 -7
  802. package/build/languageProcessing/languages/pt/config/firstWordExceptions.js.map +1 -1
  803. package/build/languageProcessing/languages/pt/config/functionWords.js +10 -16
  804. package/build/languageProcessing/languages/pt/config/functionWords.js.map +1 -1
  805. package/build/languageProcessing/languages/pt/config/internal/passiveVoiceAuxiliaries.js +1 -7
  806. package/build/languageProcessing/languages/pt/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  807. package/build/languageProcessing/languages/pt/config/internal/passiveVoiceParticiples.js +1 -7
  808. package/build/languageProcessing/languages/pt/config/internal/passiveVoiceParticiples.js.map +1 -1
  809. package/build/languageProcessing/languages/pt/config/sentenceLength.js +1 -7
  810. package/build/languageProcessing/languages/pt/config/sentenceLength.js.map +1 -1
  811. package/build/languageProcessing/languages/pt/config/stopWords.js +1 -7
  812. package/build/languageProcessing/languages/pt/config/stopWords.js.map +1 -1
  813. package/build/languageProcessing/languages/pt/config/transitionWords.js +4 -10
  814. package/build/languageProcessing/languages/pt/config/transitionWords.js.map +1 -1
  815. package/build/languageProcessing/languages/pt/config/twoPartTransitionWords.js +1 -7
  816. package/build/languageProcessing/languages/pt/config/twoPartTransitionWords.js.map +1 -1
  817. package/build/languageProcessing/languages/pt/helpers/calculateFleschReadingScore.js +3 -9
  818. package/build/languageProcessing/languages/pt/helpers/calculateFleschReadingScore.js.map +1 -1
  819. package/build/languageProcessing/languages/pt/helpers/getClauses.js +10 -17
  820. package/build/languageProcessing/languages/pt/helpers/getClauses.js.map +1 -1
  821. package/build/languageProcessing/languages/pt/helpers/getStemmer.js +8 -14
  822. package/build/languageProcessing/languages/pt/helpers/getStemmer.js.map +1 -1
  823. package/build/languageProcessing/languages/pt/helpers/internal/getParticiples.js +6 -12
  824. package/build/languageProcessing/languages/pt/helpers/internal/getParticiples.js.map +1 -1
  825. package/build/languageProcessing/languages/pt/helpers/internal/stem.js +3 -9
  826. package/build/languageProcessing/languages/pt/helpers/internal/stem.js.map +1 -1
  827. package/build/languageProcessing/languages/pt/values/Clause.js +7 -14
  828. package/build/languageProcessing/languages/pt/values/Clause.js.map +1 -1
  829. package/build/languageProcessing/languages/ru/Researcher.js +23 -31
  830. package/build/languageProcessing/languages/ru/Researcher.js.map +1 -1
  831. package/build/languageProcessing/languages/ru/config/firstWordExceptions.js +1 -7
  832. package/build/languageProcessing/languages/ru/config/firstWordExceptions.js.map +1 -1
  833. package/build/languageProcessing/languages/ru/config/fleschReadingEaseScores.js +1 -7
  834. package/build/languageProcessing/languages/ru/config/fleschReadingEaseScores.js.map +1 -1
  835. package/build/languageProcessing/languages/ru/config/functionWords.js +8 -14
  836. package/build/languageProcessing/languages/ru/config/functionWords.js.map +1 -1
  837. package/build/languageProcessing/languages/ru/config/internal/participlesShortenedList.js +2 -8
  838. package/build/languageProcessing/languages/ru/config/internal/participlesShortenedList.js.map +1 -1
  839. package/build/languageProcessing/languages/ru/config/internal/passiveVoiceParticiples.js +1 -7
  840. package/build/languageProcessing/languages/ru/config/internal/passiveVoiceParticiples.js.map +1 -1
  841. package/build/languageProcessing/languages/ru/config/sentenceLength.js +1 -7
  842. package/build/languageProcessing/languages/ru/config/sentenceLength.js.map +1 -1
  843. package/build/languageProcessing/languages/ru/config/transitionWords.js +4 -10
  844. package/build/languageProcessing/languages/ru/config/transitionWords.js.map +1 -1
  845. package/build/languageProcessing/languages/ru/config/twoPartTransitionWords.js +2 -7
  846. package/build/languageProcessing/languages/ru/config/twoPartTransitionWords.js.map +1 -1
  847. package/build/languageProcessing/languages/ru/helpers/calculateFleschReadingScore.js +3 -9
  848. package/build/languageProcessing/languages/ru/helpers/calculateFleschReadingScore.js.map +1 -1
  849. package/build/languageProcessing/languages/ru/helpers/getStemmer.js +8 -14
  850. package/build/languageProcessing/languages/ru/helpers/getStemmer.js.map +1 -1
  851. package/build/languageProcessing/languages/ru/helpers/internal/stem.js +1 -7
  852. package/build/languageProcessing/languages/ru/helpers/internal/stem.js.map +1 -1
  853. package/build/languageProcessing/languages/ru/helpers/isPassiveSentence.js +6 -12
  854. package/build/languageProcessing/languages/ru/helpers/isPassiveSentence.js.map +1 -1
  855. package/build/languageProcessing/languages/sk/Researcher.js +17 -25
  856. package/build/languageProcessing/languages/sk/Researcher.js.map +1 -1
  857. package/build/languageProcessing/languages/sk/config/firstWordExceptions.js +1 -7
  858. package/build/languageProcessing/languages/sk/config/firstWordExceptions.js.map +1 -1
  859. package/build/languageProcessing/languages/sk/config/functionWords.js +5 -11
  860. package/build/languageProcessing/languages/sk/config/functionWords.js.map +1 -1
  861. package/build/languageProcessing/languages/sk/config/internal/nonPassives.js +1 -7
  862. package/build/languageProcessing/languages/sk/config/internal/nonPassives.js.map +1 -1
  863. package/build/languageProcessing/languages/sk/config/internal/passiveVoiceAuxiliaries.js +2 -8
  864. package/build/languageProcessing/languages/sk/config/internal/passiveVoiceAuxiliaries.js.map +1 -1
  865. package/build/languageProcessing/languages/sk/config/stopWords.js +1 -7
  866. package/build/languageProcessing/languages/sk/config/stopWords.js.map +1 -1
  867. package/build/languageProcessing/languages/sk/config/transitionWords.js +4 -10
  868. package/build/languageProcessing/languages/sk/config/transitionWords.js.map +1 -1
  869. package/build/languageProcessing/languages/sk/config/twoPartTransitionWords.js +2 -7
  870. package/build/languageProcessing/languages/sk/config/twoPartTransitionWords.js.map +1 -1
  871. package/build/languageProcessing/languages/sk/helpers/getClauses.js +9 -16
  872. package/build/languageProcessing/languages/sk/helpers/getClauses.js.map +1 -1
  873. package/build/languageProcessing/languages/sk/helpers/getStemmer.js +8 -14
  874. package/build/languageProcessing/languages/sk/helpers/getStemmer.js.map +1 -1
  875. package/build/languageProcessing/languages/sk/helpers/internal/getParticiples.js +3 -9
  876. package/build/languageProcessing/languages/sk/helpers/internal/getParticiples.js.map +1 -1
  877. package/build/languageProcessing/languages/sk/helpers/internal/stem.js +1 -7
  878. package/build/languageProcessing/languages/sk/helpers/internal/stem.js.map +1 -1
  879. package/build/languageProcessing/languages/sk/values/Clause.js +8 -14
  880. package/build/languageProcessing/languages/sk/values/Clause.js.map +1 -1
  881. package/build/languageProcessing/languages/sv/Researcher.js +17 -25
  882. package/build/languageProcessing/languages/sv/Researcher.js.map +1 -1
  883. package/build/languageProcessing/languages/sv/config/firstWordExceptions.js +1 -7
  884. package/build/languageProcessing/languages/sv/config/firstWordExceptions.js.map +1 -1
  885. package/build/languageProcessing/languages/sv/config/functionWords.js +7 -13
  886. package/build/languageProcessing/languages/sv/config/functionWords.js.map +1 -1
  887. package/build/languageProcessing/languages/sv/config/internal/passiveVerbs.js +2 -7
  888. package/build/languageProcessing/languages/sv/config/internal/passiveVerbs.js.map +1 -1
  889. package/build/languageProcessing/languages/sv/config/keyphraseLength.js +1 -7
  890. package/build/languageProcessing/languages/sv/config/keyphraseLength.js.map +1 -1
  891. package/build/languageProcessing/languages/sv/config/transitionWords.js +4 -10
  892. package/build/languageProcessing/languages/sv/config/transitionWords.js.map +1 -1
  893. package/build/languageProcessing/languages/sv/config/twoPartTransitionWords.js +2 -7
  894. package/build/languageProcessing/languages/sv/config/twoPartTransitionWords.js.map +1 -1
  895. package/build/languageProcessing/languages/sv/helpers/getStemmer.js +8 -14
  896. package/build/languageProcessing/languages/sv/helpers/getStemmer.js.map +1 -1
  897. package/build/languageProcessing/languages/sv/helpers/internal/stem.js +1 -7
  898. package/build/languageProcessing/languages/sv/helpers/internal/stem.js.map +1 -1
  899. package/build/languageProcessing/languages/sv/helpers/isPassiveSentence.js +6 -12
  900. package/build/languageProcessing/languages/sv/helpers/isPassiveSentence.js.map +1 -1
  901. package/build/languageProcessing/languages/tr/Researcher.js +17 -25
  902. package/build/languageProcessing/languages/tr/Researcher.js.map +1 -1
  903. package/build/languageProcessing/languages/tr/config/firstWordExceptions.js +1 -7
  904. package/build/languageProcessing/languages/tr/config/firstWordExceptions.js.map +1 -1
  905. package/build/languageProcessing/languages/tr/config/functionWords.js +4 -10
  906. package/build/languageProcessing/languages/tr/config/functionWords.js.map +1 -1
  907. package/build/languageProcessing/languages/tr/config/internal/nonPassiveExceptions.js +3 -8
  908. package/build/languageProcessing/languages/tr/config/internal/nonPassiveExceptions.js.map +1 -1
  909. package/build/languageProcessing/languages/tr/config/internal/passiveEndings.js +1 -7
  910. package/build/languageProcessing/languages/tr/config/internal/passiveEndings.js.map +1 -1
  911. package/build/languageProcessing/languages/tr/config/sentenceLength.js +1 -7
  912. package/build/languageProcessing/languages/tr/config/sentenceLength.js.map +1 -1
  913. package/build/languageProcessing/languages/tr/config/transitionWords.js +4 -10
  914. package/build/languageProcessing/languages/tr/config/transitionWords.js.map +1 -1
  915. package/build/languageProcessing/languages/tr/config/twoPartTransitionWords.js +2 -7
  916. package/build/languageProcessing/languages/tr/config/twoPartTransitionWords.js.map +1 -1
  917. package/build/languageProcessing/languages/tr/helpers/getStemmer.js +8 -14
  918. package/build/languageProcessing/languages/tr/helpers/getStemmer.js.map +1 -1
  919. package/build/languageProcessing/languages/tr/helpers/internal/stem.js +3 -9
  920. package/build/languageProcessing/languages/tr/helpers/internal/stem.js.map +1 -1
  921. package/build/languageProcessing/languages/tr/helpers/isPassiveSentence.js +9 -15
  922. package/build/languageProcessing/languages/tr/helpers/isPassiveSentence.js.map +1 -1
  923. package/build/languageProcessing/researches/altTagCount.js +10 -16
  924. package/build/languageProcessing/researches/altTagCount.js.map +1 -1
  925. package/build/languageProcessing/researches/checkRelatedKeywords.js +72 -0
  926. package/build/languageProcessing/researches/checkRelatedKeywords.js.map +1 -0
  927. package/build/languageProcessing/researches/countSentencesFromText.js +9 -15
  928. package/build/languageProcessing/researches/countSentencesFromText.js.map +1 -1
  929. package/build/languageProcessing/researches/findKeyphraseInSEOTitle.js +19 -26
  930. package/build/languageProcessing/researches/findKeyphraseInSEOTitle.js.map +1 -1
  931. package/build/languageProcessing/researches/findKeywordInFirstParagraph.js +17 -23
  932. package/build/languageProcessing/researches/findKeywordInFirstParagraph.js.map +1 -1
  933. package/build/languageProcessing/researches/findTransitionWords.js +16 -23
  934. package/build/languageProcessing/researches/findTransitionWords.js.map +1 -1
  935. package/build/languageProcessing/researches/functionWordsInKeyphrase.js +10 -16
  936. package/build/languageProcessing/researches/functionWordsInKeyphrase.js.map +1 -1
  937. package/build/languageProcessing/researches/getAnchorsWithKeyphrase.js +21 -28
  938. package/build/languageProcessing/researches/getAnchorsWithKeyphrase.js.map +1 -1
  939. package/build/languageProcessing/researches/getFleschReadingScore.js +18 -25
  940. package/build/languageProcessing/researches/getFleschReadingScore.js.map +1 -1
  941. package/build/languageProcessing/researches/getKeywordDensity.js +7 -14
  942. package/build/languageProcessing/researches/getKeywordDensity.js.map +1 -1
  943. package/build/languageProcessing/researches/getLinkStatistics.js +7 -13
  944. package/build/languageProcessing/researches/getLinkStatistics.js.map +1 -1
  945. package/build/languageProcessing/researches/getLinks.js +7 -13
  946. package/build/languageProcessing/researches/getLinks.js.map +1 -1
  947. package/build/languageProcessing/researches/getLongCenterAlignedTexts.js +1 -7
  948. package/build/languageProcessing/researches/getLongCenterAlignedTexts.js.map +1 -1
  949. package/build/languageProcessing/researches/getParagraphLength.js +15 -21
  950. package/build/languageProcessing/researches/getParagraphLength.js.map +1 -1
  951. package/build/languageProcessing/researches/getParagraphs.js +4 -9
  952. package/build/languageProcessing/researches/getParagraphs.js.map +1 -1
  953. package/build/languageProcessing/researches/getPassiveVoiceResult.js +21 -30
  954. package/build/languageProcessing/researches/getPassiveVoiceResult.js.map +1 -1
  955. package/build/languageProcessing/researches/getProminentWordsForInsights.js +12 -18
  956. package/build/languageProcessing/researches/getProminentWordsForInsights.js.map +1 -1
  957. package/build/languageProcessing/researches/getProminentWordsForInternalLinking.js +20 -26
  958. package/build/languageProcessing/researches/getProminentWordsForInternalLinking.js.map +1 -1
  959. package/build/languageProcessing/researches/getSentenceBeginnings.js +30 -36
  960. package/build/languageProcessing/researches/getSentenceBeginnings.js.map +1 -1
  961. package/build/languageProcessing/researches/getSubheadingTextLengths.js +12 -18
  962. package/build/languageProcessing/researches/getSubheadingTextLengths.js.map +1 -1
  963. package/build/languageProcessing/researches/getWordForms.js +13 -19
  964. package/build/languageProcessing/researches/getWordForms.js.map +1 -1
  965. package/build/languageProcessing/researches/h1s.js +1 -7
  966. package/build/languageProcessing/researches/h1s.js.map +1 -1
  967. package/build/languageProcessing/researches/imageCount.js +4 -10
  968. package/build/languageProcessing/researches/imageCount.js.map +1 -1
  969. package/build/languageProcessing/researches/index.js +4 -27
  970. package/build/languageProcessing/researches/index.js.map +1 -1
  971. package/build/languageProcessing/researches/keyphraseDistribution.js +22 -32
  972. package/build/languageProcessing/researches/keyphraseDistribution.js.map +1 -1
  973. package/build/languageProcessing/researches/keyphraseLength.js +1 -7
  974. package/build/languageProcessing/researches/keyphraseLength.js.map +1 -1
  975. package/build/languageProcessing/researches/keywordCount.js +30 -39
  976. package/build/languageProcessing/researches/keywordCount.js.map +1 -1
  977. package/build/languageProcessing/researches/keywordCountInUrl.js +8 -16
  978. package/build/languageProcessing/researches/keywordCountInUrl.js.map +1 -1
  979. package/build/languageProcessing/researches/matchKeywordInSubheadings.js +15 -20
  980. package/build/languageProcessing/researches/matchKeywordInSubheadings.js.map +1 -1
  981. package/build/languageProcessing/researches/metaDescriptionKeyword.js +6 -12
  982. package/build/languageProcessing/researches/metaDescriptionKeyword.js.map +1 -1
  983. package/build/languageProcessing/researches/metaDescriptionLength.js +3 -9
  984. package/build/languageProcessing/researches/metaDescriptionLength.js.map +1 -1
  985. package/build/languageProcessing/researches/pageTitleWidth.js +1 -7
  986. package/build/languageProcessing/researches/pageTitleWidth.js.map +1 -1
  987. package/build/languageProcessing/researches/readingTime.js +7 -13
  988. package/build/languageProcessing/researches/readingTime.js.map +1 -1
  989. package/build/languageProcessing/researches/sentences.js +7 -13
  990. package/build/languageProcessing/researches/sentences.js.map +1 -1
  991. package/build/languageProcessing/researches/videoCount.js +1 -7
  992. package/build/languageProcessing/researches/videoCount.js.map +1 -1
  993. package/build/languageProcessing/researches/wordComplexity.js +15 -21
  994. package/build/languageProcessing/researches/wordComplexity.js.map +1 -1
  995. package/build/languageProcessing/researches/wordCountInText.js +10 -15
  996. package/build/languageProcessing/researches/wordCountInText.js.map +1 -1
  997. package/build/languageProcessing/values/Clause.js +1 -7
  998. package/build/languageProcessing/values/Clause.js.map +1 -1
  999. package/build/languageProcessing/values/ProminentWord.js +1 -7
  1000. package/build/languageProcessing/values/ProminentWord.js.map +1 -1
  1001. package/build/languageProcessing/values/Sentence.js +1 -7
  1002. package/build/languageProcessing/values/Sentence.js.map +1 -1
  1003. package/build/languageProcessing/values/index.js +4 -27
  1004. package/build/languageProcessing/values/index.js.map +1 -1
  1005. package/build/markers/addMark.js +1 -7
  1006. package/build/markers/addMark.js.map +1 -1
  1007. package/build/markers/addMarkSingleWord.js +7 -12
  1008. package/build/markers/addMarkSingleWord.js.map +1 -1
  1009. package/build/markers/index.js +3 -20
  1010. package/build/markers/index.js.map +1 -1
  1011. package/build/markers/removeDuplicateMarks.js +3 -8
  1012. package/build/markers/removeDuplicateMarks.js.map +1 -1
  1013. package/build/markers/removeMarks.js +1 -7
  1014. package/build/markers/removeMarks.js.map +1 -1
  1015. package/build/parse/build/build.js +17 -25
  1016. package/build/parse/build/build.js.map +1 -1
  1017. package/build/parse/build/index.js +7 -12
  1018. package/build/parse/build/index.js.map +1 -1
  1019. package/build/parse/build/private/adapt.js +15 -21
  1020. package/build/parse/build/private/adapt.js.map +1 -1
  1021. package/build/parse/build/private/adaptAttributes.js +3 -9
  1022. package/build/parse/build/private/adaptAttributes.js.map +1 -1
  1023. package/build/parse/build/private/alwaysFilterElements.js +9 -14
  1024. package/build/parse/build/private/alwaysFilterElements.js.map +1 -1
  1025. package/build/parse/build/private/combineIntoImplicitParagraphs.js +12 -18
  1026. package/build/parse/build/private/combineIntoImplicitParagraphs.js.map +1 -1
  1027. package/build/parse/build/private/filterBeforeTokenizing.js +5 -10
  1028. package/build/parse/build/private/filterBeforeTokenizing.js.map +1 -1
  1029. package/build/parse/build/private/filterHelpers.js +3 -11
  1030. package/build/parse/build/private/filterHelpers.js.map +1 -1
  1031. package/build/parse/build/private/filterTree.js +3 -8
  1032. package/build/parse/build/private/filterTree.js.map +1 -1
  1033. package/build/parse/build/private/getTextElementPositions.js +5 -10
  1034. package/build/parse/build/private/getTextElementPositions.js.map +1 -1
  1035. package/build/parse/build/private/helpers/parseClassAttribute.js +1 -7
  1036. package/build/parse/build/private/helpers/parseClassAttribute.js.map +1 -1
  1037. package/build/parse/build/private/isPhrasingContent.js +1 -7
  1038. package/build/parse/build/private/isPhrasingContent.js.map +1 -1
  1039. package/build/parse/build/private/parseBlocks.js +4 -11
  1040. package/build/parse/build/private/parseBlocks.js.map +1 -1
  1041. package/build/parse/build/private/tokenize.js +8 -14
  1042. package/build/parse/build/private/tokenize.js.map +1 -1
  1043. package/build/parse/language/LanguageProcessor.js +8 -15
  1044. package/build/parse/language/LanguageProcessor.js.map +1 -1
  1045. package/build/parse/structure/Heading.js +3 -9
  1046. package/build/parse/structure/Heading.js.map +1 -1
  1047. package/build/parse/structure/Node.js +8 -14
  1048. package/build/parse/structure/Node.js.map +1 -1
  1049. package/build/parse/structure/Paragraph.js +3 -9
  1050. package/build/parse/structure/Paragraph.js.map +1 -1
  1051. package/build/parse/structure/Sentence.js +1 -7
  1052. package/build/parse/structure/Sentence.js.map +1 -1
  1053. package/build/parse/structure/SourceCodeLocation.js +1 -7
  1054. package/build/parse/structure/SourceCodeLocation.js.map +1 -1
  1055. package/build/parse/structure/Text.js +3 -10
  1056. package/build/parse/structure/Text.js.map +1 -1
  1057. package/build/parse/structure/Token.js +3 -8
  1058. package/build/parse/structure/Token.js.map +1 -1
  1059. package/build/parse/structure/index.js +10 -33
  1060. package/build/parse/structure/index.js.map +1 -1
  1061. package/build/parse/traverse/findAllInTree.js +1 -7
  1062. package/build/parse/traverse/findAllInTree.js.map +1 -1
  1063. package/build/parse/traverse/index.js +8 -19
  1064. package/build/parse/traverse/index.js.map +1 -1
  1065. package/build/parse/traverse/innerText.js +3 -8
  1066. package/build/parse/traverse/innerText.js.map +1 -1
  1067. package/build/parsedPaper/ParsedPaper.js +1 -8
  1068. package/build/parsedPaper/ParsedPaper.js.map +1 -1
  1069. package/build/parsedPaper/assess/TreeAssessor.js +6 -12
  1070. package/build/parsedPaper/assess/TreeAssessor.js.map +1 -1
  1071. package/build/parsedPaper/assess/assessmentListFactories.js +1 -11
  1072. package/build/parsedPaper/assess/assessmentListFactories.js.map +1 -1
  1073. package/build/parsedPaper/assess/assessments/Assessment.js +15 -9
  1074. package/build/parsedPaper/assess/assessments/Assessment.js.map +1 -1
  1075. package/build/parsedPaper/assess/assessments/index.js +6 -13
  1076. package/build/parsedPaper/assess/assessments/index.js.map +1 -1
  1077. package/build/parsedPaper/assess/assessorFactories.js +16 -24
  1078. package/build/parsedPaper/assess/assessorFactories.js.map +1 -1
  1079. package/build/parsedPaper/assess/cornerstone/assessmentListFactories.js +1 -9
  1080. package/build/parsedPaper/assess/cornerstone/assessmentListFactories.js.map +1 -1
  1081. package/build/parsedPaper/assess/cornerstone/index.js +2 -10
  1082. package/build/parsedPaper/assess/cornerstone/index.js.map +1 -1
  1083. package/build/parsedPaper/assess/index.js +13 -29
  1084. package/build/parsedPaper/assess/index.js.map +1 -1
  1085. package/build/parsedPaper/build/PaperParser.js +5 -11
  1086. package/build/parsedPaper/build/PaperParser.js.map +1 -1
  1087. package/build/parsedPaper/build/linguisticParsing/Sentence.js +1 -7
  1088. package/build/parsedPaper/build/linguisticParsing/Sentence.js.map +1 -1
  1089. package/build/parsedPaper/build/linguisticParsing/SentenceTokenizer.js +16 -23
  1090. package/build/parsedPaper/build/linguisticParsing/SentenceTokenizer.js.map +1 -1
  1091. package/build/parsedPaper/build/linguisticParsing/parseText.js +3 -9
  1092. package/build/parsedPaper/build/linguisticParsing/parseText.js.map +1 -1
  1093. package/build/parsedPaper/build/tree/TreeBuilder.js +3 -9
  1094. package/build/parsedPaper/build/tree/TreeBuilder.js.map +1 -1
  1095. package/build/parsedPaper/build/tree/cleanup/calculateTextIndices.js +5 -10
  1096. package/build/parsedPaper/build/tree/cleanup/calculateTextIndices.js.map +1 -1
  1097. package/build/parsedPaper/build/tree/cleanup/getElementContent.js +1 -7
  1098. package/build/parsedPaper/build/tree/cleanup/getElementContent.js.map +1 -1
  1099. package/build/parsedPaper/build/tree/cleanup/postParsing.js +5 -11
  1100. package/build/parsedPaper/build/tree/cleanup/postParsing.js.map +1 -1
  1101. package/build/parsedPaper/build/tree/html/HTMLTreeConverter.js +21 -27
  1102. package/build/parsedPaper/build/tree/html/HTMLTreeConverter.js.map +1 -1
  1103. package/build/parsedPaper/build/tree/html/buildTree.js +7 -13
  1104. package/build/parsedPaper/build/tree/html/buildTree.js.map +1 -1
  1105. package/build/parsedPaper/build/tree/html/htmlConstants.js +4 -9
  1106. package/build/parsedPaper/build/tree/html/htmlConstants.js.map +1 -1
  1107. package/build/parsedPaper/build/tree/index.js +3 -8
  1108. package/build/parsedPaper/build/tree/index.js.map +1 -1
  1109. package/build/parsedPaper/build/tree/metadata/buildTree.js +12 -18
  1110. package/build/parsedPaper/build/tree/metadata/buildTree.js.map +1 -1
  1111. package/build/parsedPaper/research/TreeResearcher.js +4 -9
  1112. package/build/parsedPaper/research/TreeResearcher.js.map +1 -1
  1113. package/build/parsedPaper/research/index.js +10 -12
  1114. package/build/parsedPaper/research/index.js.map +1 -1
  1115. package/build/parsedPaper/research/researches/Headings.js +5 -11
  1116. package/build/parsedPaper/research/researches/Headings.js.map +1 -1
  1117. package/build/parsedPaper/research/researches/LinkStatistics.js +6 -12
  1118. package/build/parsedPaper/research/researches/LinkStatistics.js.map +1 -1
  1119. package/build/parsedPaper/research/researches/Research.js +5 -10
  1120. package/build/parsedPaper/research/researches/Research.js.map +1 -1
  1121. package/build/parsedPaper/research/researches/index.js +1 -13
  1122. package/build/parsedPaper/research/researches/index.js.map +1 -1
  1123. package/build/parsedPaper/structure/tree/FormattingElement.js +3 -9
  1124. package/build/parsedPaper/structure/tree/FormattingElement.js.map +1 -1
  1125. package/build/parsedPaper/structure/tree/SourceCodeLocation.js +1 -7
  1126. package/build/parsedPaper/structure/tree/SourceCodeLocation.js.map +1 -1
  1127. package/build/parsedPaper/structure/tree/TextContainer.js +5 -10
  1128. package/build/parsedPaper/structure/tree/TextContainer.js.map +1 -1
  1129. package/build/parsedPaper/structure/tree/index.js +9 -74
  1130. package/build/parsedPaper/structure/tree/index.js.map +1 -1
  1131. package/build/parsedPaper/structure/tree/nodes/Heading.js +3 -9
  1132. package/build/parsedPaper/structure/tree/nodes/Heading.js.map +1 -1
  1133. package/build/parsedPaper/structure/tree/nodes/LeafNode.js +5 -12
  1134. package/build/parsedPaper/structure/tree/nodes/LeafNode.js.map +1 -1
  1135. package/build/parsedPaper/structure/tree/nodes/List.js +5 -11
  1136. package/build/parsedPaper/structure/tree/nodes/List.js.map +1 -1
  1137. package/build/parsedPaper/structure/tree/nodes/ListItem.js +3 -10
  1138. package/build/parsedPaper/structure/tree/nodes/ListItem.js.map +1 -1
  1139. package/build/parsedPaper/structure/tree/nodes/MetadataMiscellaneous.js +3 -9
  1140. package/build/parsedPaper/structure/tree/nodes/MetadataMiscellaneous.js.map +1 -1
  1141. package/build/parsedPaper/structure/tree/nodes/MetadataText.js +3 -9
  1142. package/build/parsedPaper/structure/tree/nodes/MetadataText.js.map +1 -1
  1143. package/build/parsedPaper/structure/tree/nodes/Node.js +6 -12
  1144. package/build/parsedPaper/structure/tree/nodes/Node.js.map +1 -1
  1145. package/build/parsedPaper/structure/tree/nodes/Paragraph.js +3 -9
  1146. package/build/parsedPaper/structure/tree/nodes/Paragraph.js.map +1 -1
  1147. package/build/parsedPaper/structure/tree/nodes/StructuredNode.js +3 -10
  1148. package/build/parsedPaper/structure/tree/nodes/StructuredNode.js.map +1 -1
  1149. package/build/parsedPaper/structure/tree/nodes/index.js +10 -69
  1150. package/build/parsedPaper/structure/tree/nodes/index.js.map +1 -1
  1151. package/build/scoring/assessments/assessment.js +17 -15
  1152. package/build/scoring/assessments/assessment.js.map +1 -1
  1153. package/build/scoring/assessments/index.js +53 -56
  1154. package/build/scoring/assessments/index.js.map +1 -1
  1155. package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js +30 -47
  1156. package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js.map +1 -1
  1157. package/build/scoring/assessments/readability/RelatedKeywordsAssessment.js +98 -0
  1158. package/build/scoring/assessments/readability/RelatedKeywordsAssessment.js.map +1 -0
  1159. package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js +22 -35
  1160. package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
  1161. package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js +24 -39
  1162. package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
  1163. package/build/scoring/assessments/readability/TransitionWordsAssessment.js +29 -47
  1164. package/build/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
  1165. package/build/scoring/assessments/seo/FAQsAssessment.js +174 -0
  1166. package/build/scoring/assessments/seo/FAQsAssessment.js.map +1 -0
  1167. package/build/scoring/assessments/seo/ImageCountAssessment.js +17 -33
  1168. package/build/scoring/assessments/seo/ImageCountAssessment.js.map +1 -1
  1169. package/build/scoring/assessments/seo/InternalLinksAssessment.js +21 -35
  1170. package/build/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
  1171. package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js +20 -34
  1172. package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
  1173. package/build/scoring/assessments/seo/KeyphraseAssessment.js +18 -32
  1174. package/build/scoring/assessments/seo/KeyphraseAssessment.js.map +1 -1
  1175. package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js +21 -34
  1176. package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
  1177. package/build/scoring/assessments/seo/KeywordDensityAssessment.js +26 -40
  1178. package/build/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
  1179. package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +23 -42
  1180. package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
  1181. package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js +19 -34
  1182. package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js.map +1 -1
  1183. package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js +25 -41
  1184. package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
  1185. package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js +16 -30
  1186. package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js.map +1 -1
  1187. package/build/scoring/assessments/seo/OutboundLinksAssessment.js +21 -40
  1188. package/build/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
  1189. package/build/scoring/assessments/seo/PageTitleWidthAssessment.js +17 -31
  1190. package/build/scoring/assessments/seo/PageTitleWidthAssessment.js.map +1 -1
  1191. package/build/scoring/assessments/seo/SchemaAssessment.js +95 -0
  1192. package/build/scoring/assessments/seo/SchemaAssessment.js.map +1 -0
  1193. package/build/scoring/assessments/seo/SingleH1Assessment.js +20 -33
  1194. package/build/scoring/assessments/seo/SingleH1Assessment.js.map +1 -1
  1195. package/build/scoring/assessments/seo/SingleTitleAssessment.js +20 -33
  1196. package/build/scoring/assessments/seo/SingleTitleAssessment.js.map +1 -1
  1197. package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js +18 -35
  1198. package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js.map +1 -1
  1199. package/build/scoring/assessments/seo/TextImagesAssessment.js +20 -36
  1200. package/build/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
  1201. package/build/scoring/assessments/seo/TextLengthAssessment.js +21 -37
  1202. package/build/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
  1203. package/build/scoring/assessments/seo/UrlKeywordAssessment.js +20 -36
  1204. package/build/scoring/assessments/seo/UrlKeywordAssessment.js.map +1 -1
  1205. package/build/scoring/assessments/seo/UrlLengthAssessment.js +19 -33
  1206. package/build/scoring/assessments/seo/UrlLengthAssessment.js.map +1 -1
  1207. package/build/scoring/assessors/assessor.js +53 -33
  1208. package/build/scoring/assessors/assessor.js.map +1 -1
  1209. package/build/scoring/assessors/avadaAssessor.js +37 -17
  1210. package/build/scoring/assessors/avadaAssessor.js.map +1 -1
  1211. package/build/scoring/assessors/contentAssessor.js +16 -22
  1212. package/build/scoring/assessors/contentAssessor.js.map +1 -1
  1213. package/build/scoring/assessors/index.js +4 -34
  1214. package/build/scoring/assessors/index.js.map +1 -1
  1215. package/build/scoring/assessors/seoAssessor.js +27 -32
  1216. package/build/scoring/assessors/seoAssessor.js.map +1 -1
  1217. package/build/scoring/helpers/assessments/checkForTooLongSentences.js +3 -8
  1218. package/build/scoring/helpers/assessments/checkForTooLongSentences.js.map +1 -1
  1219. package/build/scoring/helpers/assessments/inRange.js +2 -10
  1220. package/build/scoring/helpers/assessments/inRange.js.map +1 -1
  1221. package/build/scoring/helpers/assessments/keyphraseLengthFactor.js +1 -7
  1222. package/build/scoring/helpers/assessments/keyphraseLengthFactor.js.map +1 -1
  1223. package/build/scoring/helpers/assessments/recommendedKeywordCount.js +5 -11
  1224. package/build/scoring/helpers/assessments/recommendedKeywordCount.js.map +1 -1
  1225. package/build/scoring/helpers/index.js +27 -18
  1226. package/build/scoring/helpers/index.js.map +1 -1
  1227. package/build/scoring/interpreters/index.js +2 -13
  1228. package/build/scoring/interpreters/index.js.map +1 -1
  1229. package/build/scoring/interpreters/scoreToRating.js +1 -7
  1230. package/build/scoring/interpreters/scoreToRating.js.map +1 -1
  1231. package/build/scoring/renderers/AssessorPresenter.js +12 -18
  1232. package/build/scoring/renderers/AssessorPresenter.js.map +1 -1
  1233. package/build/scoring/scoreAggregators/ReadabilityScoreAggregator.js +8 -14
  1234. package/build/scoring/scoreAggregators/ReadabilityScoreAggregator.js.map +1 -1
  1235. package/build/scoring/scoreAggregators/SEOScoreAggregator.js +3 -9
  1236. package/build/scoring/scoreAggregators/SEOScoreAggregator.js.map +1 -1
  1237. package/build/scoring/scoreAggregators/ScoreAggregator.js +1 -7
  1238. package/build/scoring/scoreAggregators/ScoreAggregator.js.map +1 -1
  1239. package/build/scoring/scoreAggregators/index.js +3 -27
  1240. package/build/scoring/scoreAggregators/index.js.map +1 -1
  1241. package/build/values/AssessmentResult.js +31 -57
  1242. package/build/values/AssessmentResult.js.map +1 -1
  1243. package/build/values/Mark.js +9 -15
  1244. package/build/values/Mark.js.map +1 -1
  1245. package/build/values/Paper.js +115 -16
  1246. package/build/values/Paper.js.map +1 -1
  1247. package/build/values/index.js +4 -27
  1248. package/build/values/index.js.map +1 -1
  1249. package/build/vendor/turkishStemmer.js +1 -7
  1250. package/build/vendor/turkishStemmer.js.map +1 -1
  1251. package/package.json +11 -1
  1252. package/build/bundledPlugins/index.js +0 -14
  1253. package/build/bundledPlugins/index.js.map +0 -1
  1254. package/build/bundledPlugins/previouslyUsedKeywords.js +0 -171
  1255. package/build/bundledPlugins/previouslyUsedKeywords.js.map +0 -1
@@ -1,17 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
- var _createRegexFromDoubleArray = _interopRequireDefault(require("../helpers/regex/createRegexFromDoubleArray.js"));
8
- var _getSentences = _interopRequireDefault(require("../helpers/sentence/getSentences.js"));
9
- var _quotes = require("../helpers/sanitize/quotes.js");
10
- var _matchWordInSentence = require("../helpers/word/matchWordInSentence.js");
11
- var _htmlParser = _interopRequireDefault(require("../helpers/html/htmlParser"));
12
- var _lodash = require("lodash");
13
- var _helpers = require("../helpers");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
1
+ import createRegexFromDoubleArray from "../helpers/regex/createRegexFromDoubleArray.js";
2
+ import getSentences from "../helpers/sentence/getSentences.js";
3
+ import { normalizeSingle as normalizeSingleQuotes } from "../helpers/sanitize/quotes.js";
4
+ import { isWordInSentence as matchWordInSentence } from "../helpers/word/matchWordInSentence.js";
5
+ import removeHtmlBlocks from "../helpers/html/htmlParser";
6
+ import { flattenDeep } from "lodash";
7
+ import { filterShortcodesFromHTML } from "../helpers";
15
8
  let regexFromDoubleArray = null;
16
9
  let regexFromDoubleArrayCacheKey = "";
17
10
 
@@ -23,10 +16,10 @@ let regexFromDoubleArrayCacheKey = "";
23
16
  * @returns {RegExp} The RegExp to match text with a double array.
24
17
  */
25
18
  function getRegexFromDoubleArray(twoPartTransitionWords) {
26
- const cacheKey = (0, _lodash.flattenDeep)(twoPartTransitionWords).join("");
19
+ const cacheKey = flattenDeep(twoPartTransitionWords).join("");
27
20
  if (regexFromDoubleArrayCacheKey !== cacheKey || regexFromDoubleArray === null) {
28
21
  regexFromDoubleArrayCacheKey = cacheKey;
29
- regexFromDoubleArray = (0, _createRegexFromDoubleArray.default)(twoPartTransitionWords);
22
+ regexFromDoubleArray = createRegexFromDoubleArray(twoPartTransitionWords);
30
23
  }
31
24
  return regexFromDoubleArray;
32
25
  }
@@ -39,7 +32,7 @@ function getRegexFromDoubleArray(twoPartTransitionWords) {
39
32
  * @returns {Array} The found transitional words.
40
33
  */
41
34
  const matchTwoPartTransitionWords = function (sentence, twoPartTransitionWords) {
42
- sentence = (0, _quotes.normalizeSingle)(sentence);
35
+ sentence = normalizeSingleQuotes(sentence);
43
36
  const twoPartTransitionWordsRegex = getRegexFromDoubleArray(twoPartTransitionWords);
44
37
  return sentence.match(twoPartTransitionWordsRegex);
45
38
  };
@@ -52,8 +45,8 @@ const matchTwoPartTransitionWords = function (sentence, twoPartTransitionWords)
52
45
  * @returns {Array} The found transitional words.
53
46
  */
54
47
  const matchTransitionWords = function (sentence, transitionWords) {
55
- sentence = (0, _quotes.normalizeSingle)(sentence);
56
- return transitionWords.filter(word => (0, _matchWordInSentence.isWordInSentence)(word, sentence));
48
+ sentence = normalizeSingleQuotes(sentence);
49
+ return transitionWords.filter(word => matchWordInSentence(word, sentence));
57
50
  };
58
51
 
59
52
  /**
@@ -100,15 +93,15 @@ const checkSentencesForTransitionWords = function (sentences, transitionWords, t
100
93
  * @returns {object} An object with the total number of sentences in the text
101
94
  * and the total number of sentences containing one or more transition words.
102
95
  */
103
- function _default(paper, researcher) {
96
+ export default function (paper, researcher) {
104
97
  const matchTransitionWordsHelper = researcher.getHelper("matchTransitionWordsHelper");
105
98
  const transitionWords = researcher.getConfig("transitionWords");
106
99
  const twoPartTransitionWords = researcher.getConfig("twoPartTransitionWords");
107
100
  const memoizedTokenizer = researcher.getHelper("memoizedTokenizer");
108
101
  let text = paper.getText();
109
- text = (0, _htmlParser.default)(text);
110
- text = (0, _helpers.filterShortcodesFromHTML)(text, paper._attributes && paper._attributes.shortcodes);
111
- const sentences = (0, _getSentences.default)(text, memoizedTokenizer);
102
+ text = removeHtmlBlocks(text);
103
+ text = filterShortcodesFromHTML(text, paper._attributes && paper._attributes.shortcodes);
104
+ const sentences = getSentences(text, memoizedTokenizer);
112
105
  const sentenceResults = checkSentencesForTransitionWords(sentences, transitionWords, twoPartTransitionWords, matchTransitionWordsHelper);
113
106
  return {
114
107
  totalSentences: sentences.length,
@@ -1 +1 @@
1
- {"version":3,"file":"findTransitionWords.js","names":["_createRegexFromDoubleArray","_interopRequireDefault","require","_getSentences","_quotes","_matchWordInSentence","_htmlParser","_lodash","_helpers","e","__esModule","default","regexFromDoubleArray","regexFromDoubleArrayCacheKey","getRegexFromDoubleArray","twoPartTransitionWords","cacheKey","flattenDeep","join","createRegexFromDoubleArray","matchTwoPartTransitionWords","sentence","normalizeSingleQuotes","twoPartTransitionWordsRegex","match","matchTransitionWords","transitionWords","filter","word","matchWordInSentence","checkSentencesForTransitionWords","sentences","matchTransitionWordsHelper","results","forEach","twoPartMatches","push","transitionWordMatches","length","_default","paper","researcher","getHelper","getConfig","memoizedTokenizer","text","getText","removeHtmlBlocks","filterShortcodesFromHTML","_attributes","shortcodes","getSentences","sentenceResults","totalSentences","transitionWordSentences"],"sources":["../../../src/languageProcessing/researches/findTransitionWords.js"],"sourcesContent":["import createRegexFromDoubleArray from \"../helpers/regex/createRegexFromDoubleArray.js\";\nimport getSentences from \"../helpers/sentence/getSentences.js\";\nimport { normalizeSingle as normalizeSingleQuotes } from \"../helpers/sanitize/quotes.js\";\nimport { isWordInSentence as matchWordInSentence } from \"../helpers/word/matchWordInSentence.js\";\nimport removeHtmlBlocks from \"../helpers/html/htmlParser\";\n\nimport { flattenDeep } from \"lodash\";\nimport { filterShortcodesFromHTML } from \"../helpers\";\n\nlet regexFromDoubleArray = null;\nlet regexFromDoubleArrayCacheKey = \"\";\n\n/**\n * Memoizes the createRegexFromDoubleArray with the twoPartTransitionWords.\n *\n * @param {Array} twoPartTransitionWords The array containing two-part transition words.\n *\n * @returns {RegExp} The RegExp to match text with a double array.\n */\nfunction getRegexFromDoubleArray( twoPartTransitionWords ) {\n\tconst cacheKey = flattenDeep( twoPartTransitionWords ).join( \"\" );\n\tif ( regexFromDoubleArrayCacheKey !== cacheKey || regexFromDoubleArray === null ) {\n\t\tregexFromDoubleArrayCacheKey = cacheKey;\n\t\tregexFromDoubleArray = createRegexFromDoubleArray( twoPartTransitionWords );\n\t}\n\treturn regexFromDoubleArray;\n}\n\n/**\n * Matches the sentence against two part transition words.\n *\n * @param {string} sentence The sentence to match against.\n * @param {Array} twoPartTransitionWords The array containing two-part transition words.\n * @returns {Array} The found transitional words.\n */\nconst matchTwoPartTransitionWords = function( sentence, twoPartTransitionWords ) {\n\tsentence = normalizeSingleQuotes( sentence );\n\tconst twoPartTransitionWordsRegex = getRegexFromDoubleArray( twoPartTransitionWords );\n\treturn sentence.match( twoPartTransitionWordsRegex );\n};\n\n/**\n * Matches the sentence against transition words.\n *\n * @param {string} sentence The sentence to match against.\n * @param {Array} transitionWords The array containing transition words.\n * @returns {Array} The found transitional words.\n */\nconst matchTransitionWords = function( sentence, transitionWords ) {\n\tsentence = normalizeSingleQuotes( sentence );\n\treturn transitionWords.filter( word => matchWordInSentence( word, sentence ) );\n};\n\n/**\n * Checks the passed sentences to see if they contain transition words.\n *\n * @param {Array} sentences The sentences to match against.\n * @param {Array} transitionWords The array containing transition words.\n * @param {Array} twoPartTransitionWords The array containing two part transition words.\n * @param {function} matchTransitionWordsHelper The language-specific helper function to match transition words in a sentence.\n *\n * @returns {Array} Array of sentence objects containing the complete sentence and the transition words.\n */\nconst checkSentencesForTransitionWords = function( sentences, transitionWords, twoPartTransitionWords, matchTransitionWordsHelper ) {\n\tconst results = [];\n\n\tsentences.forEach( sentence => {\n\t\tif ( twoPartTransitionWords ) {\n\t\t\tconst twoPartMatches = matchTwoPartTransitionWords( sentence, twoPartTransitionWords );\n\n\t\t\tif ( twoPartMatches !== null ) {\n\t\t\t\tresults.push( {\n\t\t\t\t\tsentence: sentence,\n\t\t\t\t\ttransitionWords: twoPartMatches,\n\t\t\t\t} );\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst transitionWordMatches = matchTransitionWordsHelper\n\t\t\t? matchTransitionWordsHelper( sentence, transitionWords )\n\t\t\t: matchTransitionWords( sentence, transitionWords );\n\n\t\tif ( transitionWordMatches.length !== 0 ) {\n\t\t\tresults.push( {\n\t\t\t\tsentence: sentence,\n\t\t\t\ttransitionWords: transitionWordMatches,\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn results;\n};\n\n/**\n * Checks how many sentences from a text contain at least one transition word or two-part transition word\n * that are defined in the transition words config and two part transition words config.\n *\n * @param {Paper} paper The Paper object to get text from.\n * @param {Researcher} researcher The researcher.\n *\n * @returns {object} An object with the total number of sentences in the text\n * and the total number of sentences containing one or more transition words.\n */\nexport default function( paper, researcher ) {\n\tconst matchTransitionWordsHelper = researcher.getHelper( \"matchTransitionWordsHelper\" );\n\tconst transitionWords = researcher.getConfig( \"transitionWords\" );\n\tconst twoPartTransitionWords = researcher.getConfig( \"twoPartTransitionWords\" );\n\tconst memoizedTokenizer = researcher.getHelper( \"memoizedTokenizer\" );\n\n\tlet text = paper.getText();\n\ttext = removeHtmlBlocks( text );\n\ttext = filterShortcodesFromHTML( text, paper._attributes && paper._attributes.shortcodes );\n\tconst sentences = getSentences( text, memoizedTokenizer );\n\tconst sentenceResults = checkSentencesForTransitionWords( sentences, transitionWords, twoPartTransitionWords, matchTransitionWordsHelper );\n\n\treturn {\n\t\ttotalSentences: sentences.length,\n\t\tsentenceResults: sentenceResults,\n\t\ttransitionWordSentences: sentenceResults.length,\n\t};\n}\n"],"mappings":";;;;;;AAAA,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SAAS,CAAE,wBAAyB,CAAC;EAC/E,MAAMC,iBAAiB,GAAGH,UAAU,CAACC,SAAS,CAAE,mBAAoB,CAAC;EAErE,IAAIG,IAAI,GAAGL,KAAK,CAACM,OAAO,CAAC,CAAC;EAC1BD,IAAI,GAAG,IAAAE,mBAAgB,EAAEF,IAAK,CAAC;EAC/BA,IAAI,GAAG,IAAAG,iCAAwB,EAAEH,IAAI,EAAEL,KAAK,CAACS,WAAW,IAAIT,KAAK,CAACS,WAAW,CAACC,UAAW,CAAC;EAC1F,MAAMnB,SAAS,GAAG,IAAAoB,qBAAY,EAAEN,IAAI,EAAED,iBAAkB,CAAC;EACzD,MAAMQ,eAAe,GAAGtB,gCAAgC,CAAEC,SAAS,EAAEL,eAAe,EAAEX,sBAAsB,EAAEiB,0BAA2B,CAAC;EAE1I,OAAO;IACNqB,cAAc,EAAEtB,SAAS,CAACO,MAAM;IAChCc,eAAe,EAAEA,eAAe;IAChCE,uBAAuB,EAAEF,eAAe,CAACd;EAC1C,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"findTransitionWords.js","names":["createRegexFromDoubleArray","getSentences","normalizeSingle","normalizeSingleQuotes","isWordInSentence","matchWordInSentence","removeHtmlBlocks","flattenDeep","filterShortcodesFromHTML","regexFromDoubleArray","regexFromDoubleArrayCacheKey","getRegexFromDoubleArray","twoPartTransitionWords","cacheKey","join","matchTwoPartTransitionWords","sentence","twoPartTransitionWordsRegex","match","matchTransitionWords","transitionWords","filter","word","checkSentencesForTransitionWords","sentences","matchTransitionWordsHelper","results","forEach","twoPartMatches","push","transitionWordMatches","length","paper","researcher","getHelper","getConfig","memoizedTokenizer","text","getText","_attributes","shortcodes","sentenceResults","totalSentences","transitionWordSentences"],"sources":["../../../src/languageProcessing/researches/findTransitionWords.js"],"sourcesContent":["import createRegexFromDoubleArray from \"../helpers/regex/createRegexFromDoubleArray.js\";\nimport getSentences from \"../helpers/sentence/getSentences.js\";\nimport { normalizeSingle as normalizeSingleQuotes } from \"../helpers/sanitize/quotes.js\";\nimport { isWordInSentence as matchWordInSentence } from \"../helpers/word/matchWordInSentence.js\";\nimport removeHtmlBlocks from \"../helpers/html/htmlParser\";\n\nimport { flattenDeep } from \"lodash\";\nimport { filterShortcodesFromHTML } from \"../helpers\";\n\nlet regexFromDoubleArray = null;\nlet regexFromDoubleArrayCacheKey = \"\";\n\n/**\n * Memoizes the createRegexFromDoubleArray with the twoPartTransitionWords.\n *\n * @param {Array} twoPartTransitionWords The array containing two-part transition words.\n *\n * @returns {RegExp} The RegExp to match text with a double array.\n */\nfunction getRegexFromDoubleArray( twoPartTransitionWords ) {\n\tconst cacheKey = flattenDeep( twoPartTransitionWords ).join( \"\" );\n\tif ( regexFromDoubleArrayCacheKey !== cacheKey || regexFromDoubleArray === null ) {\n\t\tregexFromDoubleArrayCacheKey = cacheKey;\n\t\tregexFromDoubleArray = createRegexFromDoubleArray( twoPartTransitionWords );\n\t}\n\treturn regexFromDoubleArray;\n}\n\n/**\n * Matches the sentence against two part transition words.\n *\n * @param {string} sentence The sentence to match against.\n * @param {Array} twoPartTransitionWords The array containing two-part transition words.\n * @returns {Array} The found transitional words.\n */\nconst matchTwoPartTransitionWords = function( sentence, twoPartTransitionWords ) {\n\tsentence = normalizeSingleQuotes( sentence );\n\tconst twoPartTransitionWordsRegex = getRegexFromDoubleArray( twoPartTransitionWords );\n\treturn sentence.match( twoPartTransitionWordsRegex );\n};\n\n/**\n * Matches the sentence against transition words.\n *\n * @param {string} sentence The sentence to match against.\n * @param {Array} transitionWords The array containing transition words.\n * @returns {Array} The found transitional words.\n */\nconst matchTransitionWords = function( sentence, transitionWords ) {\n\tsentence = normalizeSingleQuotes( sentence );\n\treturn transitionWords.filter( word => matchWordInSentence( word, sentence ) );\n};\n\n/**\n * Checks the passed sentences to see if they contain transition words.\n *\n * @param {Array} sentences The sentences to match against.\n * @param {Array} transitionWords The array containing transition words.\n * @param {Array} twoPartTransitionWords The array containing two part transition words.\n * @param {function} matchTransitionWordsHelper The language-specific helper function to match transition words in a sentence.\n *\n * @returns {Array} Array of sentence objects containing the complete sentence and the transition words.\n */\nconst checkSentencesForTransitionWords = function( sentences, transitionWords, twoPartTransitionWords, matchTransitionWordsHelper ) {\n\tconst results = [];\n\n\tsentences.forEach( sentence => {\n\t\tif ( twoPartTransitionWords ) {\n\t\t\tconst twoPartMatches = matchTwoPartTransitionWords( sentence, twoPartTransitionWords );\n\n\t\t\tif ( twoPartMatches !== null ) {\n\t\t\t\tresults.push( {\n\t\t\t\t\tsentence: sentence,\n\t\t\t\t\ttransitionWords: twoPartMatches,\n\t\t\t\t} );\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst transitionWordMatches = matchTransitionWordsHelper\n\t\t\t? matchTransitionWordsHelper( sentence, transitionWords )\n\t\t\t: matchTransitionWords( sentence, transitionWords );\n\n\t\tif ( transitionWordMatches.length !== 0 ) {\n\t\t\tresults.push( {\n\t\t\t\tsentence: sentence,\n\t\t\t\ttransitionWords: transitionWordMatches,\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn results;\n};\n\n/**\n * Checks how many sentences from a text contain at least one transition word or two-part transition word\n * that are defined in the transition words config and two part transition words config.\n *\n * @param {Paper} paper The Paper object to get text from.\n * @param {Researcher} researcher The researcher.\n *\n * @returns {object} An object with the total number of sentences in the text\n * and the total number of sentences containing one or more transition words.\n */\nexport default function( paper, researcher ) {\n\tconst matchTransitionWordsHelper = researcher.getHelper( \"matchTransitionWordsHelper\" );\n\tconst transitionWords = researcher.getConfig( \"transitionWords\" );\n\tconst twoPartTransitionWords = researcher.getConfig( \"twoPartTransitionWords\" );\n\tconst memoizedTokenizer = researcher.getHelper( \"memoizedTokenizer\" );\n\n\tlet text = paper.getText();\n\ttext = removeHtmlBlocks( text );\n\ttext = filterShortcodesFromHTML( text, paper._attributes && paper._attributes.shortcodes );\n\tconst sentences = getSentences( text, memoizedTokenizer );\n\tconst sentenceResults = checkSentencesForTransitionWords( sentences, transitionWords, twoPartTransitionWords, matchTransitionWordsHelper );\n\n\treturn {\n\t\ttotalSentences: sentences.length,\n\t\tsentenceResults: sentenceResults,\n\t\ttransitionWordSentences: sentenceResults.length,\n\t};\n}\n"],"mappings":"AAAA,OAAOA,0BAA0B;AACjC,OAAOC,YAAY;AACnB,SAASC,eAAe,IAAIC,qBAAqB;AACjD,SAASC,gBAAgB,IAAIC,mBAAmB;AAChD,OAAOC,gBAAgB;AAEvB,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,wBAAwB;AAEjC,IAAIC,oBAAoB,GAAG,IAAI;AAC/B,IAAIC,4BAA4B,GAAG,EAAE;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuBA,CAAEC,sBAAsB,EAAG;EAC1D,MAAMC,QAAQ,GAAGN,WAAW,CAAEK,sBAAuB,CAAC,CAACE,IAAI,CAAE,EAAG,CAAC;EACjE,IAAKJ,4BAA4B,KAAKG,QAAQ,IAAIJ,oBAAoB,KAAK,IAAI,EAAG;IACjFC,4BAA4B,GAAGG,QAAQ;IACvCJ,oBAAoB,GAAGT,0BAA0B,CAAEY,sBAAuB,CAAC;EAC5E;EACA,OAAOH,oBAAoB;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,2BAA2B,GAAG,SAAAA,CAAUC,QAAQ,EAAEJ,sBAAsB,EAAG;EAChFI,QAAQ,GAAGb,qBAAqB,CAAEa,QAAS,CAAC;EAC5C,MAAMC,2BAA2B,GAAGN,uBAAuB,CAAEC,sBAAuB,CAAC;EACrF,OAAOI,QAAQ,CAACE,KAAK,CAAED,2BAA4B,CAAC;AACrD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,oBAAoB,GAAG,SAAAA,CAAUH,QAAQ,EAAEI,eAAe,EAAG;EAClEJ,QAAQ,GAAGb,qBAAqB,CAAEa,QAAS,CAAC;EAC5C,OAAOI,eAAe,CAACC,MAAM,CAAEC,IAAI,IAA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AS,CAAE,mBAAoB,CAAC;EAErE,IAAIG,IAAI,GAAGL,KAAK,CAACM,OAAO,CAAC,CAAC;EAC1BD,IAAI,GAAG/B,gBAAgB,CAAE+B,IAAK,CAAC;EAC/BA,IAAI,GAAG7B,wBAAwB,CAAE6B,IAAI,EAAEL,KAAK,CAACO,WAAW,IAAIP,KAAK,CAACO,WAAW,CAACC,UAAW,CAAC;EAC1F,MAAMhB,SAAS,GAAGvB,YAAY,CAAEoC,IAAI,EAAED,iBAAkB,CAAC;EACzD,MAAMK,eAAe,GAAGlB,gCAAgC,CAAEC,SAAS,EAAEJ,eAAe,EAAER,sBAAsB,EAAEa,0BAA2B,CAAC;EAE1I,OAAO;IACNiB,cAAc,EAAElB,SAAS,CAACO,MAAM;IAChCU,eAAe,EAAEA,eAAe;IAChCE,uBAAuB,EAAEF,eAAe,CAACV;EAC1C,CAAC;AACF","ignoreList":[]}
@@ -1,14 +1,8 @@
1
- "use strict";
1
+ import { filter, includes, isEmpty } from "lodash";
2
+ import getWords from "../helpers/word/getWords";
3
+ import processExactMatchRequest from "../helpers/match/processExactMatchRequest";
4
+ import { WORD_BOUNDARY_WITH_HYPHEN } from "../../config/wordBoundariesWithoutPunctuation";
2
5
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
- var _lodash = require("lodash");
8
- var _getWords = _interopRequireDefault(require("../helpers/word/getWords"));
9
- var _processExactMatchRequest = _interopRequireDefault(require("../helpers/match/processExactMatchRequest"));
10
- var _wordBoundariesWithoutPunctuation = require("../../config/wordBoundariesWithoutPunctuation");
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
6
  /**
13
7
  * Checks if the keyphrase contains of function words only.
14
8
  *
@@ -17,7 +11,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
17
11
  *
18
12
  * @returns {boolean} Whether the keyphrase contains of content words only.
19
13
  */
20
- function _default(paper, researcher) {
14
+ export default function (paper, researcher) {
21
15
  const functionWords = researcher.getConfig("functionWords");
22
16
 
23
17
  // A helper to get words from the keyphrase for languages that don't use the default way.
@@ -25,7 +19,7 @@ function _default(paper, researcher) {
25
19
  const keyphrase = paper.getKeyword();
26
20
 
27
21
  // Return false if there are double quotes around the keyphrase.
28
- if ((0, _processExactMatchRequest.default)(keyphrase).exactMatchRequested) {
22
+ if (processExactMatchRequest(keyphrase).exactMatchRequested) {
29
23
  return false;
30
24
  }
31
25
 
@@ -39,10 +33,10 @@ function _default(paper, researcher) {
39
33
  * As a downside, single function words containing hyphens (e.g. 'vis-à-vis') won't be automatically matched, but we
40
34
  * are solving this by adding each word from such function words as separate entries in the function words lists.
41
35
  */
42
- let keyphraseWords = getWordsCustomHelper ? getWordsCustomHelper(keyphrase) : (0, _getWords.default)(keyphrase, _wordBoundariesWithoutPunctuation.WORD_BOUNDARY_WITH_HYPHEN);
43
- keyphraseWords = (0, _lodash.filter)(keyphraseWords, function (word) {
44
- return !(0, _lodash.includes)(functionWords, word.trim().toLocaleLowerCase());
36
+ let keyphraseWords = getWordsCustomHelper ? getWordsCustomHelper(keyphrase) : getWords(keyphrase, WORD_BOUNDARY_WITH_HYPHEN);
37
+ keyphraseWords = filter(keyphraseWords, function (word) {
38
+ return !includes(functionWords, word.trim().toLocaleLowerCase());
45
39
  });
46
- return (0, _lodash.isEmpty)(keyphraseWords);
40
+ return isEmpty(keyphraseWords);
47
41
  }
48
42
  //# sourceMappingURL=functionWordsInKeyphrase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"functionWordsInKeyphrase.js","names":["_lodash","require","_getWords","_interopRequireDefault","_processExactMatchRequest","_wordBoundariesWithoutPunctuation","e","__esModule","default","_default","paper","researcher","functionWords","getConfig","getWordsCustomHelper","getHelper","keyphrase","getKeyword","processExactMatchRequest","exactMatchRequested","keyphraseWords","getWords","WORD_BOUNDARY_WITH_HYPHEN","filter","word","includes","trim","toLocaleLowerCase","isEmpty"],"sources":["../../../src/languageProcessing/researches/functionWordsInKeyphrase.js"],"sourcesContent":["import { filter, includes, isEmpty } from \"lodash\";\nimport getWords from \"../helpers/word/getWords\";\nimport processExactMatchRequest from \"../helpers/match/processExactMatchRequest\";\nimport { WORD_BOUNDARY_WITH_HYPHEN } from \"../../config/wordBoundariesWithoutPunctuation\";\n\n/**\n * Checks if the keyphrase contains of function words only.\n *\n * @param {object} paper The paper containing the keyword.\n * @param {Researcher} researcher The researcher.\n *\n * @returns {boolean} Whether the keyphrase contains of content words only.\n */\nexport default function( paper, researcher ) {\n\tconst functionWords = researcher.getConfig( \"functionWords\" );\n\n\t// A helper to get words from the keyphrase for languages that don't use the default way.\n\tconst getWordsCustomHelper = researcher.getHelper( \"getWordsCustomHelper\" );\n\tconst keyphrase = paper.getKeyword();\n\n\t// Return false if there are double quotes around the keyphrase.\n\tif ( processExactMatchRequest( keyphrase ).exactMatchRequested ) {\n\t\treturn false;\n\t}\n\n\t/*\n * We use a word boundary regex that includes whitespaces, en-dashes, and hyphens for all languages.\n * This means that we also consider keyphrases that consist of function words separated by hyphens (e.g. 'two-year-old')\n * as containing only function words. Since many hyphenated phrases can also be written without hyphens, this way the\n * behavior for hyphenated phrases matches the behavior for unhyphenated phrases.\n * In Indonesian we normally don't want to treat hyphens as word boundaries, but in this case it makes sense because\n * in Indonesian you can also have function words seperated by hyphens (e.g. 'dua-lima').\n * As a downside, single function words containing hyphens (e.g. 'vis-à-vis') won't be automatically matched, but we\n * are solving this by adding each word from such function words as separate entries in the function words lists.\n */\n\tlet keyphraseWords = getWordsCustomHelper ? getWordsCustomHelper( keyphrase )\n\t\t: getWords( keyphrase, WORD_BOUNDARY_WITH_HYPHEN );\n\n\tkeyphraseWords = filter( keyphraseWords, function( word ) {\n\t\treturn ( ! includes( functionWords, word.trim().toLocaleLowerCase() ) );\n\t} );\n\n\treturn isEmpty( keyphraseWords );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,iCAAA,GAAAJ,OAAA;AAA0F,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAAG,SAAUC,KAAK,EAAEC,UAAU,EAAG;EAC5C,MAAMC,aAAa,GAAGD,UAAU,CAACE,SAAS,CAAE,eAAgB,CAAC;;EAE7D;EACA,MAAMC,oBAAoB,GAAGH,UAAU,CAACI,SAAS,CAAE,sBAAuB,CAAC;EAC3E,MAAMC,SAAS,GAAGN,KAAK,CAACO,UAAU,CAAC,CAAC;;EAEpC;EACA,IAAK,IAAAC,iCAAwB,EAAEF,SAAU,CAAC,CAACG,mBAAmB,EAAG;IAChE,OAAO,KAAK;EACb;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,IAAIC,cAAc,GAAGN,oBAAoB,GAAGA,oBAAoB,CAAEE,SAAU,CAAC,GAC1E,IAAAK,iBAAQ,EAAEL,SAAS,EAAEM,2DAA0B,CAAC;EAEnDF,cAAc,GAAG,IAAAG,cAAM,EAAEH,cAAc,EAAE,UAAUI,IAAI,EAAG;IACzD,OAAS,CAAE,IAAAC,gBAAQ,EAAEb,aAAa,EAAEY,IAAI,CAACE,IAAI,CAAC,CAAC,CAACC,iBAAiB,CAAC,CAAE,CAAC;EACtE,CAAE,CAAC;EAEH,OAAO,IAAAC,eAAO,EAAER,cAAe,CAAC;AACjC","ignoreList":[]}
1
+ {"version":3,"file":"functionWordsInKeyphrase.js","names":["filter","includes","isEmpty","getWords","processExactMatchRequest","WORD_BOUNDARY_WITH_HYPHEN","paper","researcher","functionWords","getConfig","getWordsCustomHelper","getHelper","keyphrase","getKeyword","exactMatchRequested","keyphraseWords","word","trim","toLocaleLowerCase"],"sources":["../../../src/languageProcessing/researches/functionWordsInKeyphrase.js"],"sourcesContent":["import { filter, includes, isEmpty } from \"lodash\";\nimport getWords from \"../helpers/word/getWords\";\nimport processExactMatchRequest from \"../helpers/match/processExactMatchRequest\";\nimport { WORD_BOUNDARY_WITH_HYPHEN } from \"../../config/wordBoundariesWithoutPunctuation\";\n\n/**\n * Checks if the keyphrase contains of function words only.\n *\n * @param {object} paper The paper containing the keyword.\n * @param {Researcher} researcher The researcher.\n *\n * @returns {boolean} Whether the keyphrase contains of content words only.\n */\nexport default function( paper, researcher ) {\n\tconst functionWords = researcher.getConfig( \"functionWords\" );\n\n\t// A helper to get words from the keyphrase for languages that don't use the default way.\n\tconst getWordsCustomHelper = researcher.getHelper( \"getWordsCustomHelper\" );\n\tconst keyphrase = paper.getKeyword();\n\n\t// Return false if there are double quotes around the keyphrase.\n\tif ( processExactMatchRequest( keyphrase ).exactMatchRequested ) {\n\t\treturn false;\n\t}\n\n\t/*\n * We use a word boundary regex that includes whitespaces, en-dashes, and hyphens for all languages.\n * This means that we also consider keyphrases that consist of function words separated by hyphens (e.g. 'two-year-old')\n * as containing only function words. Since many hyphenated phrases can also be written without hyphens, this way the\n * behavior for hyphenated phrases matches the behavior for unhyphenated phrases.\n * In Indonesian we normally don't want to treat hyphens as word boundaries, but in this case it makes sense because\n * in Indonesian you can also have function words seperated by hyphens (e.g. 'dua-lima').\n * As a downside, single function words containing hyphens (e.g. 'vis-à-vis') won't be automatically matched, but we\n * are solving this by adding each word from such function words as separate entries in the function words lists.\n */\n\tlet keyphraseWords = getWordsCustomHelper ? getWordsCustomHelper( keyphrase )\n\t\t: getWords( keyphrase, WORD_BOUNDARY_WITH_HYPHEN );\n\n\tkeyphraseWords = filter( keyphraseWords, function( word ) {\n\t\treturn ( ! includes( functionWords, word.trim().toLocaleLowerCase() ) );\n\t} );\n\n\treturn isEmpty( keyphraseWords );\n}\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,QAAQ;AAClD,OAAOC,QAAQ;AACf,OAAOC,wBAAwB;AAC/B,SAASC,yBAAyB;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAUC,KAAK,EAAEC,UAAU,EAAG;EAC5C,MAAMC,aAAa,GAAGD,UAAU,CAACE,SAAS,CAAE,eAAgB,CAAC;;EAE7D;EACA,MAAMC,oBAAoB,GAAGH,UAAU,CAACI,SAAS,CAAE,sBAAuB,CAAC;EAC3E,MAAMC,SAAS,GAAGN,KAAK,CAACO,UAAU,CAAC,CAAC;;EAEpC;EACA,IAAKT,wBAAwB,CAAEQ,SAAU,CAAC,CAACE,mBAAmB,EAAG;IAChE,OAAO,KAAK;EACb;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,IAAIC,cAAc,GAAGL,oBAAoB,GAAGA,oBAAoB,CAAEE,SAAU,CAAC,GAC1ET,QAAQ,CAAES,SAAS,EAAEP,yBAA0B,CAAC;EAEnDU,cAAc,GAAGf,MAAM,CAAEe,cAAc,EAAE,UAAUC,IAAI,EAAG;IACzD,OAAS,CAAEf,QAAQ,CAAEO,aAAa,EAAEQ,IAAI,CAACC,IAAI,CAAC,CAAC,CAACC,iBAAiB,CAAC,CAAE,CAAC;EACtE,CAAE,CAAC;EAEH,OAAOhB,OAAO,CAAEa,cAAe,CAAC;AACjC","ignoreList":[]}
@@ -1,19 +1,12 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
- var _lodash = require("lodash");
8
- var _filterWordsFromArray = _interopRequireDefault(require("../helpers/word/filterWordsFromArray"));
9
- var _findKeywordFormsInString = require("../helpers/match/findKeywordFormsInString");
10
- var _getWords = _interopRequireDefault(require("../helpers/word/getWords"));
11
- var _matchTextWithArray = _interopRequireDefault(require("../helpers/match/matchTextWithArray"));
12
- var _parseSynonyms = _interopRequireDefault(require("../helpers/sanitize/parseSynonyms"));
13
- var _processExactMatchRequest = _interopRequireDefault(require("../helpers/match/processExactMatchRequest"));
14
- var _url = _interopRequireDefault(require("../helpers/url/url.js"));
15
- var _wordBoundariesWithoutPunctuation = require("../../config/wordBoundariesWithoutPunctuation");
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
1
+ import { flatten, uniq } from "lodash";
2
+ import filterWordsFromArray from "../helpers/word/filterWordsFromArray";
3
+ import { findTopicFormsInString } from "../helpers/match/findKeywordFormsInString";
4
+ import getWords from "../helpers/word/getWords";
5
+ import matchTextWithArray from "../helpers/match/matchTextWithArray";
6
+ import parseSynonyms from "../helpers/sanitize/parseSynonyms";
7
+ import processExactMatchRequest from "../helpers/match/processExactMatchRequest";
8
+ import urlHelper from "../helpers/url/url.js";
9
+ import { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from "../../config/wordBoundariesWithoutPunctuation";
17
10
  let functionWords = [];
18
11
 
19
12
  /**
@@ -26,7 +19,7 @@ let functionWords = [];
26
19
  * @returns {boolean} Whether the anchor's link is a relative fragment or the same as the site url/domain.
27
20
  */
28
21
  function isLinkingToSelf(anchorLink, siteUrlOrDomain) {
29
- return Boolean(_url.default.areEqual(anchorLink, siteUrlOrDomain) || _url.default.isRelativeFragmentURL(anchorLink));
22
+ return Boolean(urlHelper.areEqual(anchorLink, siteUrlOrDomain) || urlHelper.isRelativeFragmentURL(anchorLink));
30
23
  }
31
24
 
32
25
  /**
@@ -60,7 +53,7 @@ function getAnchorsContainingTopic(anchors, topicForms, locale, matchWordCustomH
60
53
  const anchorsContainingTopic = anchors.map(function (anchor) {
61
54
  // Only retrieve the anchor's text. This is because we only use the anchor text for the following check.
62
55
  const anchorText = anchor.innerText();
63
- return (0, _findKeywordFormsInString.findTopicFormsInString)(topicForms, anchorText, true, locale, matchWordCustomHelper).percentWordMatches === 100;
56
+ return findTopicFormsInString(topicForms, anchorText, true, locale, matchWordCustomHelper).percentWordMatches === 100;
64
57
  });
65
58
  return anchors.filter((anchor, index) => anchorsContainingTopic[index]);
66
59
  }
@@ -83,9 +76,9 @@ function getAnchorsWithSameTextAsTopic(anchors, topicForms, locale, customHelper
83
76
  const getWordsCustomHelper = customHelpers.getWordsCustomHelper;
84
77
 
85
78
  // Prepare keyphrase and synonym forms for comparison with anchors.
86
- const keyphraseAndSynonymsWords = [(0, _lodash.flatten)(topicForms.keyphraseForms)];
79
+ const keyphraseAndSynonymsWords = [flatten(topicForms.keyphraseForms)];
87
80
  const synonymsForms = topicForms.synonymsForms;
88
- synonymsForms.forEach(form => keyphraseAndSynonymsWords.push((0, _lodash.flatten)(form)));
81
+ synonymsForms.forEach(form => keyphraseAndSynonymsWords.push(flatten(form)));
89
82
 
90
83
  // The variable that will save all the anchors with text that has the same content words as the keyphrase/synonyms.
91
84
  const anchorsContainedInTopic = [];
@@ -103,18 +96,18 @@ function getAnchorsWithSameTextAsTopic(anchors, topicForms, locale, customHelper
103
96
  */
104
97
  let anchorWords;
105
98
  if (getWordsCustomHelper) {
106
- anchorWords = (0, _lodash.uniq)(getWordsCustomHelper(currentAnchorText));
99
+ anchorWords = uniq(getWordsCustomHelper(currentAnchorText));
107
100
  } else if (areHyphensWordBoundaries) {
108
- anchorWords = (0, _lodash.uniq)((0, _getWords.default)(currentAnchorText, _wordBoundariesWithoutPunctuation.WORD_BOUNDARY_WITH_HYPHEN));
101
+ anchorWords = uniq(getWords(currentAnchorText, WORD_BOUNDARY_WITH_HYPHEN));
109
102
  } else {
110
- anchorWords = (0, _lodash.uniq)((0, _getWords.default)(currentAnchorText, _wordBoundariesWithoutPunctuation.WORD_BOUNDARY_WITHOUT_HYPHEN));
103
+ anchorWords = uniq(getWords(currentAnchorText, WORD_BOUNDARY_WITHOUT_HYPHEN));
111
104
  }
112
105
 
113
106
  /*
114
107
  * Filter function words out of the anchor text.
115
108
  * If the anchor text contains only function words, we keep them.
116
109
  */
117
- const filteredAnchorWords = (0, _filterWordsFromArray.default)(anchorWords, functionWords);
110
+ const filteredAnchorWords = filterWordsFromArray(anchorWords, functionWords);
118
111
  if (filteredAnchorWords.length > 0) {
119
112
  anchorWords = filteredAnchorWords;
120
113
  }
@@ -131,7 +124,7 @@ function getAnchorsWithSameTextAsTopic(anchors, topicForms, locale, customHelper
131
124
  // Check if every word in the anchor text is also present in the keyphrase/synonym.
132
125
  for (let i = 0; i < keyphraseAndSynonymsWords.length; i++) {
133
126
  const topicForm = keyphraseAndSynonymsWords[i];
134
- if (anchorWords.every(anchorWord => (0, _matchTextWithArray.default)(anchorWord, topicForm, locale, matchWordCustomHelper).count > 0)) {
127
+ if (anchorWords.every(anchorWord => matchTextWithArray(anchorWord, topicForm, locale, matchWordCustomHelper).count > 0)) {
135
128
  anchorsContainedInTopic.push(true);
136
129
  break;
137
130
  }
@@ -149,7 +142,7 @@ function getAnchorsWithSameTextAsTopic(anchors, topicForms, locale, customHelper
149
142
  *
150
143
  * @returns {Object} The amount of anchor texts whose content words are the same as the keyphrase or synonyms' content words.
151
144
  */
152
- function _default(paper, researcher) {
145
+ export default function (paper, researcher) {
153
146
  functionWords = researcher.getConfig("functionWords");
154
147
  const areHyphensWordBoundaries = researcher.getConfig("areHyphensWordBoundaries");
155
148
  const result = {
@@ -176,7 +169,7 @@ function _default(paper, researcher) {
176
169
  * When the keyphrase is set, also retrieve the synonyms and save them in "topics" array.
177
170
  * Eventually, the term topics here refers to either keyphrase or synonyms.
178
171
  */
179
- const originalTopics = (0, _parseSynonyms.default)(paper.getSynonyms());
172
+ const originalTopics = parseSynonyms(paper.getSynonyms());
180
173
  originalTopics.push(keyphrase);
181
174
 
182
175
  // Retrieve the anchors.
@@ -211,7 +204,7 @@ function _default(paper, researcher) {
211
204
 
212
205
  // STEP 5.
213
206
  // Check if exact match is requested for every topic (keyphrase or synonym).
214
- const isExactMatchRequested = originalTopics.map(originalTopic => (0, _processExactMatchRequest.default)(originalTopic));
207
+ const isExactMatchRequested = originalTopics.map(originalTopic => processExactMatchRequest(originalTopic));
215
208
  // Get the anchors with text that has the same content words as the keyphrase/synonyms.
216
209
  anchors = getAnchorsWithSameTextAsTopic(anchors, topicForms, locale, customHelpers, isExactMatchRequested, areHyphensWordBoundaries);
217
210
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"getAnchorsWithKeyphrase.js","names":["_lodash","require","_filterWordsFromArray","_interopRequireDefault","_findKeywordFormsInString","_getWords","_matchTextWithArray","_parseSynonyms","_processExactMatchRequest","_url","_wordBoundariesWithoutPunctuation","e","__esModule","default","functionWords","isLinkingToSelf","anchorLink","siteUrlOrDomain","Boolean","urlHelper","areEqual","isRelativeFragmentURL","getAnchorsLinkingToSelf","anchors","anchorsLinkingToSelf","map","anchor","attributes","href","filter","index","getAnchorsContainingTopic","topicForms","locale","matchWordCustomHelper","anchorsContainingTopic","anchorText","innerText","findTopicFormsInString","percentWordMatches","getAnchorsWithSameTextAsTopic","customHelpers","exactMatchRequest","areHyphensWordBoundaries","getWordsCustomHelper","keyphraseAndSynonymsWords","flatten","keyphraseForms","synonymsForms","forEach","form","push","anchorsContainedInTopic","currentAnchor","currentAnchorText","anchorWords","uniq","getWords","WORD_BOUNDARY_WITH_HYPHEN","WORD_BOUNDARY_WITHOUT_HYPHEN","filteredAnchorWords","filterWordsFromArray","length","request","exactMatchRequested","every","anchorWord","keyphrase","includes","i","topicForm","matchTextWithArray","count","_default","paper","researcher","getConfig","result","anchorsWithKeyphrase","anchorsWithKeyphraseCount","getText","getKeyword","originalTopics","parseSynonyms","getSynonyms","getTree","findAll","treeNode","name","getPermalink","getLocale","getResearch","getHelper","isExactMatchRequested","originalTopic","processExactMatchRequest"],"sources":["../../../src/languageProcessing/researches/getAnchorsWithKeyphrase.js"],"sourcesContent":["import { flatten, uniq } from \"lodash\";\nimport filterWordsFromArray from \"../helpers/word/filterWordsFromArray\";\nimport { findTopicFormsInString } from \"../helpers/match/findKeywordFormsInString\";\nimport getWords from \"../helpers/word/getWords\";\nimport matchTextWithArray from \"../helpers/match/matchTextWithArray\";\nimport parseSynonyms from \"../helpers/sanitize/parseSynonyms\";\nimport processExactMatchRequest from \"../helpers/match/processExactMatchRequest\";\nimport urlHelper from \"../helpers/url/url.js\";\nimport { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from \"../../config/wordBoundariesWithoutPunctuation\";\n\nlet functionWords = [];\n\n/**\n * Checks whether the anchor's link is a relative fragment or the same as the site url/domain.\n * Relative fragment links always point to the page itself.\n *\n * @param {String} anchorLink The link anchor.\n * @param {String} siteUrlOrDomain The site URL or domain of the paper.\n *\n * @returns {boolean} Whether the anchor's link is a relative fragment or the same as the site url/domain.\n */\nfunction isLinkingToSelf( anchorLink, siteUrlOrDomain ) {\n\treturn Boolean( urlHelper.areEqual( anchorLink, siteUrlOrDomain ) || urlHelper.isRelativeFragmentURL( anchorLink ) );\n}\n\n/**\n * Gets the anchors whose url is not linking at the current site url/domain.\n *\n * @param {Array} anchors An array with all anchors from the paper.\n * @param {String} siteUrlOrDomain The site URL or domain of the paper.\n *\n * @returns {Array} The array of all anchors whose url is not linking at the current site url/domain.\n */\nfunction getAnchorsLinkingToSelf( anchors, siteUrlOrDomain ) {\n\tconst anchorsLinkingToSelf = anchors.map( function( anchor ) {\n\t\tconst anchorLink = anchor.attributes.href;\n\t\t// Return false if there is no href attribute.\n\t\treturn anchorLink ? isLinkingToSelf( anchorLink, siteUrlOrDomain ) : false;\n\t} );\n\n\treturn anchors.filter( ( anchor, index ) => ! anchorsLinkingToSelf[ index ] );\n}\n\n/**\n * Gets the anchors with text that contains all content words of the topic (i.e. keyphrase or synonyms).\n *\n * @param {Array} anchors An array with all anchors from the paper\n * @param {Object} topicForms The object with topicForms. It contains all forms of the keyphrase and synonyms.\n * @param {String} locale The locale of the paper.\n * @param {Function} matchWordCustomHelper The helper function to match word in text.\n *\n * @returns {String[]} The array of all anchors with text that contains all content words of the keyphrase or synonyms.\n */\nfunction getAnchorsContainingTopic( anchors, topicForms, locale, matchWordCustomHelper ) {\n\tconst anchorsContainingTopic = anchors.map( function( anchor ) {\n\t\t// Only retrieve the anchor's text. This is because we only use the anchor text for the following check.\n\t\tconst anchorText = anchor.innerText();\n\t\treturn findTopicFormsInString( topicForms, anchorText, true, locale, matchWordCustomHelper ).percentWordMatches === 100;\n\t} );\n\n\treturn anchors.filter( ( anchor, index ) => anchorsContainingTopic[ index ] );\n}\n\n/**\n * Gets the anchors with text that has the same content words as the keyphrase or synonyms.\n *\n * @param {Array} anchors \t\tAn array with all anchors from the paper.\n * @param {Object} topicForms \t\tThe object with topicForms. It contains all forms of the keyphrase and synonyms.\n * @param {string} locale \t\tThe locale of the paper.\n * @param {Object} customHelpers \t\tAn object containing custom helpers.\n * @param {Object[]} exactMatchRequest \t\tAn array of objects containing the keyphrase and information on whether\n * \t\t\t\t\t\t\t\t\t\t\t\t\tthe exact match has been requested.\n * @param {boolean}\t \tareHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {Array} The array of all anchors with text that has the same content words as the keyphrase/synonyms.\n */\nfunction getAnchorsWithSameTextAsTopic( anchors, topicForms, locale, customHelpers, exactMatchRequest, areHyphensWordBoundaries ) {\n\tconst matchWordCustomHelper = customHelpers.matchWordCustomHelper;\n\tconst getWordsCustomHelper = customHelpers.getWordsCustomHelper;\n\n\t// Prepare keyphrase and synonym forms for comparison with anchors.\n\tconst keyphraseAndSynonymsWords = [ flatten( topicForms.keyphraseForms ) ];\n\tconst synonymsForms = topicForms.synonymsForms;\n\tsynonymsForms.forEach( form => keyphraseAndSynonymsWords.push( flatten( form ) ) );\n\n\t// The variable that will save all the anchors with text that has the same content words as the keyphrase/synonyms.\n\tconst anchorsContainedInTopic = [];\n\n\tanchors.forEach( function( currentAnchor ) {\n\t\tconst currentAnchorText = currentAnchor.innerText();\n\n\t\t/*\n * For keyphrase matching, we want to split words on hyphens and en-dashes, except for languages where hyphens shouldn't\n * be treated as word boundaries. Currently, the latter only applies to Indonesian, where hyphens are used to create plural forms of nouns,\n * such as \"buku-buku\" being a plural form of \"buku\". We want to treat forms like \"buku-buku\" as one word, so we shouldn't\n * split words on hyphens in Indonesian.\n * For languages where hyphens are treated as word boundaries we pass a custom word boundary regex string to the getWords helper\n * that includes whitespaces, hyphens (u002d), and en-dashes (u2013). Otherwise, we pass a word boundary regex that only includes\n * whitespaces and en-dashes.\n */\n\t\tlet anchorWords;\n\t\tif ( getWordsCustomHelper ) {\n\t\t\tanchorWords = uniq( getWordsCustomHelper( currentAnchorText ) );\n\t\t} else if ( areHyphensWordBoundaries ) {\n\t\t\tanchorWords = uniq( getWords( currentAnchorText, WORD_BOUNDARY_WITH_HYPHEN ) );\n\t\t} else {\n\t\t\tanchorWords = uniq( getWords( currentAnchorText, WORD_BOUNDARY_WITHOUT_HYPHEN ) );\n\t\t}\n\n\t\t/*\n\t\t * Filter function words out of the anchor text.\n\t\t * If the anchor text contains only function words, we keep them.\n\t\t */\n\t\tconst filteredAnchorWords = filterWordsFromArray( anchorWords, functionWords );\n\t\tif ( filteredAnchorWords.length > 0 ) {\n\t\t\tanchorWords = filteredAnchorWords;\n\t\t}\n\n\t\texactMatchRequest.forEach( request => {\n\t\t\t/*\n\t\t\t * Check a) if the exact match is requested for the keyphrase, and\n\t\t\t * b) if every content word in the anchor text is included in the keyphrase or synonym.\n\t\t\t */\n\t\t\tif ( request.exactMatchRequested &&\n\t\t\t\tanchorWords.every( anchorWord => request.keyphrase.includes( anchorWord ) ) ) {\n\t\t\t\tanchorsContainedInTopic.push( true );\n\t\t\t}\n\t\t} );\n\n\t\t// Check if every word in the anchor text is also present in the keyphrase/synonym.\n\t\tfor ( let i = 0; i < keyphraseAndSynonymsWords.length; i++ ) {\n\t\t\tconst topicForm = keyphraseAndSynonymsWords[ i ];\n\n\t\t\tif ( anchorWords.every( anchorWord => matchTextWithArray( anchorWord, topicForm, locale, matchWordCustomHelper ).count > 0 ) ) {\n\t\t\t\tanchorsContainedInTopic.push( true );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn anchors.filter( ( anchor, index ) => anchorsContainedInTopic[ index ] );\n}\n\n/**\n * Checks whether the content words of the anchor text are the same as the content words of the keyphrase or synonym.\n * Also includes different word forms if the morphology is available.\n *\n * @param {Paper} paper The paper to research.\n * @param {Researcher} researcher The researcher to use.\n *\n * @returns {Object} The amount of anchor texts whose content words are the same as the keyphrase or synonyms' content words.\n */\nexport default function( paper, researcher ) {\n\tfunctionWords = researcher.getConfig( \"functionWords\" );\n\n\tconst areHyphensWordBoundaries = researcher.getConfig( \"areHyphensWordBoundaries\" );\n\n\tconst result = {\n\t\tanchorsWithKeyphrase: [],\n\t\tanchorsWithKeyphraseCount: 0,\n\t};\n\t// STEP 1.\n\t// If the paper's text is empty, return empty result.\n\tif ( paper.getText() === \"\" ) {\n\t\treturn result;\n\t}\n\n\t// STEP 2.\n\tconst keyphrase = paper.getKeyword();\n\t/*\n\t * If no keyphrase is set, return empty result.\n\t * This is a conscious decision where we won't assess the paper if the keyphrase is not set.\n\t * This includes a case where only the synonym is set but not the keyphrase.\n\t */\n\tif ( keyphrase === \"\" ) {\n\t\treturn result;\n\t}\n\t/*\n\t * When the keyphrase is set, also retrieve the synonyms and save them in \"topics\" array.\n\t * Eventually, the term topics here refers to either keyphrase or synonyms.\n\t */\n\tconst originalTopics = parseSynonyms( paper.getSynonyms() );\n\toriginalTopics.push( keyphrase );\n\n\t// Retrieve the anchors.\n\tlet anchors = paper.getTree().findAll( treeNode => treeNode.name === \"a\" );\n\t/*\n\t * We get the site's URL (e.g., https://yoast.com) or domain (e.g., yoast.com) from the paper.\n\t * In case of WordPress, the variable is a URL. In case of Shopify, it is a domain.\n\t */\n\tconst siteUrlOrDomain = paper.getPermalink();\n\n\t// STEP 3.\n\t// Get the anchors with urls that are not linking to the current site url/domain.\n\tanchors = getAnchorsLinkingToSelf( anchors, siteUrlOrDomain );\n\t// If all anchor urls are linking to the current site url/domain, return empty result.\n\tif ( anchors.length === 0 ) {\n\t\treturn result;\n\t}\n\n\tconst locale = paper.getLocale();\n\tconst topicForms = researcher.getResearch( \"morphology\" );\n\tconst customHelpers = {\n\t\tmatchWordCustomHelper: researcher.getHelper( \"matchWordCustomHelper\" ),\n\t\tgetWordsCustomHelper: researcher.getHelper( \"getWordsCustomHelper\" ),\n\t};\n\n\t// STEP 4.\n\t// Get the anchors with text that contains the keyphrase/synonyms' content words.\n\tanchors = getAnchorsContainingTopic( anchors, topicForms, locale, customHelpers.matchWordCustomHelper );\n\t// If all anchor texts do not contain the keyphrase/synonyms' content words, return empty result.\n\tif ( anchors.length === 0 ) {\n\t\treturn result;\n\t}\n\n\t// STEP 5.\n\t// Check if exact match is requested for every topic (keyphrase or synonym).\n\tconst isExactMatchRequested = originalTopics.map( originalTopic => processExactMatchRequest( originalTopic ) );\n\t// Get the anchors with text that has the same content words as the keyphrase/synonyms.\n\tanchors = getAnchorsWithSameTextAsTopic( anchors, topicForms, locale, customHelpers, isExactMatchRequested, areHyphensWordBoundaries );\n\n\treturn {\n\t\tanchorsWithKeyphrase: anchors,\n\t\tanchorsWithKeyphraseCount: anchors.length,\n\t};\n}\n\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,mBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,cAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,yBAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,IAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,iCAAA,GAAAT,OAAA;AAAwH,SAAAE,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExH,IAAIG,aAAa,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;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a,IAAI,IAAAC,iCAAwB,EAAED,aAAc,CAAE,CAAC;EAC9G;EACAvE,OAAO,GAAGiB,6BAA6B,CAAEjB,OAAO,EAAES,UAAU,EAAEC,MAAM,EAAEQ,aAAa,EAAEoD,qBAAqB,EAAElD,wBAAyB,CAAC;EAEtI,OAAO;IACNmC,oBAAoB,EAAEvD,OAAO;IAC7BwD,yBAAyB,EAAExD,OAAO,CAACuC;EACpC,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"getAnchorsWithKeyphrase.js","names":["flatten","uniq","filterWordsFromArray","findTopicFormsInString","getWords","matchTextWithArray","parseSynonyms","processExactMatchRequest","urlHelper","WORD_BOUNDARY_WITH_HYPHEN","WORD_BOUNDARY_WITHOUT_HYPHEN","functionWords","isLinkingToSelf","anchorLink","siteUrlOrDomain","Boolean","areEqual","isRelativeFragmentURL","getAnchorsLinkingToSelf","anchors","anchorsLinkingToSelf","map","anchor","attributes","href","filter","index","getAnchorsContainingTopic","topicForms","locale","matchWordCustomHelper","anchorsContainingTopic","anchorText","innerText","percentWordMatches","getAnchorsWithSameTextAsTopic","customHelpers","exactMatchRequest","areHyphensWordBoundaries","getWordsCustomHelper","keyphraseAndSynonymsWords","keyphraseForms","synonymsForms","forEach","form","push","anchorsContainedInTopic","currentAnchor","currentAnchorText","anchorWords","filteredAnchorWords","length","request","exactMatchRequested","every","anchorWord","keyphrase","includes","i","topicForm","count","paper","researcher","getConfig","result","anchorsWithKeyphrase","anchorsWithKeyphraseCount","getText","getKeyword","originalTopics","getSynonyms","getTree","findAll","treeNode","name","getPermalink","getLocale","getResearch","getHelper","isExactMatchRequested","originalTopic"],"sources":["../../../src/languageProcessing/researches/getAnchorsWithKeyphrase.js"],"sourcesContent":["import { flatten, uniq } from \"lodash\";\nimport filterWordsFromArray from \"../helpers/word/filterWordsFromArray\";\nimport { findTopicFormsInString } from \"../helpers/match/findKeywordFormsInString\";\nimport getWords from \"../helpers/word/getWords\";\nimport matchTextWithArray from \"../helpers/match/matchTextWithArray\";\nimport parseSynonyms from \"../helpers/sanitize/parseSynonyms\";\nimport processExactMatchRequest from \"../helpers/match/processExactMatchRequest\";\nimport urlHelper from \"../helpers/url/url.js\";\nimport { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from \"../../config/wordBoundariesWithoutPunctuation\";\n\nlet functionWords = [];\n\n/**\n * Checks whether the anchor's link is a relative fragment or the same as the site url/domain.\n * Relative fragment links always point to the page itself.\n *\n * @param {String} anchorLink The link anchor.\n * @param {String} siteUrlOrDomain The site URL or domain of the paper.\n *\n * @returns {boolean} Whether the anchor's link is a relative fragment or the same as the site url/domain.\n */\nfunction isLinkingToSelf( anchorLink, siteUrlOrDomain ) {\n\treturn Boolean( urlHelper.areEqual( anchorLink, siteUrlOrDomain ) || urlHelper.isRelativeFragmentURL( anchorLink ) );\n}\n\n/**\n * Gets the anchors whose url is not linking at the current site url/domain.\n *\n * @param {Array} anchors An array with all anchors from the paper.\n * @param {String} siteUrlOrDomain The site URL or domain of the paper.\n *\n * @returns {Array} The array of all anchors whose url is not linking at the current site url/domain.\n */\nfunction getAnchorsLinkingToSelf( anchors, siteUrlOrDomain ) {\n\tconst anchorsLinkingToSelf = anchors.map( function( anchor ) {\n\t\tconst anchorLink = anchor.attributes.href;\n\t\t// Return false if there is no href attribute.\n\t\treturn anchorLink ? isLinkingToSelf( anchorLink, siteUrlOrDomain ) : false;\n\t} );\n\n\treturn anchors.filter( ( anchor, index ) => ! anchorsLinkingToSelf[ index ] );\n}\n\n/**\n * Gets the anchors with text that contains all content words of the topic (i.e. keyphrase or synonyms).\n *\n * @param {Array} anchors An array with all anchors from the paper\n * @param {Object} topicForms The object with topicForms. It contains all forms of the keyphrase and synonyms.\n * @param {String} locale The locale of the paper.\n * @param {Function} matchWordCustomHelper The helper function to match word in text.\n *\n * @returns {String[]} The array of all anchors with text that contains all content words of the keyphrase or synonyms.\n */\nfunction getAnchorsContainingTopic( anchors, topicForms, locale, matchWordCustomHelper ) {\n\tconst anchorsContainingTopic = anchors.map( function( anchor ) {\n\t\t// Only retrieve the anchor's text. This is because we only use the anchor text for the following check.\n\t\tconst anchorText = anchor.innerText();\n\t\treturn findTopicFormsInString( topicForms, anchorText, true, locale, matchWordCustomHelper ).percentWordMatches === 100;\n\t} );\n\n\treturn anchors.filter( ( anchor, index ) => anchorsContainingTopic[ index ] );\n}\n\n/**\n * Gets the anchors with text that has the same content words as the keyphrase or synonyms.\n *\n * @param {Array} anchors \t\tAn array with all anchors from the paper.\n * @param {Object} topicForms \t\tThe object with topicForms. It contains all forms of the keyphrase and synonyms.\n * @param {string} locale \t\tThe locale of the paper.\n * @param {Object} customHelpers \t\tAn object containing custom helpers.\n * @param {Object[]} exactMatchRequest \t\tAn array of objects containing the keyphrase and information on whether\n * \t\t\t\t\t\t\t\t\t\t\t\t\tthe exact match has been requested.\n * @param {boolean}\t \tareHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {Array} The array of all anchors with text that has the same content words as the keyphrase/synonyms.\n */\nfunction getAnchorsWithSameTextAsTopic( anchors, topicForms, locale, customHelpers, exactMatchRequest, areHyphensWordBoundaries ) {\n\tconst matchWordCustomHelper = customHelpers.matchWordCustomHelper;\n\tconst getWordsCustomHelper = customHelpers.getWordsCustomHelper;\n\n\t// Prepare keyphrase and synonym forms for comparison with anchors.\n\tconst keyphraseAndSynonymsWords = [ flatten( topicForms.keyphraseForms ) ];\n\tconst synonymsForms = topicForms.synonymsForms;\n\tsynonymsForms.forEach( form => keyphraseAndSynonymsWords.push( flatten( form ) ) );\n\n\t// The variable that will save all the anchors with text that has the same content words as the keyphrase/synonyms.\n\tconst anchorsContainedInTopic = [];\n\n\tanchors.forEach( function( currentAnchor ) {\n\t\tconst currentAnchorText = currentAnchor.innerText();\n\n\t\t/*\n * For keyphrase matching, we want to split words on hyphens and en-dashes, except for languages where hyphens shouldn't\n * be treated as word boundaries. Currently, the latter only applies to Indonesian, where hyphens are used to create plural forms of nouns,\n * such as \"buku-buku\" being a plural form of \"buku\". We want to treat forms like \"buku-buku\" as one word, so we shouldn't\n * split words on hyphens in Indonesian.\n * For languages where hyphens are treated as word boundaries we pass a custom word boundary regex string to the getWords helper\n * that includes whitespaces, hyphens (u002d), and en-dashes (u2013). Otherwise, we pass a word boundary regex that only includes\n * whitespaces and en-dashes.\n */\n\t\tlet anchorWords;\n\t\tif ( getWordsCustomHelper ) {\n\t\t\tanchorWords = uniq( getWordsCustomHelper( currentAnchorText ) );\n\t\t} else if ( areHyphensWordBoundaries ) {\n\t\t\tanchorWords = uniq( getWords( currentAnchorText, WORD_BOUNDARY_WITH_HYPHEN ) );\n\t\t} else {\n\t\t\tanchorWords = uniq( getWords( currentAnchorText, WORD_BOUNDARY_WITHOUT_HYPHEN ) );\n\t\t}\n\n\t\t/*\n\t\t * Filter function words out of the anchor text.\n\t\t * If the anchor text contains only function words, we keep them.\n\t\t */\n\t\tconst filteredAnchorWords = filterWordsFromArray( anchorWords, functionWords );\n\t\tif ( filteredAnchorWords.length > 0 ) {\n\t\t\tanchorWords = filteredAnchorWords;\n\t\t}\n\n\t\texactMatchRequest.forEach( request => {\n\t\t\t/*\n\t\t\t * Check a) if the exact match is requested for the keyphrase, and\n\t\t\t * b) if every content word in the anchor text is included in the keyphrase or synonym.\n\t\t\t */\n\t\t\tif ( request.exactMatchRequested &&\n\t\t\t\tanchorWords.every( anchorWord => request.keyphrase.includes( anchorWord ) ) ) {\n\t\t\t\tanchorsContainedInTopic.push( true );\n\t\t\t}\n\t\t} );\n\n\t\t// Check if every word in the anchor text is also present in the keyphrase/synonym.\n\t\tfor ( let i = 0; i < keyphraseAndSynonymsWords.length; i++ ) {\n\t\t\tconst topicForm = keyphraseAndSynonymsWords[ i ];\n\n\t\t\tif ( anchorWords.every( anchorWord => matchTextWithArray( anchorWord, topicForm, locale, matchWordCustomHelper ).count > 0 ) ) {\n\t\t\t\tanchorsContainedInTopic.push( true );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn anchors.filter( ( anchor, index ) => anchorsContainedInTopic[ index ] );\n}\n\n/**\n * Checks whether the content words of the anchor text are the same as the content words of the keyphrase or synonym.\n * Also includes different word forms if the morphology is available.\n *\n * @param {Paper} paper The paper to research.\n * @param {Researcher} researcher The researcher to use.\n *\n * @returns {Object} The amount of anchor texts whose content words are the same as the keyphrase or synonyms' content words.\n */\nexport default function( paper, researcher ) {\n\tfunctionWords = researcher.getConfig( \"functionWords\" );\n\n\tconst areHyphensWordBoundaries = researcher.getConfig( \"areHyphensWordBoundaries\" );\n\n\tconst result = {\n\t\tanchorsWithKeyphrase: [],\n\t\tanchorsWithKeyphraseCount: 0,\n\t};\n\t// STEP 1.\n\t// If the paper's text is empty, return empty result.\n\tif ( paper.getText() === \"\" ) {\n\t\treturn result;\n\t}\n\n\t// STEP 2.\n\tconst keyphrase = paper.getKeyword();\n\t/*\n\t * If no keyphrase is set, return empty result.\n\t * This is a conscious decision where we won't assess the paper if the keyphrase is not set.\n\t * This includes a case where only the synonym is set but not the keyphrase.\n\t */\n\tif ( keyphrase === \"\" ) {\n\t\treturn result;\n\t}\n\t/*\n\t * When the keyphrase is set, also retrieve the synonyms and save them in \"topics\" array.\n\t * Eventually, the term topics here refers to either keyphrase or synonyms.\n\t */\n\tconst originalTopics = parseSynonyms( paper.getSynonyms() );\n\toriginalTopics.push( keyphrase );\n\n\t// Retrieve the anchors.\n\tlet anchors = paper.getTree().findAll( treeNode => treeNode.name === \"a\" );\n\t/*\n\t * We get the site's URL (e.g., https://yoast.com) or domain (e.g., yoast.com) from the paper.\n\t * In case of WordPress, the variable is a URL. In case of Shopify, it is a domain.\n\t */\n\tconst siteUrlOrDomain = paper.getPermalink();\n\n\t// STEP 3.\n\t// Get the anchors with urls that are not linking to the current site url/domain.\n\tanchors = getAnchorsLinkingToSelf( anchors, siteUrlOrDomain );\n\t// If all anchor urls are linking to the current site url/domain, return empty result.\n\tif ( anchors.length === 0 ) {\n\t\treturn result;\n\t}\n\n\tconst locale = paper.getLocale();\n\tconst topicForms = researcher.getResearch( \"morphology\" );\n\tconst customHelpers = {\n\t\tmatchWordCustomHelper: researcher.getHelper( \"matchWordCustomHelper\" ),\n\t\tgetWordsCustomHelper: researcher.getHelper( \"getWordsCustomHelper\" ),\n\t};\n\n\t// STEP 4.\n\t// Get the anchors with text that contains the keyphrase/synonyms' content words.\n\tanchors = getAnchorsContainingTopic( anchors, topicForms, locale, customHelpers.matchWordCustomHelper );\n\t// If all anchor texts do not contain the keyphrase/synonyms' content words, return empty result.\n\tif ( anchors.length === 0 ) {\n\t\treturn result;\n\t}\n\n\t// STEP 5.\n\t// Check if exact match is requested for every topic (keyphrase or synonym).\n\tconst isExactMatchRequested = originalTopics.map( originalTopic => processExactMatchRequest( originalTopic ) );\n\t// Get the anchors with text that has the same content words as the keyphrase/synonyms.\n\tanchors = getAnchorsWithSameTextAsTopic( anchors, topicForms, locale, customHelpers, isExactMatchRequested, areHyphensWordBoundaries );\n\n\treturn {\n\t\tanchorsWithKeyphrase: anchors,\n\t\tanchorsWithKeyphraseCount: anchors.length,\n\t};\n}\n\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AACtC,OAAOC,oBAAoB;AAC3B,SAASC,sBAAsB;AAC/B,OAAOC,QAAQ;AACf,OAAOC,kBAAkB;AACzB,OAAOC,aAAa;AACpB,OAAOC,wBAAwB;AAC/B,OAAOC,SAAS;AAChB,SAASC,yBAAyB,EAAEC,4BAA4B;AAEhE,IAAIC,aAAa,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAEC,UAAU,EAAEC,eAAe,EAAG;EACvD,OAAOC,OAAO,CAAEP,SAAS,CAACQ,QAAQ,CAAEH,UAAU,EAAEC,eAAgB,CAAC,IAAIN,SAAS,CAACS,qBAAqB,CAAEJ,UAAW,CAAE,CAAC;AACrH;;AAEA;AACA;AACA;A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@ -1,18 +1,11 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DIFFICULTY = void 0;
7
- exports.default = _default;
8
- var _stripNumbers = _interopRequireDefault(require("../helpers/sanitize/stripNumbers.js"));
9
- var _countSentences = _interopRequireDefault(require("../helpers/sentence/countSentences.js"));
10
- var _countWords = _interopRequireDefault(require("../helpers/word/countWords.js"));
11
- var _countSyllables = _interopRequireDefault(require("../helpers/syllables/countSyllables.js"));
12
- var _lodash = require("lodash");
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
1
  /** @module analyses/calculateFleschReading */
15
2
 
3
+ import stripNumbers from "../helpers/sanitize/stripNumbers.js";
4
+ import countSentences from "../helpers/sentence/countSentences.js";
5
+ import countWords from "../helpers/word/countWords.js";
6
+ import countSyllables from "../helpers/syllables/countSyllables.js";
7
+ import { clamp, inRange } from "lodash";
8
+
16
9
  /**
17
10
  * Calculates an average from a total and an amount
18
11
  *
@@ -29,7 +22,7 @@ const getAverage = function (total, amount) {
29
22
  * @readonly
30
23
  * @enum {number}
31
24
  */
32
- const DIFFICULTY = exports.DIFFICULTY = {
25
+ export const DIFFICULTY = {
33
26
  NO_DATA: -1,
34
27
  VERY_EASY: 0,
35
28
  EASY: 1,
@@ -52,15 +45,15 @@ const DIFFICULTY = exports.DIFFICULTY = {
52
45
  function getDifficulty(score, scoreConfiguration) {
53
46
  if (score >= scoreConfiguration.borders.veryEasy) {
54
47
  return DIFFICULTY.VERY_EASY;
55
- } else if ((0, _lodash.inRange)(score, scoreConfiguration.borders.easy, scoreConfiguration.borders.veryEasy)) {
48
+ } else if (inRange(score, scoreConfiguration.borders.easy, scoreConfiguration.borders.veryEasy)) {
56
49
  return DIFFICULTY.EASY;
57
- } else if ((0, _lodash.inRange)(score, scoreConfiguration.borders.fairlyEasy, scoreConfiguration.borders.easy)) {
50
+ } else if (inRange(score, scoreConfiguration.borders.fairlyEasy, scoreConfiguration.borders.easy)) {
58
51
  return DIFFICULTY.FAIRLY_EASY;
59
- } else if ((0, _lodash.inRange)(score, scoreConfiguration.borders.okay, scoreConfiguration.borders.fairlyEasy)) {
52
+ } else if (inRange(score, scoreConfiguration.borders.okay, scoreConfiguration.borders.fairlyEasy)) {
60
53
  return DIFFICULTY.OKAY;
61
- } else if ((0, _lodash.inRange)(score, scoreConfiguration.borders.fairlyDifficult, scoreConfiguration.borders.okay)) {
54
+ } else if (inRange(score, scoreConfiguration.borders.fairlyDifficult, scoreConfiguration.borders.okay)) {
62
55
  return DIFFICULTY.FAIRLY_DIFFICULT;
63
- } else if ((0, _lodash.inRange)(score, scoreConfiguration.borders.difficult, scoreConfiguration.borders.fairlyDifficult)) {
56
+ } else if (inRange(score, scoreConfiguration.borders.difficult, scoreConfiguration.borders.fairlyDifficult)) {
64
57
  return DIFFICULTY.DIFFICULT;
65
58
  }
66
59
  return DIFFICULTY.VERY_DIFFICULT;
@@ -107,7 +100,7 @@ function getConfiguration(researcher) {
107
100
  *
108
101
  * @returns {{ score: number, difficulty: DIFFICULTY }} The Flesch reading score.
109
102
  */
110
- function _default(paper, researcher) {
103
+ export default function (paper, researcher) {
111
104
  const syllables = researcher.getConfig("syllables");
112
105
  const memoizedTokenizer = researcher.getHelper("memoizedTokenizer");
113
106
  const languageSpecificConfiguration = getConfiguration(researcher);
@@ -119,9 +112,9 @@ function _default(paper, researcher) {
119
112
  difficulty: DIFFICULTY.NO_DATA
120
113
  };
121
114
  }
122
- text = (0, _stripNumbers.default)(text);
123
- const numberOfSentences = (0, _countSentences.default)(text, memoizedTokenizer);
124
- const numberOfWords = (0, _countWords.default)(text);
115
+ text = stripNumbers(text);
116
+ const numberOfSentences = countSentences(text, memoizedTokenizer);
117
+ const numberOfWords = countWords(text);
125
118
 
126
119
  // Do not show the Flesch reading ease when there is not enough data for the FRE to make sense. Also used to prevent division by zero errors.
127
120
  // A score of -1 signals to the code down the line that no valid FRE was calculated.
@@ -131,7 +124,7 @@ function _default(paper, researcher) {
131
124
  difficulty: DIFFICULTY.NO_DATA
132
125
  };
133
126
  }
134
- const numberOfSyllables = (0, _countSyllables.default)(text, syllables);
127
+ const numberOfSyllables = countSyllables(text, syllables);
135
128
  const averageWordsPerSentence = getAverage(numberOfWords, numberOfSentences);
136
129
  const syllablesPer100Words = numberOfSyllables * (100 / numberOfWords);
137
130
  const statistics = {
@@ -142,7 +135,7 @@ function _default(paper, researcher) {
142
135
  syllablesPer100Words
143
136
  };
144
137
  const getScore = researcher.getHelper("fleschReadingScore");
145
- const score = (0, _lodash.clamp)(getScore(statistics), 0, 100);
138
+ const score = clamp(getScore(statistics), 0, 100);
146
139
  const difficulty = getDifficulty(score, languageSpecificConfiguration);
147
140
  return {
148
141
  score,
@@ -1 +1 @@
1
- {"version":3,"file":"getFleschReadingScore.js","names":["_stripNumbers","_interopRequireDefault","require","_countSentences","_countWords","_countSyllables","_lodash","e","__esModule","default","getAverage","total","amount","DIFFICULTY","exports","NO_DATA","VERY_EASY","EASY","FAIRLY_EASY","OKAY","FAIRLY_DIFFICULT","DIFFICULT","VERY_DIFFICULT","getDifficulty","score","scoreConfiguration","borders","veryEasy","inRange","easy","fairlyEasy","okay","fairlyDifficult","difficult","getConfiguration","researcher","languageSpecificConfig","getConfig","defaultConfig","veryDifficult","scores","_default","paper","syllables","memoizedTokenizer","getHelper","languageSpecificConfiguration","text","getText","difficulty","stripNumbers","numberOfSentences","countSentences","numberOfWords","countWords","numberOfSyllables","countSyllables","averageWordsPerSentence","syllablesPer100Words","statistics","getScore","clamp"],"sources":["../../../src/languageProcessing/researches/getFleschReadingScore.js"],"sourcesContent":["/** @module analyses/calculateFleschReading */\n\nimport stripNumbers from \"../helpers/sanitize/stripNumbers.js\";\nimport countSentences from \"../helpers/sentence/countSentences.js\";\nimport countWords from \"../helpers/word/countWords.js\";\nimport countSyllables from \"../helpers/syllables/countSyllables.js\";\nimport { clamp, inRange } from \"lodash\";\n\n/**\n * Calculates an average from a total and an amount\n *\n * @param {number} total The total.\n * @param {number} amount The amount.\n * @returns {number} The average from the total and the amount.\n */\nconst getAverage = function( total, amount ) {\n\treturn total / amount;\n};\n\n/**\n * The Flesch reading ease difficulty.\n * @readonly\n * @enum {number}\n */\nexport const DIFFICULTY = {\n\tNO_DATA: -1,\n\tVERY_EASY: 0,\n\tEASY: 1,\n\tFAIRLY_EASY: 2,\n\tOKAY: 3,\n\tFAIRLY_DIFFICULT: 4,\n\tDIFFICULT: 5,\n\tVERY_DIFFICULT: 6,\n};\n\n/**\n * Returns the Flesch reading ease difficulty based on the boundaries\n * defined in the score configuration.\n *\n * @param {number} score The Flesch reading ease score.\n * @param {Object} scoreConfiguration The score configuration.\n *\n * @returns {DIFFICULTY} The Flesch reading ease difficulty.\n */\nfunction getDifficulty( score, scoreConfiguration ) {\n\tif ( score >= scoreConfiguration.borders.veryEasy ) {\n\t\treturn DIFFICULTY.VERY_EASY;\n\t} else if ( inRange( score, scoreConfiguration.borders.easy, scoreConfiguration.borders.veryEasy ) ) {\n\t\treturn DIFFICULTY.EASY;\n\t} else if ( inRange( score, scoreConfiguration.borders.fairlyEasy, scoreConfiguration.borders.easy ) ) {\n\t\treturn DIFFICULTY.FAIRLY_EASY;\n\t} else if ( inRange( score, scoreConfiguration.borders.okay, scoreConfiguration.borders.fairlyEasy ) ) {\n\t\treturn DIFFICULTY.OKAY;\n\t} else if ( inRange( score, scoreConfiguration.borders.fairlyDifficult, scoreConfiguration.borders.okay ) ) {\n\t\treturn DIFFICULTY.FAIRLY_DIFFICULT;\n\t} else if ( inRange( score, scoreConfiguration.borders.difficult, scoreConfiguration.borders.fairlyDifficult ) ) {\n\t\treturn DIFFICULTY.DIFFICULT;\n\t}\n\n\treturn DIFFICULTY.VERY_DIFFICULT;\n}\n\n/**\n * Retrieves the scoring configuration defining the boundaries to use to\n * determine the Flesch reading ease difficulty.\n *\n * @param {Researcher} researcher The researcher.\n *\n * @returns {Object} The language specific scoring configuration, or the default configuration if not available.\n */\nfunction getConfiguration( researcher ) {\n\tconst languageSpecificConfig = researcher.getConfig( \"fleschReadingEaseScores\" );\n\tconst defaultConfig = {\n\t\tborders: {\n\t\t\tveryEasy: 90,\n\t\t\teasy: 80,\n\t\t\tfairlyEasy: 70,\n\t\t\tokay: 60,\n\t\t\tfairlyDifficult: 50,\n\t\t\tdifficult: 30,\n\t\t\tveryDifficult: 0,\n\t\t},\n\t\tscores: {\n\t\t\tveryEasy: 9,\n\t\t\teasy: 9,\n\t\t\tfairlyEasy: 9,\n\t\t\tokay: 9,\n\t\t\tfairlyDifficult: 6,\n\t\t\tdifficult: 3,\n\t\t\tveryDifficult: 3,\n\t\t},\n\t};\n\treturn languageSpecificConfig ? languageSpecificConfig : defaultConfig;\n}\n\n/**\n * This calculates the Flesch reading score for a given text.\n *\n * @param {Paper} paper The paper containing the text.\n * @param {Researcher} researcher The researcher.\n *\n * @returns {{ score: number, difficulty: DIFFICULTY }} The Flesch reading score.\n */\nexport default function( paper, researcher ) {\n\tconst syllables = researcher.getConfig( \"syllables\" );\n\tconst memoizedTokenizer = researcher.getHelper( \"memoizedTokenizer\" );\n\tconst languageSpecificConfiguration = getConfiguration( researcher );\n\n\tlet text = paper.getText();\n\tif ( text === \"\" ) {\n\t\t// A score of -1 signals to the code down the line that no valid FRE was calculated.\n\t\treturn {\n\t\t\tscore: -1,\n\t\t\tdifficulty: DIFFICULTY.NO_DATA,\n\t\t};\n\t}\n\n\ttext = stripNumbers( text );\n\n\tconst numberOfSentences = countSentences( text, memoizedTokenizer );\n\tconst numberOfWords = countWords( text );\n\n\t// Do not show the Flesch reading ease when there is not enough data for the FRE to make sense. Also used to prevent division by zero errors.\n\t// A score of -1 signals to the code down the line that no valid FRE was calculated.\n\tif ( numberOfSentences < 1 || numberOfWords <= 10 ) {\n\t\treturn {\n\t\t\tscore: -1,\n\t\t\tdifficulty: DIFFICULTY.NO_DATA,\n\t\t};\n\t}\n\n\tconst numberOfSyllables = countSyllables( text, syllables );\n\tconst averageWordsPerSentence = getAverage( numberOfWords, numberOfSentences );\n\tconst syllablesPer100Words = numberOfSyllables * ( 100 / numberOfWords );\n\tconst statistics = {\n\t\tnumberOfSentences,\n\t\tnumberOfWords,\n\t\tnumberOfSyllables,\n\t\taverageWordsPerSentence,\n\t\tsyllablesPer100Words,\n\t};\n\n\tconst getScore = researcher.getHelper( \"fleschReadingScore\" );\n\n\tconst score = clamp( getScore( statistics ), 0, 100 );\n\n\tconst difficulty = getDifficulty( score, languageSpecificConfiguration );\n\n\treturn { score, difficulty };\n}\n"],"mappings":";;;;;;;AAEA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAwC,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AANxC;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,UAAU,GAAG,SAAAA,CAAUC,KAAK,EAAEC,MAAM,EAAG;EAC5C,OAAOD,KAAK,GAAGC,MAAM;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACzBE,OAAO,EAAE,CAAC,CAAC;EACXC,SAAS,EAAE,CAAC;EACZC,IAAI,EAAE,CAAC;EACPC,WAAW,EAAE,CAAC;EACdC,IAAI,EAAE,CAAC;EACPC,gBAAgB,EAAE,CAAC;EACnBC,SAAS,EAAE,CAAC;EACZC,cAAc,EAAE;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAAEC,KAAK,EAAEC,kBAAkB,EAAG;EACnD,IAAKD,KAAK,IAAIC,kBAAkB,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,iBAAiB,GAAG,IAAAC,uBAAc,EAAET,IAAI,EAAEJ,SAAU,CAAC;EAC3D,MAAMc,uBAAuB,GAAG/C,UAAU,CAAE2C,aAAa,EAAEF,iBAAkB,CAAC;EAC9E,MAAMO,oBAAoB,GAAGH,iBAAiB,IAAK,GAAG,GAAGF,aAAa,CAAE;EACxE,MAAMM,UAAU,GAAG;IAClBR,iBAAiB;IACjBE,aAAa;IACbE,iBAAiB;IACjBE,uBAAuB;IACvBC;EACD,CAAC;EAED,MAAME,QAAQ,GAAGzB,UAAU,CAACU,SAAS,CAAE,oBAAqB,CAAC;EAE7D,MAAMrB,KAAK,GAAG,IAAAqC,aAAK,EAAED,QAAQ,CAAED,UAAW,CAAC,EAAE,CAAC,EAAE,GAAI,CAAC;EAErD,MAAMV,UAAU,GAAG1B,aAAa,CAAEC,KAAK,EAAEsB,6BAA8B,CAAC;EAExE,OAAO;IAAEtB,KAAK;IAAEyB;EAAW,CAAC;AAC7B","ignoreList":[]}
1
+ {"version":3,"file":"getFleschReadingScore.js","names":["stripNumbers","countSentences","countWords","countSyllables","clamp","inRange","getAverage","total","amount","DIFFICULTY","NO_DATA","VERY_EASY","EASY","FAIRLY_EASY","OKAY","FAIRLY_DIFFICULT","DIFFICULT","VERY_DIFFICULT","getDifficulty","score","scoreConfiguration","borders","veryEasy","easy","fairlyEasy","okay","fairlyDifficult","difficult","getConfiguration","researcher","languageSpecificConfig","getConfig","defaultConfig","veryDifficult","scores","paper","syllables","memoizedTokenizer","getHelper","languageSpecificConfiguration","text","getText","difficulty","numberOfSentences","numberOfWords","numberOfSyllables","averageWordsPerSentence","syllablesPer100Words","statistics","getScore"],"sources":["../../../src/languageProcessing/researches/getFleschReadingScore.js"],"sourcesContent":["/** @module analyses/calculateFleschReading */\n\nimport stripNumbers from \"../helpers/sanitize/stripNumbers.js\";\nimport countSentences from \"../helpers/sentence/countSentences.js\";\nimport countWords from \"../helpers/word/countWords.js\";\nimport countSyllables from \"../helpers/syllables/countSyllables.js\";\nimport { clamp, inRange } from \"lodash\";\n\n/**\n * Calculates an average from a total and an amount\n *\n * @param {number} total The total.\n * @param {number} amount The amount.\n * @returns {number} The average from the total and the amount.\n */\nconst getAverage = function( total, amount ) {\n\treturn total / amount;\n};\n\n/**\n * The Flesch reading ease difficulty.\n * @readonly\n * @enum {number}\n */\nexport const DIFFICULTY = {\n\tNO_DATA: -1,\n\tVERY_EASY: 0,\n\tEASY: 1,\n\tFAIRLY_EASY: 2,\n\tOKAY: 3,\n\tFAIRLY_DIFFICULT: 4,\n\tDIFFICULT: 5,\n\tVERY_DIFFICULT: 6,\n};\n\n/**\n * Returns the Flesch reading ease difficulty based on the boundaries\n * defined in the score configuration.\n *\n * @param {number} score The Flesch reading ease score.\n * @param {Object} scoreConfiguration The score configuration.\n *\n * @returns {DIFFICULTY} The Flesch reading ease difficulty.\n */\nfunction getDifficulty( score, scoreConfiguration ) {\n\tif ( score >= scoreConfiguration.borders.veryEasy ) {\n\t\treturn DIFFICULTY.VERY_EASY;\n\t} else if ( inRange( score, scoreConfiguration.borders.easy, scoreConfiguration.borders.veryEasy ) ) {\n\t\treturn DIFFICULTY.EASY;\n\t} else if ( inRange( score, scoreConfiguration.borders.fairlyEasy, scoreConfiguration.borders.easy ) ) {\n\t\treturn DIFFICULTY.FAIRLY_EASY;\n\t} else if ( inRange( score, scoreConfiguration.borders.okay, scoreConfiguration.borders.fairlyEasy ) ) {\n\t\treturn DIFFICULTY.OKAY;\n\t} else if ( inRange( score, scoreConfiguration.borders.fairlyDifficult, scoreConfiguration.borders.okay ) ) {\n\t\treturn DIFFICULTY.FAIRLY_DIFFICULT;\n\t} else if ( inRange( score, scoreConfiguration.borders.difficult, scoreConfiguration.borders.fairlyDifficult ) ) {\n\t\treturn DIFFICULTY.DIFFICULT;\n\t}\n\n\treturn DIFFICULTY.VERY_DIFFICULT;\n}\n\n/**\n * Retrieves the scoring configuration defining the boundaries to use to\n * determine the Flesch reading ease difficulty.\n *\n * @param {Researcher} researcher The researcher.\n *\n * @returns {Object} The language specific scoring configuration, or the default configuration if not available.\n */\nfunction getConfiguration( researcher ) {\n\tconst languageSpecificConfig = researcher.getConfig( \"fleschReadingEaseScores\" );\n\tconst defaultConfig = {\n\t\tborders: {\n\t\t\tveryEasy: 90,\n\t\t\teasy: 80,\n\t\t\tfairlyEasy: 70,\n\t\t\tokay: 60,\n\t\t\tfairlyDifficult: 50,\n\t\t\tdifficult: 30,\n\t\t\tveryDifficult: 0,\n\t\t},\n\t\tscores: {\n\t\t\tveryEasy: 9,\n\t\t\teasy: 9,\n\t\t\tfairlyEasy: 9,\n\t\t\tokay: 9,\n\t\t\tfairlyDifficult: 6,\n\t\t\tdifficult: 3,\n\t\t\tveryDifficult: 3,\n\t\t},\n\t};\n\treturn languageSpecificConfig ? languageSpecificConfig : defaultConfig;\n}\n\n/**\n * This calculates the Flesch reading score for a given text.\n *\n * @param {Paper} paper The paper containing the text.\n * @param {Researcher} researcher The researcher.\n *\n * @returns {{ score: number, difficulty: DIFFICULTY }} The Flesch reading score.\n */\nexport default function( paper, researcher ) {\n\tconst syllables = researcher.getConfig( \"syllables\" );\n\tconst memoizedTokenizer = researcher.getHelper( \"memoizedTokenizer\" );\n\tconst languageSpecificConfiguration = getConfiguration( researcher );\n\n\tlet text = paper.getText();\n\tif ( text === \"\" ) {\n\t\t// A score of -1 signals to the code down the line that no valid FRE was calculated.\n\t\treturn {\n\t\t\tscore: -1,\n\t\t\tdifficulty: DIFFICULTY.NO_DATA,\n\t\t};\n\t}\n\n\ttext = stripNumbers( text );\n\n\tconst numberOfSentences = countSentences( text, memoizedTokenizer );\n\tconst numberOfWords = countWords( text );\n\n\t// Do not show the Flesch reading ease when there is not enough data for the FRE to make sense. Also used to prevent division by zero errors.\n\t// A score of -1 signals to the code down the line that no valid FRE was calculated.\n\tif ( numberOfSentences < 1 || numberOfWords <= 10 ) {\n\t\treturn {\n\t\t\tscore: -1,\n\t\t\tdifficulty: DIFFICULTY.NO_DATA,\n\t\t};\n\t}\n\n\tconst numberOfSyllables = countSyllables( text, syllables );\n\tconst averageWordsPerSentence = getAverage( numberOfWords, numberOfSentences );\n\tconst syllablesPer100Words = numberOfSyllables * ( 100 / numberOfWords );\n\tconst statistics = {\n\t\tnumberOfSentences,\n\t\tnumberOfWords,\n\t\tnumberOfSyllables,\n\t\taverageWordsPerSentence,\n\t\tsyllablesPer100Words,\n\t};\n\n\tconst getScore = researcher.getHelper( \"fleschReadingScore\" );\n\n\tconst score = clamp( getScore( statistics ), 0, 100 );\n\n\tconst difficulty = getDifficulty( score, languageSpecificConfiguration );\n\n\treturn { score, difficulty };\n}\n"],"mappings":"AAAA;;AAEA,OAAOA,YAAY;AACnB,OAAOC,cAAc;AACrB,OAAOC,UAAU;AACjB,OAAOC,cAAc;AACrB,SAASC,KAAK,EAAEC,OAAO,QAAQ,QAAQ;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,SAAAA,CAAUC,KAAK,EAAEC,MAAM,EAAG;EAC5C,OAAOD,KAAK,GAAGC,MAAM;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG;EACzBC,OAAO,EAAE,CAAC,CAAC;EACXC,SAAS,EAAE,CAAC;EACZC,IAAI,EAAE,CAAC;EACPC,WAAW,EAAE,CAAC;EACdC,IAAI,EAAE,CAAC;EACPC,gBAAgB,EAAE,CAAC;EACnBC,SAAS,EAAE,CAAC;EACZC,cAAc,EAAE;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAAEC,KAAK,EAAEC,kBAAkB,EAAG;EACnD,IAAKD,KAAK,IAAIC,kBAAkB,CAACC,OAAO,CAACC,QAAQ,EAAG;IACnD,OAAOb,UAAU,CAACE,SAAS;EAC5B,CAAC,MAAM,IAAKN,OAAO,CAAEc,KAAK,EAAEC,kBAAkB,CAACC,OAAO,CAACE,IAAI,EAAEH,kBA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AAU,GAAG;IAClBL,iBAAiB;IACjBC,aAAa;IACbC,iBAAiB;IACjBC,uBAAuB;IACvBC;EACD,CAAC;EAED,MAAME,QAAQ,GAAGpB,UAAU,CAACS,SAAS,CAAE,oBAAqB,CAAC;EAE7D,MAAMnB,KAAK,GAAGf,KAAK,CAAE6C,QAAQ,CAAED,UAAW,CAAC,EAAE,CAAC,EAAE,GAAI,CAAC;EAErD,MAAMN,UAAU,GAAGxB,aAAa,CAAEC,KAAK,EAAEoB,6BAA8B,CAAC;EAExE,OAAO;IAAEpB,KAAK;IAAEuB;EAAW,CAAC;AAC7B","ignoreList":[]}
@@ -1,12 +1,5 @@
1
- "use strict";
1
+ import countWords from "../helpers/word/countWords";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = getKeyphraseDensity;
7
- exports.getKeywordDensity = getKeywordDensity;
8
- var _getAllWordsFromTree = _interopRequireDefault(require("../helpers/word/getAllWordsFromTree"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
3
  /**
11
4
  * Calculates the keyphrase density.
12
5
  *
@@ -15,20 +8,20 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
15
8
  *
16
9
  * @returns {number} The keyphrase density.
17
10
  */
18
- function getKeyphraseDensity(paper, researcher) {
19
- const getWordsCustomHelper = researcher.getHelper("getWordsCustomHelper");
11
+ export default function getKeyphraseDensity(paper, researcher) {
12
+ const getWordsCustomHelper = researcher.getHelper('getWordsCustomHelper');
20
13
  let wordCount = 0;
21
14
 
22
15
  // If there is a custom getWords helper, use its output for countWords.
23
16
  if (getWordsCustomHelper) {
24
17
  wordCount = getWordsCustomHelper(paper.getText()).length;
25
18
  } else {
26
- wordCount = (0, _getAllWordsFromTree.default)(paper).length;
19
+ wordCount = countWords(paper.getText());
27
20
  }
28
21
  if (wordCount === 0) {
29
22
  return 0;
30
23
  }
31
- const keyphraseCount = researcher.getResearch("getKeyphraseCount");
24
+ const keyphraseCount = researcher.getResearch('getKeyphraseCount');
32
25
  return keyphraseCount.count / wordCount * 100;
33
26
  }
34
27
 
@@ -42,8 +35,8 @@ function getKeyphraseDensity(paper, researcher) {
42
35
  *
43
36
  * @returns {number} The keyphrase density.
44
37
  */
45
- function getKeywordDensity(paper, researcher) {
46
- console.warn("This function is deprecated, use getKeyphraseDensity instead.");
38
+ export function getKeywordDensity(paper, researcher) {
39
+ console.warn('This function is deprecated, use getKeyphraseDensity instead.');
47
40
  return getKeyphraseDensity(paper, researcher);
48
41
  }
49
42
  //# sourceMappingURL=getKeywordDensity.js.map