axyseo 2.0.0-alpha.0.0.9 → 2.0.0-alpha.2

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 (269) hide show
  1. package/build/languageProcessing/helpers/highlighting/getMarkingsInSentence.js +1 -1
  2. package/build/languageProcessing/helpers/highlighting/getMarkingsInSentence.js.map +1 -1
  3. package/build/languageProcessing/helpers/morphology/buildTopicStems.js +1 -1
  4. package/build/languageProcessing/helpers/morphology/buildTopicStems.js.map +1 -1
  5. package/build/languageProcessing/helpers/morphology/getAllWordsFromPaper.js +1 -1
  6. package/build/languageProcessing/helpers/morphology/getAllWordsFromPaper.js.map +1 -1
  7. package/build/languageProcessing/languages/_default/Researcher.js +1 -1
  8. package/build/languageProcessing/languages/_default/Researcher.js.map +1 -1
  9. package/build/languageProcessing/languages/_default/helpers/getStemmer.js +1 -1
  10. package/build/languageProcessing/languages/_default/helpers/getStemmer.js.map +1 -1
  11. package/build/languageProcessing/languages/ar/Researcher.js +1 -1
  12. package/build/languageProcessing/languages/ar/Researcher.js.map +1 -1
  13. package/build/languageProcessing/languages/ar/helpers/getStemmer.js +1 -1
  14. package/build/languageProcessing/languages/ar/helpers/getStemmer.js.map +1 -1
  15. package/build/languageProcessing/languages/ar/helpers/isPassiveSentence.js +1 -1
  16. package/build/languageProcessing/languages/ar/helpers/isPassiveSentence.js.map +1 -1
  17. package/build/languageProcessing/languages/ca/Researcher.js +1 -1
  18. package/build/languageProcessing/languages/ca/Researcher.js.map +1 -1
  19. package/build/languageProcessing/languages/ca/helpers/getStemmer.js +1 -1
  20. package/build/languageProcessing/languages/ca/helpers/getStemmer.js.map +1 -1
  21. package/build/languageProcessing/languages/cs/Researcher.js +1 -1
  22. package/build/languageProcessing/languages/cs/Researcher.js.map +1 -1
  23. package/build/languageProcessing/languages/cs/helpers/getClauses.js +1 -1
  24. package/build/languageProcessing/languages/cs/helpers/getClauses.js.map +1 -1
  25. package/build/languageProcessing/languages/cs/helpers/getStemmer.js +1 -1
  26. package/build/languageProcessing/languages/cs/helpers/getStemmer.js.map +1 -1
  27. package/build/languageProcessing/languages/cs/helpers/internal/getParticiples.js +1 -1
  28. package/build/languageProcessing/languages/cs/helpers/internal/getParticiples.js.map +1 -1
  29. package/build/languageProcessing/languages/cs/values/Clause.js +1 -1
  30. package/build/languageProcessing/languages/cs/values/Clause.js.map +1 -1
  31. package/build/languageProcessing/languages/de/Researcher.js +1 -1
  32. package/build/languageProcessing/languages/de/Researcher.js.map +1 -1
  33. package/build/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js +1 -1
  34. package/build/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js.map +1 -1
  35. package/build/languageProcessing/languages/de/helpers/getClauses.js +1 -1
  36. package/build/languageProcessing/languages/de/helpers/getClauses.js.map +1 -1
  37. package/build/languageProcessing/languages/de/helpers/getStemmer.js +1 -1
  38. package/build/languageProcessing/languages/de/helpers/getStemmer.js.map +1 -1
  39. package/build/languageProcessing/languages/de/helpers/internal/determineStem.js +1 -1
  40. package/build/languageProcessing/languages/de/helpers/internal/determineStem.js.map +1 -1
  41. package/build/languageProcessing/languages/de/helpers/internal/getParticiples.js +1 -1
  42. package/build/languageProcessing/languages/de/helpers/internal/getParticiples.js.map +1 -1
  43. package/build/languageProcessing/languages/de/values/Clause.js +1 -1
  44. package/build/languageProcessing/languages/de/values/Clause.js.map +1 -1
  45. package/build/languageProcessing/languages/el/Researcher.js +1 -1
  46. package/build/languageProcessing/languages/el/Researcher.js.map +1 -1
  47. package/build/languageProcessing/languages/el/helpers/getClauses.js +1 -1
  48. package/build/languageProcessing/languages/el/helpers/getClauses.js.map +1 -1
  49. package/build/languageProcessing/languages/el/helpers/getStemmer.js +1 -1
  50. package/build/languageProcessing/languages/el/helpers/getStemmer.js.map +1 -1
  51. package/build/languageProcessing/languages/el/helpers/internal/getParticiples.js +1 -1
  52. package/build/languageProcessing/languages/el/helpers/internal/getParticiples.js.map +1 -1
  53. package/build/languageProcessing/languages/el/helpers/isPassiveSentence.js +1 -1
  54. package/build/languageProcessing/languages/el/helpers/isPassiveSentence.js.map +1 -1
  55. package/build/languageProcessing/languages/el/values/Clause.js +1 -1
  56. package/build/languageProcessing/languages/el/values/Clause.js.map +1 -1
  57. package/build/languageProcessing/languages/en/Researcher.js +1 -1
  58. package/build/languageProcessing/languages/en/Researcher.js.map +1 -1
  59. package/build/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js +1 -1
  60. package/build/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js.map +1 -1
  61. package/build/languageProcessing/languages/en/helpers/getClauses.js +1 -1
  62. package/build/languageProcessing/languages/en/helpers/getClauses.js.map +1 -1
  63. package/build/languageProcessing/languages/en/helpers/getStemmer.js +1 -1
  64. package/build/languageProcessing/languages/en/helpers/getStemmer.js.map +1 -1
  65. package/build/languageProcessing/languages/en/helpers/internal/determineStem.js +1 -1
  66. package/build/languageProcessing/languages/en/helpers/internal/determineStem.js.map +1 -1
  67. package/build/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js +1 -1
  68. package/build/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js.map +1 -1
  69. package/build/languageProcessing/languages/en/helpers/internal/getParticiples.js +1 -1
  70. package/build/languageProcessing/languages/en/helpers/internal/getParticiples.js.map +1 -1
  71. package/build/languageProcessing/languages/en/helpers/internal/getVerbStem.js +1 -1
  72. package/build/languageProcessing/languages/en/helpers/internal/getVerbStem.js.map +1 -1
  73. package/build/languageProcessing/languages/en/values/Clause.js +1 -1
  74. package/build/languageProcessing/languages/en/values/Clause.js.map +1 -1
  75. package/build/languageProcessing/languages/es/Researcher.js +1 -1
  76. package/build/languageProcessing/languages/es/Researcher.js.map +1 -1
  77. package/build/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js +1 -1
  78. package/build/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js.map +1 -1
  79. package/build/languageProcessing/languages/es/helpers/getClauses.js +1 -1
  80. package/build/languageProcessing/languages/es/helpers/getClauses.js.map +1 -1
  81. package/build/languageProcessing/languages/es/helpers/getStemmer.js +1 -1
  82. package/build/languageProcessing/languages/es/helpers/getStemmer.js.map +1 -1
  83. package/build/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js +3 -3
  84. package/build/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js.map +1 -1
  85. package/build/languageProcessing/languages/es/helpers/internal/getParticiples.js +1 -1
  86. package/build/languageProcessing/languages/es/helpers/internal/getParticiples.js.map +1 -1
  87. package/build/languageProcessing/languages/es/helpers/internal/stem.js +1 -1
  88. package/build/languageProcessing/languages/es/helpers/internal/stem.js.map +1 -1
  89. package/build/languageProcessing/languages/es/values/Clause.js +1 -1
  90. package/build/languageProcessing/languages/es/values/Clause.js.map +1 -1
  91. package/build/languageProcessing/languages/fa/Researcher.js +1 -1
  92. package/build/languageProcessing/languages/fa/Researcher.js.map +1 -1
  93. package/build/languageProcessing/languages/fa/helpers/createBasicWordForms.js +1 -1
  94. package/build/languageProcessing/languages/fa/helpers/createBasicWordForms.js.map +1 -1
  95. package/build/languageProcessing/languages/fa/helpers/getStemmer.js +1 -1
  96. package/build/languageProcessing/languages/fa/helpers/getStemmer.js.map +1 -1
  97. package/build/languageProcessing/languages/fa/helpers/isPassiveSentence.js +1 -1
  98. package/build/languageProcessing/languages/fa/helpers/isPassiveSentence.js.map +1 -1
  99. package/build/languageProcessing/languages/fr/Researcher.js +1 -1
  100. package/build/languageProcessing/languages/fr/Researcher.js.map +1 -1
  101. package/build/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js +1 -1
  102. package/build/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js.map +1 -1
  103. package/build/languageProcessing/languages/fr/helpers/getClauses.js +1 -1
  104. package/build/languageProcessing/languages/fr/helpers/getClauses.js.map +1 -1
  105. package/build/languageProcessing/languages/fr/helpers/getStemmer.js +1 -1
  106. package/build/languageProcessing/languages/fr/helpers/getStemmer.js.map +1 -1
  107. package/build/languageProcessing/languages/fr/helpers/internal/getParticiples.js +1 -1
  108. package/build/languageProcessing/languages/fr/helpers/internal/getParticiples.js.map +1 -1
  109. package/build/languageProcessing/languages/fr/helpers/internal/stem.js +1 -1
  110. package/build/languageProcessing/languages/fr/helpers/internal/stem.js.map +1 -1
  111. package/build/languageProcessing/languages/fr/values/Clause.js +1 -1
  112. package/build/languageProcessing/languages/fr/values/Clause.js.map +1 -1
  113. package/build/languageProcessing/languages/he/Researcher.js +1 -1
  114. package/build/languageProcessing/languages/he/Researcher.js.map +1 -1
  115. package/build/languageProcessing/languages/he/helpers/getStemmer.js +1 -1
  116. package/build/languageProcessing/languages/he/helpers/getStemmer.js.map +1 -1
  117. package/build/languageProcessing/languages/he/helpers/isPassiveSentence.js +1 -1
  118. package/build/languageProcessing/languages/he/helpers/isPassiveSentence.js.map +1 -1
  119. package/build/languageProcessing/languages/hu/Researcher.js +1 -1
  120. package/build/languageProcessing/languages/hu/Researcher.js.map +1 -1
  121. package/build/languageProcessing/languages/hu/helpers/getClauses.js +1 -1
  122. package/build/languageProcessing/languages/hu/helpers/getClauses.js.map +1 -1
  123. package/build/languageProcessing/languages/hu/helpers/getStemmer.js +1 -1
  124. package/build/languageProcessing/languages/hu/helpers/getStemmer.js.map +1 -1
  125. package/build/languageProcessing/languages/hu/helpers/internal/getParticiples.js +1 -1
  126. package/build/languageProcessing/languages/hu/helpers/internal/getParticiples.js.map +1 -1
  127. package/build/languageProcessing/languages/hu/helpers/isPassiveSentence.js +1 -1
  128. package/build/languageProcessing/languages/hu/helpers/isPassiveSentence.js.map +1 -1
  129. package/build/languageProcessing/languages/hu/values/Clause.js +1 -1
  130. package/build/languageProcessing/languages/hu/values/Clause.js.map +1 -1
  131. package/build/languageProcessing/languages/id/Researcher.js +1 -1
  132. package/build/languageProcessing/languages/id/Researcher.js.map +1 -1
  133. package/build/languageProcessing/languages/id/helpers/getStemmer.js +1 -1
  134. package/build/languageProcessing/languages/id/helpers/getStemmer.js.map +1 -1
  135. package/build/languageProcessing/languages/id/helpers/internal/stem.js +1 -1
  136. package/build/languageProcessing/languages/id/helpers/internal/stem.js.map +1 -1
  137. package/build/languageProcessing/languages/id/helpers/internal/stemHelpers.js +1 -1
  138. package/build/languageProcessing/languages/id/helpers/internal/stemHelpers.js.map +1 -1
  139. package/build/languageProcessing/languages/id/helpers/isPassiveSentence.js +1 -1
  140. package/build/languageProcessing/languages/id/helpers/isPassiveSentence.js.map +1 -1
  141. package/build/languageProcessing/languages/it/Researcher.js +1 -1
  142. package/build/languageProcessing/languages/it/Researcher.js.map +1 -1
  143. package/build/languageProcessing/languages/it/helpers/getClauses.js +1 -1
  144. package/build/languageProcessing/languages/it/helpers/getClauses.js.map +1 -1
  145. package/build/languageProcessing/languages/it/helpers/getStemmer.js +1 -1
  146. package/build/languageProcessing/languages/it/helpers/getStemmer.js.map +1 -1
  147. package/build/languageProcessing/languages/it/helpers/internal/getParticiples.js +1 -1
  148. package/build/languageProcessing/languages/it/helpers/internal/getParticiples.js.map +1 -1
  149. package/build/languageProcessing/languages/it/helpers/internal/stem.js +1 -1
  150. package/build/languageProcessing/languages/it/helpers/internal/stem.js.map +1 -1
  151. package/build/languageProcessing/languages/it/values/Clause.js +1 -1
  152. package/build/languageProcessing/languages/it/values/Clause.js.map +1 -1
  153. package/build/languageProcessing/languages/ja/Researcher.js +1 -1
  154. package/build/languageProcessing/languages/ja/Researcher.js.map +1 -1
  155. package/build/languageProcessing/languages/ja/helpers/countCharacters.js +1 -1
  156. package/build/languageProcessing/languages/ja/helpers/countCharacters.js.map +1 -1
  157. package/build/languageProcessing/languages/ja/helpers/customGetStemmer.js +1 -1
  158. package/build/languageProcessing/languages/ja/helpers/customGetStemmer.js.map +1 -1
  159. package/build/languageProcessing/languages/ja/helpers/getWords.js +1 -1
  160. package/build/languageProcessing/languages/ja/helpers/getWords.js.map +1 -1
  161. package/build/languageProcessing/languages/nb/Researcher.js +1 -1
  162. package/build/languageProcessing/languages/nb/Researcher.js.map +1 -1
  163. package/build/languageProcessing/languages/nb/helpers/getClauses.js +1 -1
  164. package/build/languageProcessing/languages/nb/helpers/getClauses.js.map +1 -1
  165. package/build/languageProcessing/languages/nb/helpers/getStemmer.js +1 -1
  166. package/build/languageProcessing/languages/nb/helpers/getStemmer.js.map +1 -1
  167. package/build/languageProcessing/languages/nb/helpers/internal/getParticiples.js +1 -1
  168. package/build/languageProcessing/languages/nb/helpers/internal/getParticiples.js.map +1 -1
  169. package/build/languageProcessing/languages/nb/values/Clause.js +1 -1
  170. package/build/languageProcessing/languages/nb/values/Clause.js.map +1 -1
  171. package/build/languageProcessing/languages/nl/Researcher.js +1 -1
  172. package/build/languageProcessing/languages/nl/Researcher.js.map +1 -1
  173. package/build/languageProcessing/languages/nl/helpers/getClauses.js +1 -1
  174. package/build/languageProcessing/languages/nl/helpers/getClauses.js.map +1 -1
  175. package/build/languageProcessing/languages/nl/helpers/getStemmer.js +1 -1
  176. package/build/languageProcessing/languages/nl/helpers/getStemmer.js.map +1 -1
  177. package/build/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js +1 -1
  178. package/build/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js.map +1 -1
  179. package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js +1 -1
  180. package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js.map +1 -1
  181. package/build/languageProcessing/languages/nl/helpers/internal/determineStem.js +1 -1
  182. package/build/languageProcessing/languages/nl/helpers/internal/determineStem.js.map +1 -1
  183. package/build/languageProcessing/languages/nl/helpers/internal/getParticiples.js +1 -1
  184. package/build/languageProcessing/languages/nl/helpers/internal/getParticiples.js.map +1 -1
  185. package/build/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js +1 -1
  186. package/build/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js.map +1 -1
  187. package/build/languageProcessing/languages/nl/helpers/internal/stem.js +1 -1
  188. package/build/languageProcessing/languages/nl/helpers/internal/stem.js.map +1 -1
  189. package/build/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js +1 -1
  190. package/build/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js.map +1 -1
  191. package/build/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js +1 -1
  192. package/build/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js.map +1 -1
  193. package/build/languageProcessing/languages/nl/values/Clause.js +1 -1
  194. package/build/languageProcessing/languages/nl/values/Clause.js.map +1 -1
  195. package/build/languageProcessing/languages/pl/Researcher.js +1 -1
  196. package/build/languageProcessing/languages/pl/Researcher.js.map +1 -1
  197. package/build/languageProcessing/languages/pl/helpers/getClauses.js +1 -1
  198. package/build/languageProcessing/languages/pl/helpers/getClauses.js.map +1 -1
  199. package/build/languageProcessing/languages/pl/helpers/getStemmer.js +1 -1
  200. package/build/languageProcessing/languages/pl/helpers/getStemmer.js.map +1 -1
  201. package/build/languageProcessing/languages/pl/helpers/internal/getParticiples.js +1 -1
  202. package/build/languageProcessing/languages/pl/helpers/internal/getParticiples.js.map +1 -1
  203. package/build/languageProcessing/languages/pl/values/Clause.js +1 -1
  204. package/build/languageProcessing/languages/pl/values/Clause.js.map +1 -1
  205. package/build/languageProcessing/languages/pt/Researcher.js +1 -1
  206. package/build/languageProcessing/languages/pt/Researcher.js.map +1 -1
  207. package/build/languageProcessing/languages/pt/helpers/getClauses.js +1 -1
  208. package/build/languageProcessing/languages/pt/helpers/getClauses.js.map +1 -1
  209. package/build/languageProcessing/languages/pt/helpers/getStemmer.js +1 -1
  210. package/build/languageProcessing/languages/pt/helpers/getStemmer.js.map +1 -1
  211. package/build/languageProcessing/languages/pt/helpers/internal/getParticiples.js +1 -1
  212. package/build/languageProcessing/languages/pt/helpers/internal/getParticiples.js.map +1 -1
  213. package/build/languageProcessing/languages/pt/helpers/internal/stem.js +1 -1
  214. package/build/languageProcessing/languages/pt/helpers/internal/stem.js.map +1 -1
  215. package/build/languageProcessing/languages/pt/values/Clause.js +1 -1
  216. package/build/languageProcessing/languages/pt/values/Clause.js.map +1 -1
  217. package/build/languageProcessing/languages/ru/Researcher.js +1 -1
  218. package/build/languageProcessing/languages/ru/Researcher.js.map +1 -1
  219. package/build/languageProcessing/languages/ru/helpers/getStemmer.js +1 -1
  220. package/build/languageProcessing/languages/ru/helpers/getStemmer.js.map +1 -1
  221. package/build/languageProcessing/languages/ru/helpers/isPassiveSentence.js +1 -1
  222. package/build/languageProcessing/languages/ru/helpers/isPassiveSentence.js.map +1 -1
  223. package/build/languageProcessing/languages/sk/Researcher.js +1 -1
  224. package/build/languageProcessing/languages/sk/Researcher.js.map +1 -1
  225. package/build/languageProcessing/languages/sk/helpers/getClauses.js +1 -1
  226. package/build/languageProcessing/languages/sk/helpers/getClauses.js.map +1 -1
  227. package/build/languageProcessing/languages/sk/helpers/getStemmer.js +1 -1
  228. package/build/languageProcessing/languages/sk/helpers/getStemmer.js.map +1 -1
  229. package/build/languageProcessing/languages/sk/helpers/internal/getParticiples.js +1 -1
  230. package/build/languageProcessing/languages/sk/helpers/internal/getParticiples.js.map +1 -1
  231. package/build/languageProcessing/languages/sk/values/Clause.js +1 -1
  232. package/build/languageProcessing/languages/sk/values/Clause.js.map +1 -1
  233. package/build/languageProcessing/languages/sv/Researcher.js +1 -1
  234. package/build/languageProcessing/languages/sv/Researcher.js.map +1 -1
  235. package/build/languageProcessing/languages/sv/helpers/getStemmer.js +1 -1
  236. package/build/languageProcessing/languages/sv/helpers/getStemmer.js.map +1 -1
  237. package/build/languageProcessing/languages/sv/helpers/isPassiveSentence.js +1 -1
  238. package/build/languageProcessing/languages/sv/helpers/isPassiveSentence.js.map +1 -1
  239. package/build/languageProcessing/languages/tr/Researcher.js +1 -1
  240. package/build/languageProcessing/languages/tr/Researcher.js.map +1 -1
  241. package/build/languageProcessing/languages/tr/helpers/getStemmer.js +1 -1
  242. package/build/languageProcessing/languages/tr/helpers/getStemmer.js.map +1 -1
  243. package/build/languageProcessing/languages/tr/helpers/internal/stem.js +1 -1
  244. package/build/languageProcessing/languages/tr/helpers/internal/stem.js.map +1 -1
  245. package/build/languageProcessing/languages/tr/helpers/isPassiveSentence.js +1 -1
  246. package/build/languageProcessing/languages/tr/helpers/isPassiveSentence.js.map +1 -1
  247. package/build/parsedPaper/build/linguisticParsing/SentenceTokenizer.js +1 -1
  248. package/build/parsedPaper/build/linguisticParsing/SentenceTokenizer.js.map +1 -1
  249. package/build/parsedPaper/build/tree/metadata/buildTree.js +1 -1
  250. package/build/parsedPaper/build/tree/metadata/buildTree.js.map +1 -1
  251. package/build/scoring/assessments/assessment.js +1 -1
  252. package/build/scoring/assessments/assessment.js.map +1 -1
  253. package/build/scoring/assessments/index.js +5 -5
  254. package/build/scoring/assessments/index.js.map +1 -1
  255. package/build/scoring/assessments/readability/TransitionWordsAssessment.js +3 -3
  256. package/build/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
  257. package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +1 -1
  258. package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
  259. package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js +1 -1
  260. package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
  261. package/build/scoring/assessors/avadaAssessor.js +2 -2
  262. package/build/scoring/assessors/avadaAssessor.js.map +1 -1
  263. package/build/scoring/assessors/seoAssessor.js +6 -6
  264. package/build/scoring/assessors/seoAssessor.js.map +1 -1
  265. package/build/scoring/helpers/assessments/recommendedKeywordCount.js +1 -1
  266. package/build/scoring/helpers/assessments/recommendedKeywordCount.js.map +1 -1
  267. package/build/scoring/helpers/index.js +1 -1
  268. package/build/scoring/helpers/index.js.map +1 -1
  269. package/package.json +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"detectAndStemRegularParticiple.js","names":["_index","require","_nonParticiples","_interopRequireDefault","_stemModificationHelpers","e","__esModule","default","regexHelpers","doesWordMatchRegex","languageProcessing","checkAndStemIfExceptionWithoutGePrefix","dataExceptionListToCheck","word","includes","slice","shouldSuffixBeStemmed","wordWithoutPrefix","morphologyDataNL","endsWith","exceptionsTShouldBeStemmed","ambiguousTAndDEndings","wordsTShouldBeStemmed","tOrDArePartOfStem","tEnding","exceptionsTShouldNotBeStemmed","stemExceptions","wordsNotToBeStemmedExceptions","verbs","exceptionsDShouldNotBeStemmed","pastParticipleStemmer","doNotStemD","detectAndStemParticiplesWithoutPrefixes","geStemTParticipleRegex","RegExp","participleStemmingClasses","regex","test","exception","doNotStemGe","startsWith","detectAndStemParticiplePerPrefixClass","separable","prefixes","regexPart","currentPrefix","participleRegex","length","detectAndStemParticiplesWithPrefixes","participleClass","compoundVerbsPrefixes","inseparable","stem","checkIfParticipleIsSameAsStem","dataParticiplesSameAsStem","checkAndStemIfInseparablePrefixWithEndEnding","inseparablePrefixes","finalChangesRules","startsWithInseparablePrefix","map","prefix","some","value","modifyStem","detectAndStemRegularParticiple","nonParticiples","inseparableCompoundVerbsNotToBeStemmed","inseparableCompoundVerbs","pastParticiplesEndingOnEnd","regularStemmer","stemModifications","finalChanges"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index';\nconst {\n regexHelpers: {doesWordMatchRegex}\n} = languageProcessing;\n\nimport nonParticiples from '../../config/internal/nonParticiples.js';\nimport {modifyStem} from './stemModificationHelpers';\n\n/**\n * Checks whether the word is on an exception list of participles that do not have a ge- prefix. If it is found on the list,\n * remove only the last letter (the suffix).\n *\n * @param {array} dataExceptionListToCheck The list of the exception words.\n * @param {string} word \tThe (unstemmed) word to check.\n *\n * @returns {null|string} The stemmed word or null if the word was not found on the exception list.\n */\nconst checkAndStemIfExceptionWithoutGePrefix = function(dataExceptionListToCheck, word) {\n if (dataExceptionListToCheck.includes(word)) {\n return word.slice(0, -1);\n }\n return null;\n};\n\n/**\n * Checks whether a word that was detected as a participle should not have the suffix (-t or -d) removed because it is part\n * of the stem. For example, in the participle 'geantwoord', the -d belongs to the stem so it should not be removed.\n * The checks are conducted on the word without the prefix, so 'antwoord' in the case of 'geantwoord'.\n *\n * For words ending in -t, there are three checks:\n * 1) An exception list (exceptions to a rule) containing words where -t SHOULD be stemmed,\n * 2) The rule, defined using a regex with word endings where -t is part of the stem,\n * 3) A list of verbs with stem ending in -t, to cover cases that were not possible to find using a regex.\n *\n * For words ending in -d, we check a list of verbs with stem ending in -d.\n *\n * @param {string}\twordWithoutPrefix\tThe word without prefix(es).\n * @param {Object}\tmorphologyDataNL\tThe Dutch morphology data.\n *\n * @returns {boolean}\t\t\t\t\tWhether the suffix should be stemmed.\n */\nconst shouldSuffixBeStemmed = function(wordWithoutPrefix, morphologyDataNL) {\n if (wordWithoutPrefix.endsWith('t')) {\n // Return true (suffix should be stemmed) if word was found on the exception list of verbs which should have the final -t stemmed.\n const exceptionsTShouldBeStemmed = morphologyDataNL.ambiguousTAndDEndings.wordsTShouldBeStemmed;\n if (exceptionsTShouldBeStemmed.includes(wordWithoutPrefix)) {\n return true;\n }\n // Return false (suffix should not be stemmed) if word matches the regex for stems ending in -t.\n if (\n doesWordMatchRegex(\n wordWithoutPrefix,\n morphologyDataNL.ambiguousTAndDEndings.tOrDArePartOfStem.tEnding\n )\n ) {\n return false;\n }\n /*\n * Return false (suffix should not be stemmed) if the word was found on the list of verbs with stem ending in -t (e.g. haast)\n * Otherwise, return true (if no checks are matched, the default condition is for -t to be stemmed).\n */\n const exceptionsTShouldNotBeStemmed =\n morphologyDataNL.stemExceptions.wordsNotToBeStemmedExceptions.verbs;\n return !exceptionsTShouldNotBeStemmed.includes(wordWithoutPrefix);\n }\n const exceptionsDShouldNotBeStemmed = morphologyDataNL.pastParticipleStemmer.doNotStemD;\n return !exceptionsDShouldNotBeStemmed.includes(wordWithoutPrefix);\n};\n\n/**\n * Detects whether a word is a participle of a regular verb without prefixes other than ge-. If it is, checks whether\n * the word is an exception that should not have the prefix or the suffix stemmed. Then stems the word accordingly\n * (remove prefix, suffix, or both).\n *\n * @param {Object} morphologyDataNL\tThe Dutch morphology data.\n * @param {string} word The word (not stemmed) to check.\n *\n * @returns {string|null} The stem or null if no participle was matched.\n */\nconst detectAndStemParticiplesWithoutPrefixes = function(morphologyDataNL, word) {\n const geStemTParticipleRegex = new RegExp(\n '^' + morphologyDataNL.pastParticipleStemmer.participleStemmingClasses[0].regex\n );\n\n // Check if it's a ge + stem + t/d participle.\n if (geStemTParticipleRegex.test(word)) {\n // Check if the ge- is actually part of the stem. If yes, stem only the suffix.\n const exception = checkAndStemIfExceptionWithoutGePrefix(\n morphologyDataNL.pastParticipleStemmer.doNotStemGe,\n word\n );\n if (exception) {\n return exception;\n }\n\n // Remove the prefix.\n let wordWithoutPrefix = word.slice(2);\n\n // Check if stem starts with ë. If yes, replace ë with e.\n if (wordWithoutPrefix.startsWith('ë')) {\n wordWithoutPrefix = 'e' + wordWithoutPrefix.slice(1);\n }\n // Check whether the suffix should be stemmed. If yes, remove it and return the stem.\n if (shouldSuffixBeStemmed(wordWithoutPrefix, morphologyDataNL)) {\n return wordWithoutPrefix.slice(0, -1);\n }\n\n return wordWithoutPrefix;\n }\n\n return null;\n};\n\n/**\n * Determines whether a given participle pattern combined with prefixes from a given class (separable or inseparable)\n * applies to a given word and if so, returns the stem.\n *\n * @param {Object} morphologyDataNL \tThe Dutch morphology data.\n * @param {string} word \t\tThe word (not stemmed) to check.\n * @param {boolean} separable \t\t\tWhether the prefix is separable or not.\n * @param {string[]} prefixes \t\tThe prefixes of a certain prefix class.\n * @param {string} regexPart \t\tThe regex part for a given class (completed to a full regex within the function).\n *\n * @returns {string|null} The stem or null if no prefixed participle was matched.\n */\nconst detectAndStemParticiplePerPrefixClass = function(\n morphologyDataNL,\n word,\n separable,\n prefixes,\n regexPart\n) {\n for (const currentPrefix of prefixes) {\n const participleRegex = new RegExp('^' + currentPrefix + regexPart);\n\n if (participleRegex.test(word)) {\n let wordWithoutPrefix = word.slice(currentPrefix.length - word.length);\n /*\n * After removing a separable prefix, check whether the ge- belongs to the stem (e.g. the -ge- in opgebruikt).\n * If it does, stem only the suffix.\n */\n if (separable) {\n const exception = checkAndStemIfExceptionWithoutGePrefix(\n morphologyDataNL.pastParticipleStemmer.doNotStemGe,\n wordWithoutPrefix\n );\n if (exception) {\n return currentPrefix + exception;\n }\n wordWithoutPrefix = wordWithoutPrefix.slice(2);\n }\n // Check whether stem starts with ë. If yes, replace ë with e.\n if (wordWithoutPrefix.startsWith('ë')) {\n wordWithoutPrefix = 'e' + wordWithoutPrefix.slice(1);\n }\n\n if (shouldSuffixBeStemmed(wordWithoutPrefix, morphologyDataNL)) {\n return currentPrefix + wordWithoutPrefix.slice(0, -1);\n }\n return currentPrefix + wordWithoutPrefix;\n }\n }\n\n return null;\n};\n\n/**\n * Detects whether a word is a regular participle of a compound verb. A compound verb has a prefix in addition to, or instead of, ge-.\n * For example, afgemaakt has the separable prefix af-, and beantwoord has the inseparable prefix be-. If a participle\n * of a compound verb is detected, it is stemmed by removing the ge- (in case of a verb with a separable prefix) and the suffix -t or -d.\n *\n * @param {Object} morphologyDataNL \tThe Dutch morphology data.\n * @param {string} word The word (not stemmed) to check.\n *\n * @returns {string|null} The stem or null if no participle with prefix was matched.\n */\nconst detectAndStemParticiplesWithPrefixes = function(morphologyDataNL, word) {\n /*\n * It's important to preserve order here, since the ge + stem ending in -t regex is more specific than\n * the stem + t regex, and therefore must be checked first.\n */\n for (const participleClass of morphologyDataNL.pastParticipleStemmer.participleStemmingClasses) {\n const regex = participleClass.regex;\n const separable = participleClass.separable;\n\n const prefixes = separable\n ? morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes.separable\n : morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes.inseparable;\n\n const stem = detectAndStemParticiplePerPrefixClass(\n morphologyDataNL,\n word,\n separable,\n prefixes,\n regex\n );\n\n if (stem) {\n return stem;\n }\n }\n\n return null;\n};\n\n/**\n * Checks whether the word is on the list of participles that do not need to be stemmed, because the participle form\n * is the same as the stem.\n *\n * @param {string[]} dataParticiplesSameAsStem\tThe list of exceptions whose stem is the same as the participle.\n * @param {string} \t word\t\t\t\t\t\tThe word to check.\n * @returns {boolean} Whether the word is found on the exception list.\n */\nconst checkIfParticipleIsSameAsStem = function(dataParticiplesSameAsStem, word) {\n return dataParticiplesSameAsStem.includes(word);\n};\n\n/**\n * Check whether the word is on an exception list of past participles with inseparable prefixes and ending in -end.\n * If not, stem the word that starts with an inseparable verb prefix and ends in -end as a present participle.\n *\n * @param {array} inseparablePrefixes The list of inseparable prefixes.\n * @param {array} dataExceptionListToCheck The list of the exception words.\n * @param {array} finalChangesRules The array of regex-based rules to be applied to the stem.\n * @param {string} word \t The (unstemmed) word to check.\n *\n * @returns {null|string} The stemmed word or null if the word was found on the exception list.\n */\nconst checkAndStemIfInseparablePrefixWithEndEnding = function(\n inseparablePrefixes,\n dataExceptionListToCheck,\n finalChangesRules,\n word\n) {\n const startsWithInseparablePrefix = inseparablePrefixes\n .map(prefix => word.startsWith(prefix))\n .some(value => value === true);\n\n if (\n startsWithInseparablePrefix &&\n word.endsWith('end') &&\n !dataExceptionListToCheck.includes(word)\n ) {\n return modifyStem(word.slice(0, -3), finalChangesRules);\n }\n return null;\n};\n\n/**\n * Detects whether a word is a regular participle and if so, returns the stem.\n *\n * @param {Object} morphologyDataNL \tThe Dutch morphology data.\n * @param {string} word The word (not stemmed) to check.\n *\n * @returns {string|null} The participle stem or null if no regular participle was matched.\n */\nexport function detectAndStemRegularParticiple(morphologyDataNL, word) {\n // Check whether the word is not a participle. If it is not, return empty string.\n if (\n word.endsWith('heid') ||\n word.endsWith('teit') ||\n word.endsWith('tijd') ||\n nonParticiples.includes(word)\n ) {\n return '';\n }\n\n /**\n * Check whether the word is on an exception list of verbs whose participle is the same as the stem. If the word is found\n * on the list, return the stem.\n */\n if (\n checkIfParticipleIsSameAsStem(\n morphologyDataNL.pastParticipleStemmer.inseparableCompoundVerbsNotToBeStemmed,\n word\n )\n ) {\n return word;\n }\n\n // Check and stem if the word is a participle without any separable or inseparable prefix\n let stem = detectAndStemParticiplesWithoutPrefixes(morphologyDataNL, word);\n\n if (stem) {\n return stem;\n }\n\n /**\n * Check whether the word is on an exception list of inseparable compound verbs with a prefix that is usually separable.\n * If it is, remove just the suffix and return the stem.\n */\n stem = checkAndStemIfExceptionWithoutGePrefix(\n morphologyDataNL.pastParticipleStemmer.inseparableCompoundVerbs,\n word\n );\n\n if (stem) {\n return stem;\n }\n\n /**\n * Check whether the word is on an exception list of past participles with inseparable prefixes and ending in -end.\n * If not, stem the word that starts with an inseparable verb prefix and ends in -end as a present participle.\n */\n stem = checkAndStemIfInseparablePrefixWithEndEnding(\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes.inseparable,\n morphologyDataNL.pastParticipleStemmer.pastParticiplesEndingOnEnd,\n morphologyDataNL.regularStemmer.stemModifications.finalChanges,\n word\n );\n\n if (stem) {\n return stem;\n }\n\n // Check and stem if the word is a participle with a separable or inseparable prefix\n stem = detectAndStemParticiplesWithPrefixes(morphologyDataNL, word);\n\n if (stem) {\n return stem;\n }\n\n return null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAH,OAAA;AAAqD,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AALrD,MAAM;EACJG,YAAY,EAAE;IAACC;EAAkB;AACnC,CAAC,GAAGC,yBAAkB;AAKtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sCAAsC,GAAG,SAAAA,CAASC,wBAAwB,EAAEC,IAAI,EAAE;EACtF,IAAID,wBAAwB,CAACE,QAAQ,CAACD,IAAI,CAAC,EAAE;IAC3C,OAAO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ACA;EACEA,IAAI,GAAGzC,sCAAsC,CAC3CO,gBAAgB,CAACY,qBAAqB,CAACqC,wBAAwB,EAC/DtD,IACF,CAAC;EAED,IAAIuC,IAAI,EAAE;IACR,OAAOA,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACEA,IAAI,GAAGG,4CAA4C,CACjDrC,gBAAgB,CAACY,qBAAqB,CAACoB,qBAAqB,CAACC,WAAW,EACxEjC,gBAAgB,CAACY,qBAAqB,CAACsC,0BAA0B,EACjElD,gBAAgB,CAACmD,cAAc,CAACC,iBAAiB,CAACC,YAAY,EAC9D1D,IACF,CAAC;EAED,IAAIuC,IAAI,EAAE;IACR,OAAOA,IAAI;EACb;;EAEA;EACAA,IAAI,GAAGJ,oCAAoC,CAAC9B,gBAAgB,EAAEL,IAAI,CAAC;EAEnE,IAAIuC,IAAI,EAAE;IACR,OAAOA,IAAI;EACb;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
1
+ {"version":3,"file":"detectAndStemRegularParticiple.js","names":["_index","require","_nonParticiples","_interopRequireDefault","_stemModificationHelpers","e","__esModule","default","regexHelpers","doesWordMatchRegex","languageProcessing","checkAndStemIfExceptionWithoutGePrefix","dataExceptionListToCheck","word","includes","slice","shouldSuffixBeStemmed","wordWithoutPrefix","morphologyDataNL","endsWith","exceptionsTShouldBeStemmed","ambiguousTAndDEndings","wordsTShouldBeStemmed","tOrDArePartOfStem","tEnding","exceptionsTShouldNotBeStemmed","stemExceptions","wordsNotToBeStemmedExceptions","verbs","exceptionsDShouldNotBeStemmed","pastParticipleStemmer","doNotStemD","detectAndStemParticiplesWithoutPrefixes","geStemTParticipleRegex","RegExp","participleStemmingClasses","regex","test","exception","doNotStemGe","startsWith","detectAndStemParticiplePerPrefixClass","separable","prefixes","regexPart","currentPrefix","participleRegex","length","detectAndStemParticiplesWithPrefixes","participleClass","compoundVerbsPrefixes","inseparable","stem","checkIfParticipleIsSameAsStem","dataParticiplesSameAsStem","checkAndStemIfInseparablePrefixWithEndEnding","inseparablePrefixes","finalChangesRules","startsWithInseparablePrefix","map","prefix","some","value","modifyStem","detectAndStemRegularParticiple","nonParticiples","inseparableCompoundVerbsNotToBeStemmed","inseparableCompoundVerbs","pastParticiplesEndingOnEnd","regularStemmer","stemModifications","finalChanges"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {\n regexHelpers: {doesWordMatchRegex}\n} = languageProcessing;\n\nimport nonParticiples from '../../config/internal/nonParticiples.js';\nimport {modifyStem} from './stemModificationHelpers';\n\n/**\n * Checks whether the word is on an exception list of participles that do not have a ge- prefix. If it is found on the list,\n * remove only the last letter (the suffix).\n *\n * @param {array} dataExceptionListToCheck The list of the exception words.\n * @param {string} word \tThe (unstemmed) word to check.\n *\n * @returns {null|string} The stemmed word or null if the word was not found on the exception list.\n */\nconst checkAndStemIfExceptionWithoutGePrefix = function(dataExceptionListToCheck, word) {\n if (dataExceptionListToCheck.includes(word)) {\n return word.slice(0, -1);\n }\n return null;\n};\n\n/**\n * Checks whether a word that was detected as a participle should not have the suffix (-t or -d) removed because it is part\n * of the stem. For example, in the participle 'geantwoord', the -d belongs to the stem so it should not be removed.\n * The checks are conducted on the word without the prefix, so 'antwoord' in the case of 'geantwoord'.\n *\n * For words ending in -t, there are three checks:\n * 1) An exception list (exceptions to a rule) containing words where -t SHOULD be stemmed,\n * 2) The rule, defined using a regex with word endings where -t is part of the stem,\n * 3) A list of verbs with stem ending in -t, to cover cases that were not possible to find using a regex.\n *\n * For words ending in -d, we check a list of verbs with stem ending in -d.\n *\n * @param {string}\twordWithoutPrefix\tThe word without prefix(es).\n * @param {Object}\tmorphologyDataNL\tThe Dutch morphology data.\n *\n * @returns {boolean}\t\t\t\t\tWhether the suffix should be stemmed.\n */\nconst shouldSuffixBeStemmed = function(wordWithoutPrefix, morphologyDataNL) {\n if (wordWithoutPrefix.endsWith('t')) {\n // Return true (suffix should be stemmed) if word was found on the exception list of verbs which should have the final -t stemmed.\n const exceptionsTShouldBeStemmed = morphologyDataNL.ambiguousTAndDEndings.wordsTShouldBeStemmed;\n if (exceptionsTShouldBeStemmed.includes(wordWithoutPrefix)) {\n return true;\n }\n // Return false (suffix should not be stemmed) if word matches the regex for stems ending in -t.\n if (\n doesWordMatchRegex(\n wordWithoutPrefix,\n morphologyDataNL.ambiguousTAndDEndings.tOrDArePartOfStem.tEnding\n )\n ) {\n return false;\n }\n /*\n * Return false (suffix should not be stemmed) if the word was found on the list of verbs with stem ending in -t (e.g. haast)\n * Otherwise, return true (if no checks are matched, the default condition is for -t to be stemmed).\n */\n const exceptionsTShouldNotBeStemmed =\n morphologyDataNL.stemExceptions.wordsNotToBeStemmedExceptions.verbs;\n return !exceptionsTShouldNotBeStemmed.includes(wordWithoutPrefix);\n }\n const exceptionsDShouldNotBeStemmed = morphologyDataNL.pastParticipleStemmer.doNotStemD;\n return !exceptionsDShouldNotBeStemmed.includes(wordWithoutPrefix);\n};\n\n/**\n * Detects whether a word is a participle of a regular verb without prefixes other than ge-. If it is, checks whether\n * the word is an exception that should not have the prefix or the suffix stemmed. Then stems the word accordingly\n * (remove prefix, suffix, or both).\n *\n * @param {Object} morphologyDataNL\tThe Dutch morphology data.\n * @param {string} word The word (not stemmed) to check.\n *\n * @returns {string|null} The stem or null if no participle was matched.\n */\nconst detectAndStemParticiplesWithoutPrefixes = function(morphologyDataNL, word) {\n const geStemTParticipleRegex = new RegExp(\n '^' + morphologyDataNL.pastParticipleStemmer.participleStemmingClasses[0].regex\n );\n\n // Check if it's a ge + stem + t/d participle.\n if (geStemTParticipleRegex.test(word)) {\n // Check if the ge- is actually part of the stem. If yes, stem only the suffix.\n const exception = checkAndStemIfExceptionWithoutGePrefix(\n morphologyDataNL.pastParticipleStemmer.doNotStemGe,\n word\n );\n if (exception) {\n return exception;\n }\n\n // Remove the prefix.\n let wordWithoutPrefix = word.slice(2);\n\n // Check if stem starts with ë. If yes, replace ë with e.\n if (wordWithoutPrefix.startsWith('ë')) {\n wordWithoutPrefix = 'e' + wordWithoutPrefix.slice(1);\n }\n // Check whether the suffix should be stemmed. If yes, remove it and return the stem.\n if (shouldSuffixBeStemmed(wordWithoutPrefix, morphologyDataNL)) {\n return wordWithoutPrefix.slice(0, -1);\n }\n\n return wordWithoutPrefix;\n }\n\n return null;\n};\n\n/**\n * Determines whether a given participle pattern combined with prefixes from a given class (separable or inseparable)\n * applies to a given word and if so, returns the stem.\n *\n * @param {Object} morphologyDataNL \tThe Dutch morphology data.\n * @param {string} word \t\tThe word (not stemmed) to check.\n * @param {boolean} separable \t\t\tWhether the prefix is separable or not.\n * @param {string[]} prefixes \t\tThe prefixes of a certain prefix class.\n * @param {string} regexPart \t\tThe regex part for a given class (completed to a full regex within the function).\n *\n * @returns {string|null} The stem or null if no prefixed participle was matched.\n */\nconst detectAndStemParticiplePerPrefixClass = function(\n morphologyDataNL,\n word,\n separable,\n prefixes,\n regexPart\n) {\n for (const currentPrefix of prefixes) {\n const participleRegex = new RegExp('^' + currentPrefix + regexPart);\n\n if (participleRegex.test(word)) {\n let wordWithoutPrefix = word.slice(currentPrefix.length - word.length);\n /*\n * After removing a separable prefix, check whether the ge- belongs to the stem (e.g. the -ge- in opgebruikt).\n * If it does, stem only the suffix.\n */\n if (separable) {\n const exception = checkAndStemIfExceptionWithoutGePrefix(\n morphologyDataNL.pastParticipleStemmer.doNotStemGe,\n wordWithoutPrefix\n );\n if (exception) {\n return currentPrefix + exception;\n }\n wordWithoutPrefix = wordWithoutPrefix.slice(2);\n }\n // Check whether stem starts with ë. If yes, replace ë with e.\n if (wordWithoutPrefix.startsWith('ë')) {\n wordWithoutPrefix = 'e' + wordWithoutPrefix.slice(1);\n }\n\n if (shouldSuffixBeStemmed(wordWithoutPrefix, morphologyDataNL)) {\n return currentPrefix + wordWithoutPrefix.slice(0, -1);\n }\n return currentPrefix + wordWithoutPrefix;\n }\n }\n\n return null;\n};\n\n/**\n * Detects whether a word is a regular participle of a compound verb. A compound verb has a prefix in addition to, or instead of, ge-.\n * For example, afgemaakt has the separable prefix af-, and beantwoord has the inseparable prefix be-. If a participle\n * of a compound verb is detected, it is stemmed by removing the ge- (in case of a verb with a separable prefix) and the suffix -t or -d.\n *\n * @param {Object} morphologyDataNL \tThe Dutch morphology data.\n * @param {string} word The word (not stemmed) to check.\n *\n * @returns {string|null} The stem or null if no participle with prefix was matched.\n */\nconst detectAndStemParticiplesWithPrefixes = function(morphologyDataNL, word) {\n /*\n * It's important to preserve order here, since the ge + stem ending in -t regex is more specific than\n * the stem + t regex, and therefore must be checked first.\n */\n for (const participleClass of morphologyDataNL.pastParticipleStemmer.participleStemmingClasses) {\n const regex = participleClass.regex;\n const separable = participleClass.separable;\n\n const prefixes = separable\n ? morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes.separable\n : morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes.inseparable;\n\n const stem = detectAndStemParticiplePerPrefixClass(\n morphologyDataNL,\n word,\n separable,\n prefixes,\n regex\n );\n\n if (stem) {\n return stem;\n }\n }\n\n return null;\n};\n\n/**\n * Checks whether the word is on the list of participles that do not need to be stemmed, because the participle form\n * is the same as the stem.\n *\n * @param {string[]} dataParticiplesSameAsStem\tThe list of exceptions whose stem is the same as the participle.\n * @param {string} \t word\t\t\t\t\t\tThe word to check.\n * @returns {boolean} Whether the word is found on the exception list.\n */\nconst checkIfParticipleIsSameAsStem = function(dataParticiplesSameAsStem, word) {\n return dataParticiplesSameAsStem.includes(word);\n};\n\n/**\n * Check whether the word is on an exception list of past participles with inseparable prefixes and ending in -end.\n * If not, stem the word that starts with an inseparable verb prefix and ends in -end as a present participle.\n *\n * @param {array} inseparablePrefixes The list of inseparable prefixes.\n * @param {array} dataExceptionListToCheck The list of the exception words.\n * @param {array} finalChangesRules The array of regex-based rules to be applied to the stem.\n * @param {string} word \t The (unstemmed) word to check.\n *\n * @returns {null|string} The stemmed word or null if the word was found on the exception list.\n */\nconst checkAndStemIfInseparablePrefixWithEndEnding = function(\n inseparablePrefixes,\n dataExceptionListToCheck,\n finalChangesRules,\n word\n) {\n const startsWithInseparablePrefix = inseparablePrefixes\n .map(prefix => word.startsWith(prefix))\n .some(value => value === true);\n\n if (\n startsWithInseparablePrefix &&\n word.endsWith('end') &&\n !dataExceptionListToCheck.includes(word)\n ) {\n return modifyStem(word.slice(0, -3), finalChangesRules);\n }\n return null;\n};\n\n/**\n * Detects whether a word is a regular participle and if so, returns the stem.\n *\n * @param {Object} morphologyDataNL \tThe Dutch morphology data.\n * @param {string} word The word (not stemmed) to check.\n *\n * @returns {string|null} The participle stem or null if no regular participle was matched.\n */\nexport function detectAndStemRegularParticiple(morphologyDataNL, word) {\n // Check whether the word is not a participle. If it is not, return empty string.\n if (\n word.endsWith('heid') ||\n word.endsWith('teit') ||\n word.endsWith('tijd') ||\n nonParticiples.includes(word)\n ) {\n return '';\n }\n\n /**\n * Check whether the word is on an exception list of verbs whose participle is the same as the stem. If the word is found\n * on the list, return the stem.\n */\n if (\n checkIfParticipleIsSameAsStem(\n morphologyDataNL.pastParticipleStemmer.inseparableCompoundVerbsNotToBeStemmed,\n word\n )\n ) {\n return word;\n }\n\n // Check and stem if the word is a participle without any separable or inseparable prefix\n let stem = detectAndStemParticiplesWithoutPrefixes(morphologyDataNL, word);\n\n if (stem) {\n return stem;\n }\n\n /**\n * Check whether the word is on an exception list of inseparable compound verbs with a prefix that is usually separable.\n * If it is, remove just the suffix and return the stem.\n */\n stem = checkAndStemIfExceptionWithoutGePrefix(\n morphologyDataNL.pastParticipleStemmer.inseparableCompoundVerbs,\n word\n );\n\n if (stem) {\n return stem;\n }\n\n /**\n * Check whether the word is on an exception list of past participles with inseparable prefixes and ending in -end.\n * If not, stem the word that starts with an inseparable verb prefix and ends in -end as a present participle.\n */\n stem = checkAndStemIfInseparablePrefixWithEndEnding(\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes.inseparable,\n morphologyDataNL.pastParticipleStemmer.pastParticiplesEndingOnEnd,\n morphologyDataNL.regularStemmer.stemModifications.finalChanges,\n word\n );\n\n if (stem) {\n return stem;\n }\n\n // Check and stem if the word is a participle with a separable or inseparable prefix\n stem = detectAndStemParticiplesWithPrefixes(morphologyDataNL, word);\n\n if (stem) {\n return stem;\n }\n\n return null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAH,OAAA;AAAqD,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AALrD,MAAM;EACJG,YAAY,EAAE;IAACC;EAAkB;AACnC,CAAC,GAAGC,yBAAkB;AAKtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sCAAsC,GAAG,SAAAA,CAASC,wBAAwB,EAAEC,IAAI,EAAE;EACtF,IAAID,wBAAwB,CAACE,QAAQ,CAACD,IAAI,CAAC,EAAE;IAC3C,OAAOA,IAAI,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAC1B;EACA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,qBAAqB,GAAG,SAAAA,CAASC,iBAAiB,EAAEC,gBAAgB,EAAE;EAC1E,IAAID,iBAAiB,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;IACnC;IACA,MAAMC,0BAA0B,GAAGF,gBAAgB,CAACG,qBAAqB,CAACC,qBAAqB;IAC/F,IAAIF,0BAA0B,CAACN,QAAQ,CAACG,iBAAiB,CAAC,EAAE;MAC1D,OAAO,IAAI;IACb;IACA;IACA,IACER,kBAAkB,CAChBQ,iBAAiB,EACjBC,gBAAgB,CAACG,qBAAqB,CAACE,iBAAiB,CAACC,OAC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,OAAO,IAAI;AACb","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = determineStem;
7
7
  var _lodash = require("lodash");
8
- var _index = require("@axyseo/index");
8
+ var _index = require("../../../index");
9
9
  var _stem = _interopRequireDefault(require("./stem"));
10
10
  var _stemTOrDFromEndOfWord = require("./stemTOrDFromEndOfWord");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1 +1 @@
1
- {"version":3,"file":"determineStem.js","names":["_lodash","require","_index","_stem","_interopRequireDefault","_stemTOrDFromEndOfWord","e","__esModule","default","flattenSortLength","exceptionListHelpers","checkExceptionListWithTwoStems","languageProcessing","checkStrongVerbExceptionList","strongVerbsLists","stemmedWord","key","Object","keys","stemsSet","stems","flatten","values","includes","findStemOnVerbExceptionList","morphologyDataNL","prefixes","pastParticipleStemmer","compoundVerbsPrefixes","foundPrefix","find","prefix","startsWith","doNotStemPrefix","stemExceptions","stemmingExceptionsWithMultipleStems","strongAndIrregularVerbs","doNotStemPrefixException","exception","endsWith","stemmedWordWithoutPrefix","slice","length","strongVerbExceptions","strongVerbStems","strongVerbsExceptionLists","irregularStrongVerbs","regularStrongVerbs","bothRegularAndIrregularStrongVerbs","i","checkIfWordIsException","determineStem","word","stem","stemFromExceptionList","stemmingExceptionsWithTwoStems","ambiguousEndings","ambiguousTAndDEndings","tAndDEndings","ending","stemmedWordWithoutTOrD","stemTOrDFromEndOfWord"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/determineStem.js"],"sourcesContent":["import {flatten} from 'lodash';\nimport {languageProcessing} from '@axyseo/index';\nconst {\n flattenSortLength,\n exceptionListHelpers: {checkExceptionListWithTwoStems}\n} = languageProcessing;\n\nimport stem from './stem';\nimport {stemTOrDFromEndOfWord} from './stemTOrDFromEndOfWord';\n\n/**\n * Checks if the word checked is in the list of strong verbs exceptions. If it is, only return the first stem from the stem set.\n * E.g. stems: help, hielp, geholp -> the stem returned would be \"help\".\n *\n * @param {Object} strongVerbsLists\tThe exception lists of strong verbs.\n * @param {string} stemmedWord The word to check.\n * @returns {string} The unique stem.\n */\nconst checkStrongVerbExceptionList = function(strongVerbsLists, stemmedWord) {\n for (const key of Object.keys(strongVerbsLists)) {\n for (const stemsSet of strongVerbsLists[key]) {\n const stems = flatten(Object.values(stemsSet));\n if (stems.includes(stemmedWord)) {\n return stems[0];\n }\n }\n }\n};\n\n/**\n * Checks if the word checked is in the list of strong verbs exceptions. Before checking, see if the word has a prefix and delete it if it does.\n * If the stem after prefix deletion is in the verb exception list, only return the first stem from the stem set and attach back the prefix.\n * E.g. words to check: verhielp, stem set: help, hielp, geholp -> the stem returned would be \"verhelp\".\n *\n * @param {Object} morphologyDataNL \tThe Dutch morphology data file.\n * @param {string} stemmedWord \t\tThe word to check.\n *\n * @returns {string} The unique stem.\n */\nconst findStemOnVerbExceptionList = function(morphologyDataNL, stemmedWord) {\n const prefixes = flattenSortLength(morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes);\n // Check whether the inputted stem is started with one of the separable compound prefixes\n let foundPrefix = prefixes.find(prefix => stemmedWord.startsWith(prefix));\n const doNotStemPrefix =\n morphologyDataNL.stemExceptions.stemmingExceptionsWithMultipleStems.strongAndIrregularVerbs\n .doNotStemPrefix;\n const doNotStemPrefixException = doNotStemPrefix.find(exception =>\n stemmedWord.endsWith(exception)\n );\n let stemmedWordWithoutPrefix = '';\n\n // Check whether the stemmedWord is in the list of strong verbs starting with be-, ont- or ver- that do not need to be stemmed.\n if (doNotStemPrefixException) {\n // Reset foundPrefix so that it won't be attached when the stem is found in the verb exception list.\n foundPrefix = null;\n // If the inputted stem is started with one of the separable compound prefixes, the prefix needs to be deleted for now.\n } else if (foundPrefix) {\n // Delete the prefix for now.\n stemmedWordWithoutPrefix = stemmedWord.slice(foundPrefix.length, stemmedWord.length);\n // At least 3 characters left after prefix deletion so that e.g. \"be\" is not found in the stem \"berg\".\n if (stemmedWordWithoutPrefix.length > 2) {\n stemmedWord = stemmedWordWithoutPrefix;\n } else {\n // Reset foundPrefix so that it won't be attached when the stem is found in the verb exception list.\n foundPrefix = null;\n }\n }\n\n const strongVerbExceptions =\n morphologyDataNL.stemExceptions.stemmingExceptionsWithMultipleStems.strongAndIrregularVerbs\n .strongVerbStems;\n // Find stem strong verbs lists.\n const strongVerbsExceptionLists = [\n strongVerbExceptions.irregularStrongVerbs,\n strongVerbExceptions.regularStrongVerbs,\n strongVerbExceptions.bothRegularAndIrregularStrongVerbs\n ];\n for (let i = 0; i < strongVerbsExceptionLists.length; i++) {\n const checkIfWordIsException = checkStrongVerbExceptionList(\n strongVerbsExceptionLists[i],\n stemmedWord\n );\n if (checkIfWordIsException) {\n // If the word checked had a prefix previously, attach it back.\n if (foundPrefix) {\n return (\n foundPrefix + checkStrongVerbExceptionList(strongVerbsExceptionLists[i], stemmedWord)\n );\n }\n // If the word checked did not have a prefix previously, only return the first stem.\n return checkStrongVerbExceptionList(strongVerbsExceptionLists[i], stemmedWord);\n }\n }\n};\n\n/**\n * Return the unique stem for a given Dutch input word.\n *\n * @param {string} word The word to be checked.\n * @param {Object} morphologyDataNL The Dutch data file.\n *\n * @returns {string} The unique stem.\n */\nexport default function determineStem(word, morphologyDataNL) {\n const stemmedWord = stem(word, morphologyDataNL);\n\n // Check whether the stemmed word is on an exception list of words with multiple stems. If it is, return the canonical stem.\n let stemFromExceptionList = checkExceptionListWithTwoStems(\n morphologyDataNL.stemExceptions.stemmingExceptionsWithMultipleStems\n .stemmingExceptionsWithTwoStems,\n stemmedWord\n );\n if (stemFromExceptionList) {\n return stemFromExceptionList;\n }\n stemFromExceptionList = findStemOnVerbExceptionList(morphologyDataNL, stemmedWord);\n if (stemFromExceptionList) {\n return stemFromExceptionList;\n }\n\n // If the stemmed word ends in -t or -d, check whether it should be stemmed further, and return the stem with or without the -t/d.\n const ambiguousEndings = morphologyDataNL.ambiguousTAndDEndings.tAndDEndings;\n for (const ending of ambiguousEndings) {\n if (stemmedWord.endsWith(ending)) {\n const stemmedWordWithoutTOrD = stemTOrDFromEndOfWord(morphologyDataNL, stemmedWord, word);\n if (stemmedWordWithoutTOrD) {\n return stemmedWordWithoutTOrD;\n }\n }\n }\n\n return stemmedWord;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AAA8D,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAN9D,MAAM;EACJG,iBAAiB;EACjBC,oBAAoB,EAAE;IAACC;EAA8B;AACvD,CAAC,GAAGC,yBAAkB;AAKtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,4BAA4B,GAAG,SAAAA,CAASC,gBAAgB,EAAEC,WAAW,EAAE;EAC3E,KAAK,MAAMC,GAAG,IAAIC,MAAM,CAACC,IAAI,CAACJ,gBAAgB,CAAC,EAAE;IAC/C,KAAK,MAAMK,QAAQ,IAAIL,gBAAgB,CAACE,GAAG,CAAC,EAAE;MAC5C,MAAMI,KAAK,GAAG,IAAAC,eAAO,EAACJ,MAAM,CAACK,MAAM,CAACH,QAAQ,CAAC,CAAC;MAC9C,IAAIC,KAAK,CAACG,QAAQ,CAACR,WAAW,CAAC,EAAE;QAC/B,OAAOK,KAAK,CAAC,CAAC,CAAC;MACjB;IACF;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,2BAA2B,GAAG,SAAAA,CAASC,gBAAgB,EAAEV,WAAW,EAAE;EAC1E,MAAMW,QAAQ,GAAGjB,iBAAiB,CAACgB,gBAAgB,CAACE,qBAAqB,CAACC,qBAAqB,CAAC;EAChG;EACA,IAAIC,WAAW,GAAGH,QAAQ,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AW,CAAC;MAEzF;MACA;MACA,OAAOF,4BAA4B,CAACgC,yBAAyB,CAACI,CAAC,CAAC,EAAElC,WAAW,CAAC;IAChF;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASoC,aAAaA,CAACC,IAAI,EAAE3B,gBAAgB,EAAE;EAC5D,MAAMV,WAAW,GAAG,IAAAsC,aAAI,EAACD,IAAI,EAAE3B,gBAAgB,CAAC;;EAEhD;EACA,IAAI6B,qBAAqB,GAAG3C,8BAA8B,CACxDc,gBAAgB,CAACS,cAAc,CAACC,mCAAmC,CAChEoB,8BAA8B,EACjCxC,WACF,CAAC;EACD,IAAIuC,qBAAqB,EAAE;IACzB,OAAOA,qBAAqB;EAC9B;EACAA,qBAAqB,GAAG9B,2BAA2B,CAACC,gBAAgB,EAAEV,WAAW,CAAC;EAClF,IAAIuC,qBAAqB,EAAE;IACzB,OAAOA,qBAAqB;EAC9B;;EAEA;EACA,MAAME,gBAAgB,GAAG/B,gBAAgB,CAACgC,qBAAqB,CAACC,YAAY;EAC5E,KAAK,MAAMC,MAAM,IAAIH,gBAAgB,EAAE;IACrC,IAAIzC,WAAW,CAACwB,QAAQ,CAACoB,MAAM,CAAC,EAAE;MAChC,MAAMC,sBAAsB,GAAG,IAAAC,4CAAqB,EAACpC,gBAAgB,EAAEV,WAAW,EAAEqC,IAAI,CAAC;MACzF,IAAIQ,sBAAsB,EAAE;QAC1B,OAAOA,sBAAsB;MAC/B;IACF;EACF;EAEA,OAAO7C,WAAW;AACpB","ignoreList":[]}
1
+ {"version":3,"file":"determineStem.js","names":["_lodash","require","_index","_stem","_interopRequireDefault","_stemTOrDFromEndOfWord","e","__esModule","default","flattenSortLength","exceptionListHelpers","checkExceptionListWithTwoStems","languageProcessing","checkStrongVerbExceptionList","strongVerbsLists","stemmedWord","key","Object","keys","stemsSet","stems","flatten","values","includes","findStemOnVerbExceptionList","morphologyDataNL","prefixes","pastParticipleStemmer","compoundVerbsPrefixes","foundPrefix","find","prefix","startsWith","doNotStemPrefix","stemExceptions","stemmingExceptionsWithMultipleStems","strongAndIrregularVerbs","doNotStemPrefixException","exception","endsWith","stemmedWordWithoutPrefix","slice","length","strongVerbExceptions","strongVerbStems","strongVerbsExceptionLists","irregularStrongVerbs","regularStrongVerbs","bothRegularAndIrregularStrongVerbs","i","checkIfWordIsException","determineStem","word","stem","stemFromExceptionList","stemmingExceptionsWithTwoStems","ambiguousEndings","ambiguousTAndDEndings","tAndDEndings","ending","stemmedWordWithoutTOrD","stemTOrDFromEndOfWord"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/determineStem.js"],"sourcesContent":["import {flatten} from 'lodash';\nimport {languageProcessing} from '../../../index';\nconst {\n flattenSortLength,\n exceptionListHelpers: {checkExceptionListWithTwoStems}\n} = languageProcessing;\n\nimport stem from './stem';\nimport {stemTOrDFromEndOfWord} from './stemTOrDFromEndOfWord';\n\n/**\n * Checks if the word checked is in the list of strong verbs exceptions. If it is, only return the first stem from the stem set.\n * E.g. stems: help, hielp, geholp -> the stem returned would be \"help\".\n *\n * @param {Object} strongVerbsLists\tThe exception lists of strong verbs.\n * @param {string} stemmedWord The word to check.\n * @returns {string} The unique stem.\n */\nconst checkStrongVerbExceptionList = function(strongVerbsLists, stemmedWord) {\n for (const key of Object.keys(strongVerbsLists)) {\n for (const stemsSet of strongVerbsLists[key]) {\n const stems = flatten(Object.values(stemsSet));\n if (stems.includes(stemmedWord)) {\n return stems[0];\n }\n }\n }\n};\n\n/**\n * Checks if the word checked is in the list of strong verbs exceptions. Before checking, see if the word has a prefix and delete it if it does.\n * If the stem after prefix deletion is in the verb exception list, only return the first stem from the stem set and attach back the prefix.\n * E.g. words to check: verhielp, stem set: help, hielp, geholp -> the stem returned would be \"verhelp\".\n *\n * @param {Object} morphologyDataNL \tThe Dutch morphology data file.\n * @param {string} stemmedWord \t\tThe word to check.\n *\n * @returns {string} The unique stem.\n */\nconst findStemOnVerbExceptionList = function(morphologyDataNL, stemmedWord) {\n const prefixes = flattenSortLength(morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes);\n // Check whether the inputted stem is started with one of the separable compound prefixes\n let foundPrefix = prefixes.find(prefix => stemmedWord.startsWith(prefix));\n const doNotStemPrefix =\n morphologyDataNL.stemExceptions.stemmingExceptionsWithMultipleStems.strongAndIrregularVerbs\n .doNotStemPrefix;\n const doNotStemPrefixException = doNotStemPrefix.find(exception =>\n stemmedWord.endsWith(exception)\n );\n let stemmedWordWithoutPrefix = '';\n\n // Check whether the stemmedWord is in the list of strong verbs starting with be-, ont- or ver- that do not need to be stemmed.\n if (doNotStemPrefixException) {\n // Reset foundPrefix so that it won't be attached when the stem is found in the verb exception list.\n foundPrefix = null;\n // If the inputted stem is started with one of the separable compound prefixes, the prefix needs to be deleted for now.\n } else if (foundPrefix) {\n // Delete the prefix for now.\n stemmedWordWithoutPrefix = stemmedWord.slice(foundPrefix.length, stemmedWord.length);\n // At least 3 characters left after prefix deletion so that e.g. \"be\" is not found in the stem \"berg\".\n if (stemmedWordWithoutPrefix.length > 2) {\n stemmedWord = stemmedWordWithoutPrefix;\n } else {\n // Reset foundPrefix so that it won't be attached when the stem is found in the verb exception list.\n foundPrefix = null;\n }\n }\n\n const strongVerbExceptions =\n morphologyDataNL.stemExceptions.stemmingExceptionsWithMultipleStems.strongAndIrregularVerbs\n .strongVerbStems;\n // Find stem strong verbs lists.\n const strongVerbsExceptionLists = [\n strongVerbExceptions.irregularStrongVerbs,\n strongVerbExceptions.regularStrongVerbs,\n strongVerbExceptions.bothRegularAndIrregularStrongVerbs\n ];\n for (let i = 0; i < strongVerbsExceptionLists.length; i++) {\n const checkIfWordIsException = checkStrongVerbExceptionList(\n strongVerbsExceptionLists[i],\n stemmedWord\n );\n if (checkIfWordIsException) {\n // If the word checked had a prefix previously, attach it back.\n if (foundPrefix) {\n return (\n foundPrefix + checkStrongVerbExceptionList(strongVerbsExceptionLists[i], stemmedWord)\n );\n }\n // If the word checked did not have a prefix previously, only return the first stem.\n return checkStrongVerbExceptionList(strongVerbsExceptionLists[i], stemmedWord);\n }\n }\n};\n\n/**\n * Return the unique stem for a given Dutch input word.\n *\n * @param {string} word The word to be checked.\n * @param {Object} morphologyDataNL The Dutch data file.\n *\n * @returns {string} The unique stem.\n */\nexport default function determineStem(word, morphologyDataNL) {\n const stemmedWord = stem(word, morphologyDataNL);\n\n // Check whether the stemmed word is on an exception list of words with multiple stems. If it is, return the canonical stem.\n let stemFromExceptionList = checkExceptionListWithTwoStems(\n morphologyDataNL.stemExceptions.stemmingExceptionsWithMultipleStems\n .stemmingExceptionsWithTwoStems,\n stemmedWord\n );\n if (stemFromExceptionList) {\n return stemFromExceptionList;\n }\n stemFromExceptionList = findStemOnVerbExceptionList(morphologyDataNL, stemmedWord);\n if (stemFromExceptionList) {\n return stemFromExceptionList;\n }\n\n // If the stemmed word ends in -t or -d, check whether it should be stemmed further, and return the stem with or without the -t/d.\n const ambiguousEndings = morphologyDataNL.ambiguousTAndDEndings.tAndDEndings;\n for (const ending of ambiguousEndings) {\n if (stemmedWord.endsWith(ending)) {\n const stemmedWordWithoutTOrD = stemTOrDFromEndOfWord(morphologyDataNL, stemmedWord, word);\n if (stemmedWordWithoutTOrD) {\n return stemmedWordWithoutTOrD;\n }\n }\n }\n\n return stemmedWord;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AAA8D,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAN9D,MAAM;EACJG,iBAAiB;EACjBC,oBAAoB,EAAE;IAACC;EAA8B;AACvD,CAAC,GAAGC,yBAAkB;AAKtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,4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,qBAAqB;EAC9B;;EAEA;EACA,MAAME,gBAAgB,GAAG/B,gBAAgB,CAACgC,qBAAqB,CAACC,YAAY;EAC5E,KAAK,MAAMC,MAAM,IAAIH,gBAAgB,EAAE;IACrC,IAAIzC,WAAW,CAACwB,QAAQ,CAACoB,MAAM,CAAC,EAAE;MAChC,MAAMC,sBAAsB,GAAG,IAAAC,4CAAqB,EAACpC,gBAAgB,EAAEV,WAAW,EAAEqC,IAAI,CAAC;MACzF,IAAIQ,sBAAsB,EAAE;QAC1B,OAAOA,sBAAsB;MAC/B;IACF;EACF;EAEA,OAAO7C,WAAW;AACpB","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = getParticiples;
7
7
  var _lodash = require("lodash");
8
- var _index = require("@axyseo/index");
8
+ var _index = require("../../../index");
9
9
  var _passiveVoiceIrregulars = _interopRequireDefault(require("../../config/internal/passiveVoiceIrregulars"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"getParticiples.js","names":["_lodash","require","_index","_passiveVoiceIrregulars","_interopRequireDefault","e","__esModule","default","getWords","matchRegularParticiples","languageProcessing","getParticiples","clauseText","words","regexes","filter","word","length","includes","irregularParticiples"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/getParticiples.js"],"sourcesContent":["import {includes} from 'lodash';\nimport {languageProcessing} from '@axyseo/index';\nconst {getWords, matchRegularParticiples} = languageProcessing;\n\nimport irregularParticiples from '../../config/internal/passiveVoiceIrregulars';\n\n/**\n * Creates an array of participle for the participles found in a clause.\n *\n * @param {string} clauseText The clause text to find participles in.\n *\n * @returns {Array} The list with participle.\n */\nexport default function getParticiples(clauseText) {\n const words = getWords(clauseText);\n const regexes = [\n /^(ge|be|ont|ver|her|er)\\S+([dt])($|[ \\n\\r\\t.,'()\"+\\-;!?:/»«‹›<>])/gi,\n /^(aan|af|bij|binnen|los|mee|na|neer|om|onder|samen|terug|tegen|toe|uit|vast)(ge)\\S+([dtn])($|[ \\n\\r\\t.,'()\"+\\-;!?:/»«‹›<>])/gi\n ];\n\n return words.filter(\n word =>\n matchRegularParticiples(word, regexes).length !== 0 || includes(irregularParticiples, word)\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,uBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAgF,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAFhF,MAAM;EAACG,QAAQ;EAAEC;AAAuB,CAAC,GAAGC,yBAAkB;AAI9D;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,cAAcA,CAACC,UAAU,EAAE;EACjD,MAAMC,KAAK,GAAGL,QAAQ,CAACI,UAAU,CAAC;EAClC,MAAME,OAAO,GAAG,CACd,qEAAqE,EACrE,+HAA+H,CAChI;EAED,OAAOD,KAAK,CAACE,MAAM,CACjBC,IAAI,IACFP,uBAAuB,CAACO,IAAI,EAAEF,OAAO,CAAC,CAACG,MAAM,KAAK,CAAC,IAAI,IAAAC,gBAAQ,EAACC,+BAAoB,EAAEH,IAAI,CAC9F,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"getParticiples.js","names":["_lodash","require","_index","_passiveVoiceIrregulars","_interopRequireDefault","e","__esModule","default","getWords","matchRegularParticiples","languageProcessing","getParticiples","clauseText","words","regexes","filter","word","length","includes","irregularParticiples"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/getParticiples.js"],"sourcesContent":["import {includes} from 'lodash';\nimport {languageProcessing} from '../../../index';\nconst {getWords, matchRegularParticiples} = languageProcessing;\n\nimport irregularParticiples from '../../config/internal/passiveVoiceIrregulars';\n\n/**\n * Creates an array of participle for the participles found in a clause.\n *\n * @param {string} clauseText The clause text to find participles in.\n *\n * @returns {Array} The list with participle.\n */\nexport default function getParticiples(clauseText) {\n const words = getWords(clauseText);\n const regexes = [\n /^(ge|be|ont|ver|her|er)\\S+([dt])($|[ \\n\\r\\t.,'()\"+\\-;!?:/»«‹›<>])/gi,\n /^(aan|af|bij|binnen|los|mee|na|neer|om|onder|samen|terug|tegen|toe|uit|vast)(ge)\\S+([dtn])($|[ \\n\\r\\t.,'()\"+\\-;!?:/»«‹›<>])/gi\n ];\n\n return words.filter(\n word =>\n matchRegularParticiples(word, regexes).length !== 0 || includes(irregularParticiples, word)\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,uBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAgF,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAFhF,MAAM;EAACG,QAAQ;EAAEC;AAAuB,CAAC,GAAGC,yBAAkB;AAI9D;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,cAAcA,CAACC,UAAU,EAAE;EACjD,MAAMC,KAAK,GAAGL,QAAQ,CAACI,UAAU,CAAC;EAClC,MAAME,OAAO,GAAG,CACd,qEAAqE,EACrE,+HAA+H,CAChI;EAED,OAAOD,KAAK,CAACE,MAAM,CACjBC,IAAI,IACFP,uBAAuB,CAACO,IAAI,EAAEF,OAAO,CAAC,CAACG,MAAM,KAAK,CAAC,IAAI,IAAAC,gBAAQ,EAACC,+BAAoB,EAAEH,IAAI,CAC9F,CAAC;AACH","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.generateCorrectStemWithTAndDEnding = generateCorrectStemWithTAndDEnding;
7
- var _index = require("@axyseo/index");
7
+ var _index = require("../../../index");
8
8
  var _stemModificationHelpers = require("./stemModificationHelpers");
9
9
  const {
10
10
  regexHelpers: {
@@ -1 +1 @@
1
- {"version":3,"file":"getStemWordsWithTAndDEnding.js","names":["_index","require","_stemModificationHelpers","regexHelpers","searchAndReplaceWithRegex","doesWordMatchRegex","exceptionListHelpers","checkIfWordEndingIsOnExceptionList","checkIfWordIsOnListThatCanHavePrefix","languageProcessing","stemWordsWithEOrEnSuffix","morphologyDataNL","regexAndReplacement","word","stemmedWord","replace","RegExp","isVowelDoublingAllowed","regularStemmer","stemModifications","exceptionsStemModifications","pastParticipleStemmer","compoundVerbsPrefixes","replacement","doubleVowel","checkWhetherTOrDIsPartOfStem","tAndDPartOfStemData","ambiguousTAndDEndings","tOrDArePartOfStem","firstTOrDPartOfStem","verbsDenShouldBeStemmed","includes","slice","wordsStemOnlyEnEnding","endingMatch","verbs","denEnding","dIsPartOfStemRegex","deEnding","tIsPartOfStemRegex","teAndTenEndings","generateCorrectStemWithTAndDEnding","wordsTShouldBeStemmed","tEnding"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index';\nconst {\n regexHelpers: {searchAndReplaceWithRegex, doesWordMatchRegex},\n exceptionListHelpers: {checkIfWordEndingIsOnExceptionList, checkIfWordIsOnListThatCanHavePrefix}\n} = languageProcessing;\n\nimport {isVowelDoublingAllowed} from './stemModificationHelpers';\n\n/**\n * Checks whether the word ends in suffixes -e or -en which are preceded by -t or -d, and the -t/-d is part of the stem.\n * If it does, stem the -e/-en. Also checks if after suffix deletion the stemmed word needs modification, and applies it if\n * needed. e.g. doden -> dod -> dood\n *\n * @param {Object} \t\tmorphologyDataNL\t\t\t \tThe Dutch morphology data file.\n * @param {string[]} \tregexAndReplacement\t\t\t\tThe regex to check and the string replacement that should be made.\n * @param {string} \t\tword\t\t\t\t\t\t\tThe word to be checked.\n *\n * @returns {?string}\t\t\t\t\t\t\tThe stem created or null.\n */\nconst stemWordsWithEOrEnSuffix = function(morphologyDataNL, regexAndReplacement, word) {\n if (doesWordMatchRegex(word, regexAndReplacement[0])) {\n const stemmedWord = word.replace(new RegExp(regexAndReplacement[0]), regexAndReplacement[1]);\n if (\n isVowelDoublingAllowed(\n stemmedWord,\n morphologyDataNL.regularStemmer.stemModifications.exceptionsStemModifications,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n )\n ) {\n const replacement = searchAndReplaceWithRegex(\n stemmedWord,\n morphologyDataNL.regularStemmer.stemModifications.doubleVowel\n );\n return replacement ? replacement : stemmedWord;\n }\n return stemmedWord;\n }\n\n return null;\n};\n\n/**\n * Stems words for which we know that -t/-d is the ending of the stem (so the -t/-d is not stemmed). This is done through\n * checking lists of words and matching the word with regexes.\n *\n * @param {string}\tword\t\t\t\t\t\t\t\tThe word to check.\n * @param {Object} \tmorphologyDataNL \t\t\t\t\tThe Dutch morphology data.\n *\n * @returns {?string} \t\t\t\t\t\t\tThe stemmed word, if matched in one of the checks, or null if not matched.\n */\nconst checkWhetherTOrDIsPartOfStem = function(word, morphologyDataNL) {\n const tAndDPartOfStemData = morphologyDataNL.ambiguousTAndDEndings.tOrDArePartOfStem;\n /*\n * Step 1:\n * - If the stem ends in -tte, -tten, -dde or -dden leave the first -t/-d and stem the remaining ending.\n * - Example: \"katten\" (-ten should be stemmed, leaving \"kat\").\n */\n let stemmedWord = searchAndReplaceWithRegex(word, tAndDPartOfStemData.firstTOrDPartOfStem);\n\n if (stemmedWord) {\n return stemmedWord;\n }\n\n /*\n * Step 2:\n * 2a)\n * - Checks whether the word is in the exception list of verbal forms ending in long vowel + -fden/sden. If so, stems -den off.\n * - Example: \"hoefden\" (-den should be stemmed, leaving \"hoef\").\n * 2b)\n * - Check whether the word has the suffix -en preceded by -d, where the -d is part of the stem. If it is, stem only -en.\n * - Example: \"eenden\" (-en should be stemmed, leaving \"eend\").\n */\n if (tAndDPartOfStemData.verbsDenShouldBeStemmed.includes(word)) {\n return word.slice(0, -3);\n }\n\n if (\n checkIfWordEndingIsOnExceptionList(\n word,\n tAndDPartOfStemData.wordsStemOnlyEnEnding.endingMatch\n ) ||\n checkIfWordIsOnListThatCanHavePrefix(\n word,\n tAndDPartOfStemData.wordsStemOnlyEnEnding.verbs,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n ) ||\n doesWordMatchRegex(word, tAndDPartOfStemData.denEnding)\n ) {\n stemmedWord = word.slice(0, -2);\n //\tCheck if the vowel needs to be doubled after deleting suffix -en.\n if (\n isVowelDoublingAllowed(\n stemmedWord,\n morphologyDataNL.regularStemmer.stemModifications.exceptionsStemModifications,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n )\n ) {\n const replacement = searchAndReplaceWithRegex(\n stemmedWord,\n morphologyDataNL.regularStemmer.stemModifications.doubleVowel\n );\n return replacement ? replacement : stemmedWord;\n }\n return stemmedWord;\n }\n\n /*\n * Step 3:\n * - Checks whether the word matches the regex for words ending in -de with -d being part of the stem. If it is matched,\n * only stem the -e.\n * - Example: \"beenharde\" (-e should be stemmed, leaving \"beenhard\")\n */\n const dIsPartOfStemRegex = tAndDPartOfStemData.deEnding;\n stemmedWord = stemWordsWithEOrEnSuffix(morphologyDataNL, dIsPartOfStemRegex, word);\n\n if (stemmedWord) {\n return stemmedWord;\n }\n\n /*\n * Step 4:\n * - Checks whether the word matches the regex for words ending in -te or -ten with -t being part of the stem. If it is\n * matched, only stem the -e/-en.\n * - Example: \"castraten\" (-en should be stemmed, leaving \"castraat\")\n */\n const tIsPartOfStemRegex = tAndDPartOfStemData.teAndTenEndings;\n stemmedWord = stemWordsWithEOrEnSuffix(morphologyDataNL, tIsPartOfStemRegex, word);\n\n if (stemmedWord) {\n return stemmedWord;\n }\n\n return null;\n};\n\n/**\n * Creates the correct stem for words which end in ambiguous endings -t, -te, -ten, -de, or -den.\n *\n * @param {Object} \t\tmorphologyDataNL \t\t\t\t\tThe Dutch morphology data.\n * @param {string} \t\tword\t\t\t\t\t\t\t\tThe word to be checked.\n *\n * @returns {?string} \tThe stemmed word or null.\n */\nexport function generateCorrectStemWithTAndDEnding(morphologyDataNL, word) {\n /*\n * Step 1:\n * - Check whether the word is in the exception list of words in which -t ending needs to be stemmed. If it is, stem -t.\n * - Example: \"squasht\".\n * - This is an exception to one of the rule in step 2.\n */\n if (\n checkIfWordEndingIsOnExceptionList(\n word,\n morphologyDataNL.ambiguousTAndDEndings.wordsTShouldBeStemmed\n )\n ) {\n return word.slice(0, -1);\n }\n\n /*\n * Step 2:\n * - Check if word is matched by a regex for a t that shouldn't be stemmed.\n * - Example: \"boot\".\n */\n if (doesWordMatchRegex(word, morphologyDataNL.ambiguousTAndDEndings.tOrDArePartOfStem.tEnding)) {\n return word;\n }\n\n /*\n * Step 3:\n * - Check whether the word has another suffix that should be stemmed (e.g. -en) preceded by -t or -d which is part of the stem.\n * If yes, stem the suffix that should be stemmed and return the stem which ends in -t/-d.\n * - Example: \"tijden\" (only -en should be removed, not -den).\n */\n\n const stemmedWord = checkWhetherTOrDIsPartOfStem(word, morphologyDataNL);\n\n if (stemmedWord) {\n return stemmedWord;\n }\n\n return null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,wBAAA,GAAAD,OAAA;AALA,MAAM;EACJE,YAAY,EAAE;IAACC,yBAAyB;IAAEC;EAAkB,CAAC;EAC7DC,oBAAoB,EAAE;IAACC,kCAAkC;IAAEC;EAAoC;AACjG,CAAC,GAAGC,yBAAkB;AAItB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,SAAAA,CAASC,gBAAgB,EAAEC,mBAAmB,EAAEC,IAAI,EAAE;EACrF,IAAIR,kBAAkB,CAACQ,IAAI,EAAED,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE;IACpD,MAAME,WAAW,GAAGD,IAAI,CAACE,OAAO,CAAC,IAAIC,MAAM,CAACJ,mBAAmB,CAAC,CAAC,CAAC,CAAC,EA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ACC,iBAAiB,CAACe,OAAO,CAAC,EAAE;IAC9F,OAAO9B,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;;EAEE,MAAMC,WAAW,GAAGW,4BAA4B,CAACZ,IAAI,EAAEF,gBAAgB,CAAC;EAExE,IAAIG,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
1
+ {"version":3,"file":"getStemWordsWithTAndDEnding.js","names":["_index","require","_stemModificationHelpers","regexHelpers","searchAndReplaceWithRegex","doesWordMatchRegex","exceptionListHelpers","checkIfWordEndingIsOnExceptionList","checkIfWordIsOnListThatCanHavePrefix","languageProcessing","stemWordsWithEOrEnSuffix","morphologyDataNL","regexAndReplacement","word","stemmedWord","replace","RegExp","isVowelDoublingAllowed","regularStemmer","stemModifications","exceptionsStemModifications","pastParticipleStemmer","compoundVerbsPrefixes","replacement","doubleVowel","checkWhetherTOrDIsPartOfStem","tAndDPartOfStemData","ambiguousTAndDEndings","tOrDArePartOfStem","firstTOrDPartOfStem","verbsDenShouldBeStemmed","includes","slice","wordsStemOnlyEnEnding","endingMatch","verbs","denEnding","dIsPartOfStemRegex","deEnding","tIsPartOfStemRegex","teAndTenEndings","generateCorrectStemWithTAndDEnding","wordsTShouldBeStemmed","tEnding"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {\n regexHelpers: {searchAndReplaceWithRegex, doesWordMatchRegex},\n exceptionListHelpers: {checkIfWordEndingIsOnExceptionList, checkIfWordIsOnListThatCanHavePrefix}\n} = languageProcessing;\n\nimport {isVowelDoublingAllowed} from './stemModificationHelpers';\n\n/**\n * Checks whether the word ends in suffixes -e or -en which are preceded by -t or -d, and the -t/-d is part of the stem.\n * If it does, stem the -e/-en. Also checks if after suffix deletion the stemmed word needs modification, and applies it if\n * needed. e.g. doden -> dod -> dood\n *\n * @param {Object} \t\tmorphologyDataNL\t\t\t \tThe Dutch morphology data file.\n * @param {string[]} \tregexAndReplacement\t\t\t\tThe regex to check and the string replacement that should be made.\n * @param {string} \t\tword\t\t\t\t\t\t\tThe word to be checked.\n *\n * @returns {?string}\t\t\t\t\t\t\tThe stem created or null.\n */\nconst stemWordsWithEOrEnSuffix = function(morphologyDataNL, regexAndReplacement, word) {\n if (doesWordMatchRegex(word, regexAndReplacement[0])) {\n const stemmedWord = word.replace(new RegExp(regexAndReplacement[0]), regexAndReplacement[1]);\n if (\n isVowelDoublingAllowed(\n stemmedWord,\n morphologyDataNL.regularStemmer.stemModifications.exceptionsStemModifications,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n )\n ) {\n const replacement = searchAndReplaceWithRegex(\n stemmedWord,\n morphologyDataNL.regularStemmer.stemModifications.doubleVowel\n );\n return replacement ? replacement : stemmedWord;\n }\n return stemmedWord;\n }\n\n return null;\n};\n\n/**\n * Stems words for which we know that -t/-d is the ending of the stem (so the -t/-d is not stemmed). This is done through\n * checking lists of words and matching the word with regexes.\n *\n * @param {string}\tword\t\t\t\t\t\t\t\tThe word to check.\n * @param {Object} \tmorphologyDataNL \t\t\t\t\tThe Dutch morphology data.\n *\n * @returns {?string} \t\t\t\t\t\t\tThe stemmed word, if matched in one of the checks, or null if not matched.\n */\nconst checkWhetherTOrDIsPartOfStem = function(word, morphologyDataNL) {\n const tAndDPartOfStemData = morphologyDataNL.ambiguousTAndDEndings.tOrDArePartOfStem;\n /*\n * Step 1:\n * - If the stem ends in -tte, -tten, -dde or -dden leave the first -t/-d and stem the remaining ending.\n * - Example: \"katten\" (-ten should be stemmed, leaving \"kat\").\n */\n let stemmedWord = searchAndReplaceWithRegex(word, tAndDPartOfStemData.firstTOrDPartOfStem);\n\n if (stemmedWord) {\n return stemmedWord;\n }\n\n /*\n * Step 2:\n * 2a)\n * - Checks whether the word is in the exception list of verbal forms ending in long vowel + -fden/sden. If so, stems -den off.\n * - Example: \"hoefden\" (-den should be stemmed, leaving \"hoef\").\n * 2b)\n * - Check whether the word has the suffix -en preceded by -d, where the -d is part of the stem. If it is, stem only -en.\n * - Example: \"eenden\" (-en should be stemmed, leaving \"eend\").\n */\n if (tAndDPartOfStemData.verbsDenShouldBeStemmed.includes(word)) {\n return word.slice(0, -3);\n }\n\n if (\n checkIfWordEndingIsOnExceptionList(\n word,\n tAndDPartOfStemData.wordsStemOnlyEnEnding.endingMatch\n ) ||\n checkIfWordIsOnListThatCanHavePrefix(\n word,\n tAndDPartOfStemData.wordsStemOnlyEnEnding.verbs,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n ) ||\n doesWordMatchRegex(word, tAndDPartOfStemData.denEnding)\n ) {\n stemmedWord = word.slice(0, -2);\n //\tCheck if the vowel needs to be doubled after deleting suffix -en.\n if (\n isVowelDoublingAllowed(\n stemmedWord,\n morphologyDataNL.regularStemmer.stemModifications.exceptionsStemModifications,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n )\n ) {\n const replacement = searchAndReplaceWithRegex(\n stemmedWord,\n morphologyDataNL.regularStemmer.stemModifications.doubleVowel\n );\n return replacement ? replacement : stemmedWord;\n }\n return stemmedWord;\n }\n\n /*\n * Step 3:\n * - Checks whether the word matches the regex for words ending in -de with -d being part of the stem. If it is matched,\n * only stem the -e.\n * - Example: \"beenharde\" (-e should be stemmed, leaving \"beenhard\")\n */\n const dIsPartOfStemRegex = tAndDPartOfStemData.deEnding;\n stemmedWord = stemWordsWithEOrEnSuffix(morphologyDataNL, dIsPartOfStemRegex, word);\n\n if (stemmedWord) {\n return stemmedWord;\n }\n\n /*\n * Step 4:\n * - Checks whether the word matches the regex for words ending in -te or -ten with -t being part of the stem. If it is\n * matched, only stem the -e/-en.\n * - Example: \"castraten\" (-en should be stemmed, leaving \"castraat\")\n */\n const tIsPartOfStemRegex = tAndDPartOfStemData.teAndTenEndings;\n stemmedWord = stemWordsWithEOrEnSuffix(morphologyDataNL, tIsPartOfStemRegex, word);\n\n if (stemmedWord) {\n return stemmedWord;\n }\n\n return null;\n};\n\n/**\n * Creates the correct stem for words which end in ambiguous endings -t, -te, -ten, -de, or -den.\n *\n * @param {Object} \t\tmorphologyDataNL \t\t\t\t\tThe Dutch morphology data.\n * @param {string} \t\tword\t\t\t\t\t\t\t\tThe word to be checked.\n *\n * @returns {?string} \tThe stemmed word or null.\n */\nexport function generateCorrectStemWithTAndDEnding(morphologyDataNL, word) {\n /*\n * Step 1:\n * - Check whether the word is in the exception list of words in which -t ending needs to be stemmed. If it is, stem -t.\n * - Example: \"squasht\".\n * - This is an exception to one of the rule in step 2.\n */\n if (\n checkIfWordEndingIsOnExceptionList(\n word,\n morphologyDataNL.ambiguousTAndDEndings.wordsTShouldBeStemmed\n )\n ) {\n return word.slice(0, -1);\n }\n\n /*\n * Step 2:\n * - Check if word is matched by a regex for a t that shouldn't be stemmed.\n * - Example: \"boot\".\n */\n if (doesWordMatchRegex(word, morphologyDataNL.ambiguousTAndDEndings.tOrDArePartOfStem.tEnding)) {\n return word;\n }\n\n /*\n * Step 3:\n * - Check whether the word has another suffix that should be stemmed (e.g. -en) preceded by -t or -d which is part of the stem.\n * If yes, stem the suffix that should be stemmed and return the stem which ends in -t/-d.\n * - Example: \"tijden\" (only -en should be removed, not -den).\n */\n\n const stemmedWord = checkWhetherTOrDIsPartOfStem(word, morphologyDataNL);\n\n if (stemmedWord) {\n return stemmedWord;\n }\n\n return null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,wBAAA,GAAAD,OAAA;AALA,MAAM;EACJE,YAAY,EAAE;IAACC,yBAAyB;IAAEC;EAAkB,CAAC;EAC7DC,oBAAoB,EAAE;IAACC,kCAAkC;IAAEC;EAAoC;AACjG,CAAC,GAAGC,yBAAkB;AAItB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,SAAAA,CAASC,gBAAgB,EAAEC,mBAAmB,E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BAAqB,CAACe,qBACzC,CAAC,EACD;IACA,OAAO7B,IAAI,CAACmB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAC1B;;EAEA;AACF;AACA;AACA;AACA;EACE,IAAI3B,kBAAkB,CAACQ,IAAI,EAAEF,gBAAgB,CAACgB,qBAAqB,CAACC,iBAAiB,CAACe,OAAO,CAAC,EAAE;IAC9F,OAAO9B,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;;EAEE,MAAMC,WAAW,GAAGW,4BAA4B,CAACZ,IAAI,EAAEF,gBAAgB,CAAC;EAExE,IAAIG,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = stem;
7
- var _index = require("@axyseo/index");
7
+ var _index = require("../../../index");
8
8
  var _detectAndStemSuffixes = _interopRequireDefault(require("./detectAndStemSuffixes"));
9
9
  var _getStemWordsWithTAndDEnding = require("./getStemWordsWithTAndDEnding.js");
10
10
  var _checkExceptionsWithFullForms = _interopRequireDefault(require("./checkExceptionsWithFullForms"));
@@ -1 +1 @@
1
- {"version":3,"file":"stem.js","names":["_index","require","_detectAndStemSuffixes","_interopRequireDefault","_getStemWordsWithTAndDEnding","_checkExceptionsWithFullForms","_detectAndStemRegularParticiple","_stemModificationHelpers","e","__esModule","default","exceptionListHelpers","checkIfWordEndingIsOnExceptionList","checkIfWordIsOnListThatCanHavePrefix","stemHelpers","removeSuffixFromFullForm","removeSuffixesFromFullForm","languageProcessing","removeSuffixFromFullForms","morphologyDataNL","word","exceptionClass","stemExceptions","removeSuffixesFromFullForms","stemmedWord","forms","suffixes","suffix","checkOtherStemmingExceptions","stemFromFullForm","isVowelDoublingAllowed","regularStemmer","stemModifications","exceptionsStemModifications","pastParticipleStemmer","compoundVerbsPrefixes","modifyStem","doubleVowel","finalChanges","stem","checkExceptionsWithFullForms","detectAndStemRegularParticiple","wordsNotToBeStemmed","wordsNotToBeStemmedExceptions","verbs","endingMatch","exactMatch","includes","tAndDEndings","ambiguousTAndDEndings","otherTAndDEndings","ending","endsWith","generateCorrectStemWithTAndDEnding","detectAndStemSuffixes"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/stem.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index';\nconst {\n exceptionListHelpers: {checkIfWordEndingIsOnExceptionList, checkIfWordIsOnListThatCanHavePrefix},\n stemHelpers: {removeSuffixFromFullForm, removeSuffixesFromFullForm}\n} = languageProcessing;\n\nimport detectAndStemSuffixes from './detectAndStemSuffixes';\nimport {generateCorrectStemWithTAndDEnding} from './getStemWordsWithTAndDEnding.js';\nimport checkExceptionsWithFullForms from './checkExceptionsWithFullForms';\nimport {detectAndStemRegularParticiple} from './detectAndStemRegularParticiple';\nimport {modifyStem, isVowelDoublingAllowed} from './stemModificationHelpers';\n\n/**\n * Get the stem from noun diminutives and plurals exceptions.\n *\n * @param {Object} morphologyDataNL The data for stemming exception.\n * @param {string} word The word to check.\n *\n * @returns {string} The stemmed word.\n */\nconst removeSuffixFromFullForms = function(morphologyDataNL, word) {\n /*\n * Checks whether the word is in the exception list of words ending in -er and gets either -e or -s suffix\n * If it is, remove the corresponding suffix.\n * e.g. lekkere -> lekker, bitters -> bitter\n */\n for (const exceptionClass of morphologyDataNL.stemExceptions.removeSuffixesFromFullForms) {\n const stemmedWord = removeSuffixesFromFullForm(\n exceptionClass.forms,\n exceptionClass.suffixes,\n word\n );\n if (stemmedWord) {\n return stemmedWord;\n }\n }\n /*\n * Checks whether the word is in one of the exception lists of nouns\n * for which a specific suffix needs to be stemmed (e.g. -s, -es, -eren, -er etc.)\n * e.g. kuddes -> kud, modes -> mod, revenuen -> revenu\n */\n for (const exceptionClass of morphologyDataNL.stemExceptions.removeSuffixFromFullForms) {\n const stemmedWord = removeSuffixFromFullForm(exceptionClass.forms, exceptionClass.suffix, word);\n if (stemmedWord) {\n return stemmedWord;\n }\n }\n};\n\n/**\n * Checks if the word is on a stemming exception list.\n *\n * @param {string} word The word to check.\n * @param {Object} morphologyDataNL The Dutch morphology data file.\n * @returns {string|null} The stem or null if the word was not matched by any of the exception checks.\n */\nconst checkOtherStemmingExceptions = function(word, morphologyDataNL) {\n /*\n * Checks whether the word is in the exception list of nouns or adjectives with specific suffixes that needs to be stemmed.\n * If it is return the stem here and run possible stem modification if it is required. e.g. modes -> mod -> mood\n */\n let stemFromFullForm = removeSuffixFromFullForms(morphologyDataNL, word);\n if (stemFromFullForm) {\n if (\n isVowelDoublingAllowed(\n stemFromFullForm,\n morphologyDataNL.regularStemmer.stemModifications.exceptionsStemModifications,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n )\n ) {\n stemFromFullForm = modifyStem(\n stemFromFullForm,\n morphologyDataNL.regularStemmer.stemModifications.doubleVowel\n );\n return modifyStem(\n stemFromFullForm,\n morphologyDataNL.regularStemmer.stemModifications.finalChanges\n );\n }\n return modifyStem(\n stemFromFullForm,\n morphologyDataNL.regularStemmer.stemModifications.finalChanges\n );\n }\n return null;\n};\n\n/**\n * Stems Dutch words.\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyDataNL The Dutch morphology data file.\n *\n * @returns {string} The stemmed word.\n */\nexport default function stem(word, morphologyDataNL) {\n // Check whether the word is in the list of words with full forms for which we define the stem. If it is, return the canonical stem.\n let stemmedWord = checkExceptionsWithFullForms(morphologyDataNL, word);\n if (stemmedWord) {\n return stemmedWord;\n }\n\n // Check whether the word is a participle, and if yes, stem it and return the stem.\n stemmedWord = detectAndStemRegularParticiple(morphologyDataNL, word);\n if (stemmedWord) {\n return stemmedWord;\n }\n\n // Check whether the word is on the list of words that should not be stemmed, and if yes, return the word. Example: gans -> gans\n const wordsNotToBeStemmed = morphologyDataNL.stemExceptions.wordsNotToBeStemmedExceptions;\n if (\n checkIfWordIsOnListThatCanHavePrefix(\n word,\n wordsNotToBeStemmed.verbs,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n ) ||\n checkIfWordEndingIsOnExceptionList(word, wordsNotToBeStemmed.endingMatch) ||\n wordsNotToBeStemmed.exactMatch.includes(word)\n ) {\n return word;\n }\n\n /*\n * Check whether the word ends in -t/-te/-ten/-tend/-de/-den/-dend. If it does, run through a series of checks aimed at\n * predicting whether the -t/d is part of the stem or the suffix. If the word was matched in one of the checks, stem it\n * accordingly and return the stem. Example: boot -> boot, squasht -> squash\n */\n const tAndDEndings = morphologyDataNL.ambiguousTAndDEndings.otherTAndDEndings;\n for (const ending of tAndDEndings) {\n if (word.endsWith(ending)) {\n stemmedWord = generateCorrectStemWithTAndDEnding(morphologyDataNL, word);\n if (stemmedWord) {\n return stemmedWord;\n }\n }\n }\n\n // Check if the word is on any other stemming exception list, and if yes, return the correct stem.\n stemmedWord = checkOtherStemmingExceptions(word, morphologyDataNL);\n if (stemmedWord) {\n return stemmedWord;\n }\n\n // If the word was not stemmed in any of the previous steps, run through the stemming algorithm which detects and stems suffixes.\n return detectAndStemSuffixes(word, morphologyDataNL);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,4BAAA,GAAAH,OAAA;AACA,IAAAI,6BAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,+BAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AAA6E,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAT7E,MAAM;EACJG,oBAAoB,EAAE;IAACC,kCAAkC;IAAEC;EAAoC,CAAC;EAChGC,WAAW,EAAE;IAACC,wBAAwB;IAAEC;EAA0B;AACpE,CAAC,GAAGC,yBAAkB;AAQtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,yBAAyB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AAClC,IAAI,EAAED,gBAAgB,CAAC;AACtD","ignoreList":[]}
1
+ {"version":3,"file":"stem.js","names":["_index","require","_detectAndStemSuffixes","_interopRequireDefault","_getStemWordsWithTAndDEnding","_checkExceptionsWithFullForms","_detectAndStemRegularParticiple","_stemModificationHelpers","e","__esModule","default","exceptionListHelpers","checkIfWordEndingIsOnExceptionList","checkIfWordIsOnListThatCanHavePrefix","stemHelpers","removeSuffixFromFullForm","removeSuffixesFromFullForm","languageProcessing","removeSuffixFromFullForms","morphologyDataNL","word","exceptionClass","stemExceptions","removeSuffixesFromFullForms","stemmedWord","forms","suffixes","suffix","checkOtherStemmingExceptions","stemFromFullForm","isVowelDoublingAllowed","regularStemmer","stemModifications","exceptionsStemModifications","pastParticipleStemmer","compoundVerbsPrefixes","modifyStem","doubleVowel","finalChanges","stem","checkExceptionsWithFullForms","detectAndStemRegularParticiple","wordsNotToBeStemmed","wordsNotToBeStemmedExceptions","verbs","endingMatch","exactMatch","includes","tAndDEndings","ambiguousTAndDEndings","otherTAndDEndings","ending","endsWith","generateCorrectStemWithTAndDEnding","detectAndStemSuffixes"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/stem.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {\n exceptionListHelpers: {checkIfWordEndingIsOnExceptionList, checkIfWordIsOnListThatCanHavePrefix},\n stemHelpers: {removeSuffixFromFullForm, removeSuffixesFromFullForm}\n} = languageProcessing;\n\nimport detectAndStemSuffixes from './detectAndStemSuffixes';\nimport {generateCorrectStemWithTAndDEnding} from './getStemWordsWithTAndDEnding.js';\nimport checkExceptionsWithFullForms from './checkExceptionsWithFullForms';\nimport {detectAndStemRegularParticiple} from './detectAndStemRegularParticiple';\nimport {modifyStem, isVowelDoublingAllowed} from './stemModificationHelpers';\n\n/**\n * Get the stem from noun diminutives and plurals exceptions.\n *\n * @param {Object} morphologyDataNL The data for stemming exception.\n * @param {string} word The word to check.\n *\n * @returns {string} The stemmed word.\n */\nconst removeSuffixFromFullForms = function(morphologyDataNL, word) {\n /*\n * Checks whether the word is in the exception list of words ending in -er and gets either -e or -s suffix\n * If it is, remove the corresponding suffix.\n * e.g. lekkere -> lekker, bitters -> bitter\n */\n for (const exceptionClass of morphologyDataNL.stemExceptions.removeSuffixesFromFullForms) {\n const stemmedWord = removeSuffixesFromFullForm(\n exceptionClass.forms,\n exceptionClass.suffixes,\n word\n );\n if (stemmedWord) {\n return stemmedWord;\n }\n }\n /*\n * Checks whether the word is in one of the exception lists of nouns\n * for which a specific suffix needs to be stemmed (e.g. -s, -es, -eren, -er etc.)\n * e.g. kuddes -> kud, modes -> mod, revenuen -> revenu\n */\n for (const exceptionClass of morphologyDataNL.stemExceptions.removeSuffixFromFullForms) {\n const stemmedWord = removeSuffixFromFullForm(exceptionClass.forms, exceptionClass.suffix, word);\n if (stemmedWord) {\n return stemmedWord;\n }\n }\n};\n\n/**\n * Checks if the word is on a stemming exception list.\n *\n * @param {string} word The word to check.\n * @param {Object} morphologyDataNL The Dutch morphology data file.\n * @returns {string|null} The stem or null if the word was not matched by any of the exception checks.\n */\nconst checkOtherStemmingExceptions = function(word, morphologyDataNL) {\n /*\n * Checks whether the word is in the exception list of nouns or adjectives with specific suffixes that needs to be stemmed.\n * If it is return the stem here and run possible stem modification if it is required. e.g. modes -> mod -> mood\n */\n let stemFromFullForm = removeSuffixFromFullForms(morphologyDataNL, word);\n if (stemFromFullForm) {\n if (\n isVowelDoublingAllowed(\n stemFromFullForm,\n morphologyDataNL.regularStemmer.stemModifications.exceptionsStemModifications,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n )\n ) {\n stemFromFullForm = modifyStem(\n stemFromFullForm,\n morphologyDataNL.regularStemmer.stemModifications.doubleVowel\n );\n return modifyStem(\n stemFromFullForm,\n morphologyDataNL.regularStemmer.stemModifications.finalChanges\n );\n }\n return modifyStem(\n stemFromFullForm,\n morphologyDataNL.regularStemmer.stemModifications.finalChanges\n );\n }\n return null;\n};\n\n/**\n * Stems Dutch words.\n *\n * @param {string} word The word to stem.\n * @param {Object} morphologyDataNL The Dutch morphology data file.\n *\n * @returns {string} The stemmed word.\n */\nexport default function stem(word, morphologyDataNL) {\n // Check whether the word is in the list of words with full forms for which we define the stem. If it is, return the canonical stem.\n let stemmedWord = checkExceptionsWithFullForms(morphologyDataNL, word);\n if (stemmedWord) {\n return stemmedWord;\n }\n\n // Check whether the word is a participle, and if yes, stem it and return the stem.\n stemmedWord = detectAndStemRegularParticiple(morphologyDataNL, word);\n if (stemmedWord) {\n return stemmedWord;\n }\n\n // Check whether the word is on the list of words that should not be stemmed, and if yes, return the word. Example: gans -> gans\n const wordsNotToBeStemmed = morphologyDataNL.stemExceptions.wordsNotToBeStemmedExceptions;\n if (\n checkIfWordIsOnListThatCanHavePrefix(\n word,\n wordsNotToBeStemmed.verbs,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n ) ||\n checkIfWordEndingIsOnExceptionList(word, wordsNotToBeStemmed.endingMatch) ||\n wordsNotToBeStemmed.exactMatch.includes(word)\n ) {\n return word;\n }\n\n /*\n * Check whether the word ends in -t/-te/-ten/-tend/-de/-den/-dend. If it does, run through a series of checks aimed at\n * predicting whether the -t/d is part of the stem or the suffix. If the word was matched in one of the checks, stem it\n * accordingly and return the stem. Example: boot -> boot, squasht -> squash\n */\n const tAndDEndings = morphologyDataNL.ambiguousTAndDEndings.otherTAndDEndings;\n for (const ending of tAndDEndings) {\n if (word.endsWith(ending)) {\n stemmedWord = generateCorrectStemWithTAndDEnding(morphologyDataNL, word);\n if (stemmedWord) {\n return stemmedWord;\n }\n }\n }\n\n // Check if the word is on any other stemming exception list, and if yes, return the correct stem.\n stemmedWord = checkOtherStemmingExceptions(word, morphologyDataNL);\n if (stemmedWord) {\n return stemmedWord;\n }\n\n // If the word was not stemmed in any of the previous steps, run through the stemming algorithm which detects and stems suffixes.\n return detectAndStemSuffixes(word, morphologyDataNL);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,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,IAAI,CAAC,EAC7C;IACA,OAAOA,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACE,MAAM4B,YAAY,GAAG7B,gBAAgB,CAAC8B,qBAAqB,CAACC,iBAAiB;EAC7E,KAAK,MAAMC,MAAM,IAAIH,YAAY,EAAE;IACjC,IAAI5B,IAAI,CAACgC,QAAQ,CAACD,MAAM,CAAC,EAAE;MACzB3B,WAAW,GAAG,IAAA6B,+DAAkC,EAAClC,gBAAgB,EAAEC,IAAI,CAAC;MACxE,IAAII,WAAW,EAAE;QACf,OAAOA,WAAW;MACpB;IACF;EACF;;EAEA;EACAA,WAAW,GAAGI,4BAA4B,CAACR,IAAI,EAAED,gBAAgB,CAAC;EAClE,IAAIK,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;;EAEA;EACA,OAAO,IAAA8B,8BAAqB,EAAClC,IAAI,EAAED,gBAAgB,CAAC;AACtD","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.isVowelDoublingAllowed = isVowelDoublingAllowed;
7
7
  exports.modifyStem = modifyStem;
8
- var _index = require("@axyseo/index");
8
+ var _index = require("../../../index");
9
9
  const {
10
10
  exceptionListHelpers: {
11
11
  checkIfWordEndingIsOnExceptionList,
@@ -1 +1 @@
1
- {"version":3,"file":"stemModificationHelpers.js","names":["_index","require","exceptionListHelpers","checkIfWordEndingIsOnExceptionList","checkIfWordIsOnListThatCanHavePrefix","languageProcessing","checkIfWordIsOnNoVowelDoublingList","word","noVowelDoublingList","compoundVerbPrefixes","endingMatch","verbs","exactMatch","includes","isVowelPrecededByDoubleConsonant","fourthToLastLetter","charAt","length","thirdToLastLetter","doesPrecedingSyllableContainDiphthong","noVowelDoublingRegex","search","RegExp","modifyStem","modificationGroup","neededReplacement","find","replacement","replace","isVowelDoublingAllowed","morphologyDataNLStemmingExceptions","morphologyDataNLVerbPrefixes","firstCheck","getVowelDoubling","secondCheck","noVowelDoubling","thirdCheck","fourthCheck","rule"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index';\nconst {\n exceptionListHelpers: {checkIfWordEndingIsOnExceptionList, checkIfWordIsOnListThatCanHavePrefix}\n} = languageProcessing;\n\n/**\n * Checks whether the word is on any of the sub-lists of the noVowelDoublingList (ending match, exact match,\n * and verbs) and returns true if it is.\n *\n * @param {string}\tword\t\t\t\t\t\t\tThe word to check.\n * @param {Object}\tnoVowelDoublingList\tThe list of stems that should not have the vowel doubled.\n * @param {Object}\tcompoundVerbPrefixes\t\t\tThe list of inseparable and separable verb prefixes.\n *\n * @returns {boolean} Whether the word was found on one of the lists\n */\nconst checkIfWordIsOnNoVowelDoublingList = function(\n word,\n noVowelDoublingList,\n compoundVerbPrefixes\n) {\n if (\n checkIfWordEndingIsOnExceptionList(word, noVowelDoublingList.endingMatch) ||\n checkIfWordIsOnListThatCanHavePrefix(word, noVowelDoublingList.verbs, compoundVerbPrefixes) ||\n noVowelDoublingList.exactMatch.includes(word)\n ) {\n return true;\n }\n};\n\n/**\n * Checks whether the third to last and fourth to last characters of the stem are the same. This, in principle, checks\n * whether the last vowel of the stem is preceded by a double consonant (as only consonants can precede the vowel).\n * If the third and fourth to last characters are the same, it means that vowel doubling is allowed. For example, in the\n * word 'luttel', the third and fourth to last characters are both t's so it should not become 'lutteel'.\n *\n * @param {string} word The stemmed word to check.\n *\n * @returns {boolean} Whether the vowel should be doubled or not.\n */\nconst isVowelPrecededByDoubleConsonant = function(word) {\n const fourthToLastLetter = word.charAt(word.length - 4);\n const thirdToLastLetter = word.charAt(word.length - 3);\n return fourthToLastLetter !== thirdToLastLetter;\n};\n\n/**\n * Checks whether the second to last syllable contains a diphthong. If it does, the vowel in the last syllable should\n * not be doubled.\n *\n * @param {string} word The stemmed word to check.\n * @param {string} noVowelDoublingRegex The regex to match a word with.\n *\n * @returns {boolean} Whether the vowel should be doubled or not.\n */\nconst doesPrecedingSyllableContainDiphthong = function(word, noVowelDoublingRegex) {\n return word.search(new RegExp(noVowelDoublingRegex)) === -1;\n};\n\n/**\n * Modifies the stem of the word according to the specified modification type.\n *\n * @param {string} word The stem that needs to be modified.\n * @param {string[]} modificationGroup The type of modification that needs to be done.\n * @returns {string} The modified stem, or the same stem if no modification was made.\n */\nexport function modifyStem(word, modificationGroup) {\n const neededReplacement = modificationGroup.find(\n replacement => word.search(new RegExp(replacement[0])) !== -1\n );\n if (typeof neededReplacement !== 'undefined') {\n word = word.replace(new RegExp(neededReplacement[0]), neededReplacement[1]);\n }\n return word;\n}\n\n/**\n * Checks whether the final vowel of the stem should be doubled by going through four checks.\n *\n * @param {string} word The stemmed word that the check should be executed on.\n * @param {Object} morphologyDataNLStemmingExceptions The Dutch morphology data for stemming exceptions.\n * @param {Object} morphologyDataNLVerbPrefixes\t The separable and inseparable verb prefixes.\n *\n * @returns {boolean} Whether the vowel should be doubled or not.\n */\nexport function isVowelDoublingAllowed(\n word,\n morphologyDataNLStemmingExceptions,\n morphologyDataNLVerbPrefixes\n) {\n // Check whether the word is on the list of verbs which should have the vowel doubled (exception to third check)\n const firstCheck = checkIfWordIsOnListThatCanHavePrefix(\n word,\n morphologyDataNLStemmingExceptions.getVowelDoubling,\n morphologyDataNLVerbPrefixes\n );\n // Check whether the word is on the list of words which should NOT have the vowel doubled\n const secondCheck = checkIfWordIsOnNoVowelDoublingList(\n word,\n morphologyDataNLStemmingExceptions.noVowelDoubling,\n morphologyDataNLVerbPrefixes\n );\n const thirdCheck = isVowelPrecededByDoubleConsonant(word);\n const fourthCheck = doesPrecedingSyllableContainDiphthong(\n word,\n morphologyDataNLStemmingExceptions.noVowelDoubling.rule\n );\n\n return firstCheck || (!secondCheck && thirdCheck && fourthCheck);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,MAAM;EACJC,oBAAoB,EAAE;IAACC,kCAAkC;IAAEC;EAAoC;AACjG,CAAC,GAAGC,yBA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AAW,EAAE;IAC5ClB,IAAI,GAAGA,IAAI,CAACqB,OAAO,CAAC,IAAIN,MAAM,CAACG,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAEA,iBAAiB,CAAC,CAAC,CAAC,CAAC;EAC7E;EACA,OAAOlB,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASsB,sBAAsBA,CACpCtB,IAAI,EACJuB,kCAAkC,EAClCC,4BAA4B,EAC5B;EACA;EACA,MAAMC,UAAU,GAAG5B,oCAAoC,CACrDG,IAAI,EACJuB,kCAAkC,CAACG,gBAAgB,EACnDF,4BACF,CAAC;EACD;EACA,MAAMG,WAAW,GAAG5B,kCAAkC,CACpDC,IAAI,EACJuB,kCAAkC,CAACK,eAAe,EAClDJ,4BACF,CAAC;EACD,MAAMK,UAAU,GAAGtB,gCAAgC,CAACP,IAAI,CAAC;EACzD,MAAM8B,WAAW,GAAGlB,qCAAqC,CACvDZ,IAAI,EACJuB,kCAAkC,CAACK,eAAe,CAACG,IACrD,CAAC;EAED,OAAON,UAAU,IAAK,CAACE,WAAW,IAAIE,UAAU,IAAIC,WAAY;AAClE","ignoreList":[]}
1
+ {"version":3,"file":"stemModificationHelpers.js","names":["_index","require","exceptionListHelpers","checkIfWordEndingIsOnExceptionList","checkIfWordIsOnListThatCanHavePrefix","languageProcessing","checkIfWordIsOnNoVowelDoublingList","word","noVowelDoublingList","compoundVerbPrefixes","endingMatch","verbs","exactMatch","includes","isVowelPrecededByDoubleConsonant","fourthToLastLetter","charAt","length","thirdToLastLetter","doesPrecedingSyllableContainDiphthong","noVowelDoublingRegex","search","RegExp","modifyStem","modificationGroup","neededReplacement","find","replacement","replace","isVowelDoublingAllowed","morphologyDataNLStemmingExceptions","morphologyDataNLVerbPrefixes","firstCheck","getVowelDoubling","secondCheck","noVowelDoubling","thirdCheck","fourthCheck","rule"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {\n exceptionListHelpers: {checkIfWordEndingIsOnExceptionList, checkIfWordIsOnListThatCanHavePrefix}\n} = languageProcessing;\n\n/**\n * Checks whether the word is on any of the sub-lists of the noVowelDoublingList (ending match, exact match,\n * and verbs) and returns true if it is.\n *\n * @param {string}\tword\t\t\t\t\t\t\tThe word to check.\n * @param {Object}\tnoVowelDoublingList\tThe list of stems that should not have the vowel doubled.\n * @param {Object}\tcompoundVerbPrefixes\t\t\tThe list of inseparable and separable verb prefixes.\n *\n * @returns {boolean} Whether the word was found on one of the lists\n */\nconst checkIfWordIsOnNoVowelDoublingList = function(\n word,\n noVowelDoublingList,\n compoundVerbPrefixes\n) {\n if (\n checkIfWordEndingIsOnExceptionList(word, noVowelDoublingList.endingMatch) ||\n checkIfWordIsOnListThatCanHavePrefix(word, noVowelDoublingList.verbs, compoundVerbPrefixes) ||\n noVowelDoublingList.exactMatch.includes(word)\n ) {\n return true;\n }\n};\n\n/**\n * Checks whether the third to last and fourth to last characters of the stem are the same. This, in principle, checks\n * whether the last vowel of the stem is preceded by a double consonant (as only consonants can precede the vowel).\n * If the third and fourth to last characters are the same, it means that vowel doubling is allowed. For example, in the\n * word 'luttel', the third and fourth to last characters are both t's so it should not become 'lutteel'.\n *\n * @param {string} word The stemmed word to check.\n *\n * @returns {boolean} Whether the vowel should be doubled or not.\n */\nconst isVowelPrecededByDoubleConsonant = function(word) {\n const fourthToLastLetter = word.charAt(word.length - 4);\n const thirdToLastLetter = word.charAt(word.length - 3);\n return fourthToLastLetter !== thirdToLastLetter;\n};\n\n/**\n * Checks whether the second to last syllable contains a diphthong. If it does, the vowel in the last syllable should\n * not be doubled.\n *\n * @param {string} word The stemmed word to check.\n * @param {string} noVowelDoublingRegex The regex to match a word with.\n *\n * @returns {boolean} Whether the vowel should be doubled or not.\n */\nconst doesPrecedingSyllableContainDiphthong = function(word, noVowelDoublingRegex) {\n return word.search(new RegExp(noVowelDoublingRegex)) === -1;\n};\n\n/**\n * Modifies the stem of the word according to the specified modification type.\n *\n * @param {string} word The stem that needs to be modified.\n * @param {string[]} modificationGroup The type of modification that needs to be done.\n * @returns {string} The modified stem, or the same stem if no modification was made.\n */\nexport function modifyStem(word, modificationGroup) {\n const neededReplacement = modificationGroup.find(\n replacement => word.search(new RegExp(replacement[0])) !== -1\n );\n if (typeof neededReplacement !== 'undefined') {\n word = word.replace(new RegExp(neededReplacement[0]), neededReplacement[1]);\n }\n return word;\n}\n\n/**\n * Checks whether the final vowel of the stem should be doubled by going through four checks.\n *\n * @param {string} word The stemmed word that the check should be executed on.\n * @param {Object} morphologyDataNLStemmingExceptions The Dutch morphology data for stemming exceptions.\n * @param {Object} morphologyDataNLVerbPrefixes\t The separable and inseparable verb prefixes.\n *\n * @returns {boolean} Whether the vowel should be doubled or not.\n */\nexport function isVowelDoublingAllowed(\n word,\n morphologyDataNLStemmingExceptions,\n morphologyDataNLVerbPrefixes\n) {\n // Check whether the word is on the list of verbs which should have the vowel doubled (exception to third check)\n const firstCheck = checkIfWordIsOnListThatCanHavePrefix(\n word,\n morphologyDataNLStemmingExceptions.getVowelDoubling,\n morphologyDataNLVerbPrefixes\n );\n // Check whether the word is on the list of words which should NOT have the vowel doubled\n const secondCheck = checkIfWordIsOnNoVowelDoublingList(\n word,\n morphologyDataNLStemmingExceptions.noVowelDoubling,\n morphologyDataNLVerbPrefixes\n );\n const thirdCheck = isVowelPrecededByDoubleConsonant(word);\n const fourthCheck = doesPrecedingSyllableContainDiphthong(\n word,\n morphologyDataNLStemmingExceptions.noVowelDoubling.rule\n );\n\n return firstCheck || (!secondCheck && thirdCheck && fourthCheck);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,MAAM;EACJC,oBAAoB,EAAE;IAACC,kCAAkC;IAAEC;EAAoC;AACjG,CAAC,GAAGC,yBAAkB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kCAAkC,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,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAEA,iBAAiB,CAAC,CAAC,CAAC,CAAC;EAC7E;EACA,OAAOlB,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASsB,sBAAsBA,CACpCtB,IAAI,EACJuB,kCAAkC,EAClCC,4BAA4B,EAC5B;EACA;EACA,MAAMC,UAAU,GAAG5B,oCAAoC,CACrDG,IAAI,EACJuB,kCAAkC,CAACG,gBAAgB,EACnDF,4BACF,CAAC;EACD;EACA,MAAMG,WAAW,GAAG5B,kCAAkC,CACpDC,IAAI,EACJuB,kCAAkC,CAACK,eAAe,EAClDJ,4BACF,CAAC;EACD,MAAMK,UAAU,GAAGtB,gCAAgC,CAACP,IAAI,CAAC;EACzD,MAAM8B,WAAW,GAAGlB,qCAAqC,CACvDZ,IAAI,EACJuB,kCAAkC,CAACK,eAAe,CAACG,IACrD,CAAC;EAED,OAAON,UAAU,IAAK,CAACE,WAAW,IAAIE,UAAU,IAAIC,WAAY;AAClE","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.stemTOrDFromEndOfWord = stemTOrDFromEndOfWord;
7
- var _index = require("@axyseo/index");
7
+ var _index = require("../../../index");
8
8
  var _detectAndStemRegularParticiple = require("./detectAndStemRegularParticiple");
9
9
  var _getStemWordsWithTAndDEnding = require("./getStemWordsWithTAndDEnding");
10
10
  var _checkExceptionsWithFullForms = _interopRequireDefault(require("./checkExceptionsWithFullForms"));
@@ -1 +1 @@
1
- {"version":3,"file":"stemTOrDFromEndOfWord.js","names":["_index","require","_detectAndStemRegularParticiple","_getStemWordsWithTAndDEnding","_checkExceptionsWithFullForms","_interopRequireDefault","e","__esModule","default","exceptionListHelpers","checkIfWordEndingIsOnExceptionList","checkIfWordIsOnListThatCanHavePrefix","languageProcessing","checkIfTorDIsUnambiguous","morphologyDataNL","stemmedWord","word","wordsNotToBeStemmed","stemExceptions","wordsNotToBeStemmedExceptions","adjectivesEndingInRd","removeSuffixesFromFullForms","forms","wordsEndingInTOrDExceptionList","ambiguousTAndDEndings","tOrDArePartOfStem","doNotStemTOrD","detectAndStemRegularParticiple","generateCorrectStemWithTAndDEnding","verbs","pastParticipleStemmer","compoundVerbsPrefixes","endingMatch","exactMatch","includes","checkExceptionsWithFullForms","endsWith","stemTOrDFromEndOfWord","slice"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index';\nconst {\n exceptionListHelpers: {checkIfWordEndingIsOnExceptionList, checkIfWordIsOnListThatCanHavePrefix}\n} = languageProcessing;\n\nimport {detectAndStemRegularParticiple} from './detectAndStemRegularParticiple';\nimport {generateCorrectStemWithTAndDEnding} from './getStemWordsWithTAndDEnding';\nimport checkExceptionsWithFullForms from './checkExceptionsWithFullForms';\n\n/**\n * If the word ending in -t/-d was not matched in any of the checks for whether -t/-d should be stemmed or not, other checks still need\n * to be done in order to be sure whether we need to stem the word further or not.\n * If one of these checks returns true, we do not need to stem the word further.\n *\n * @param {Object} morphologyDataNL\tThe Dutch morphology data.\n * @param {string}\tstemmedWord\t\t\tThe stemmed word.\n * @param {string}\tword\t\t\t\tThe unstemmed word.\n * @returns {boolean}\tWhether one of the conditions returns true or not.\n */\nconst checkIfTorDIsUnambiguous = function(morphologyDataNL, stemmedWord, word) {\n const wordsNotToBeStemmed = morphologyDataNL.stemExceptions.wordsNotToBeStemmedExceptions;\n const adjectivesEndingInRd = morphologyDataNL.stemExceptions.removeSuffixesFromFullForms[1].forms;\n const wordsEndingInTOrDExceptionList =\n morphologyDataNL.ambiguousTAndDEndings.tOrDArePartOfStem.doNotStemTOrD;\n\n // Run the checks below. If one of the conditions returns true, return the stem.\n if (\n detectAndStemRegularParticiple(morphologyDataNL, word) ||\n generateCorrectStemWithTAndDEnding(morphologyDataNL, word) ||\n checkIfWordIsOnListThatCanHavePrefix(\n word,\n wordsNotToBeStemmed.verbs,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n ) ||\n checkIfWordEndingIsOnExceptionList(word, wordsNotToBeStemmed.endingMatch) ||\n wordsNotToBeStemmed.exactMatch.includes(word) ||\n adjectivesEndingInRd.includes(stemmedWord) ||\n checkExceptionsWithFullForms(morphologyDataNL, word) ||\n stemmedWord.endsWith('heid') ||\n checkIfWordEndingIsOnExceptionList(stemmedWord, wordsEndingInTOrDExceptionList)\n ) {\n return true;\n }\n};\n\n/**\n * If the word ending in -t/-d was not matched in any of the checks for whether -t/-d should be stemmed or not, and if it\n * is not a participle (which has its separate check), then it is still ambiguous whether -t/-d is part of the stem or a suffix.\n * Therefore, a second stem should be created with the -t/-d removed in case it was a suffix. For example, in the verb 'poolt',\n * -t is a suffix, but we could not predict in any of the previous checks that -t should be stemmed. To account for such cases,\n * we stem the -t here.\n *\n * @param {Object} morphologyDataNL\tThe Dutch morphology data.\n * @param {string}\tstemmedWord\t\t\tThe stemmed word.\n * @param {string}\tword\t\t\t\tThe unstemmed word.\n *\n * @returns {?string}\t\t\t\t The stemmed word or null if the -t/-d should not be stemmed.\n */\nexport function stemTOrDFromEndOfWord(morphologyDataNL, stemmedWord, word) {\n if (checkIfTorDIsUnambiguous(morphologyDataNL, stemmedWord, word)) {\n return null;\n }\n // If none of the conditions above is true, stem the t/d from the word.\n return stemmedWord.slice(0, -1);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,+BAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA0E,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAN1E,MAAM;EACJG,oBAAoB,EAAE;IAACC,kCAAkC;IAAEC;EAAoC;AACjG,CAAC,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W,CAACuB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjC","ignoreList":[]}
1
+ {"version":3,"file":"stemTOrDFromEndOfWord.js","names":["_index","require","_detectAndStemRegularParticiple","_getStemWordsWithTAndDEnding","_checkExceptionsWithFullForms","_interopRequireDefault","e","__esModule","default","exceptionListHelpers","checkIfWordEndingIsOnExceptionList","checkIfWordIsOnListThatCanHavePrefix","languageProcessing","checkIfTorDIsUnambiguous","morphologyDataNL","stemmedWord","word","wordsNotToBeStemmed","stemExceptions","wordsNotToBeStemmedExceptions","adjectivesEndingInRd","removeSuffixesFromFullForms","forms","wordsEndingInTOrDExceptionList","ambiguousTAndDEndings","tOrDArePartOfStem","doNotStemTOrD","detectAndStemRegularParticiple","generateCorrectStemWithTAndDEnding","verbs","pastParticipleStemmer","compoundVerbsPrefixes","endingMatch","exactMatch","includes","checkExceptionsWithFullForms","endsWith","stemTOrDFromEndOfWord","slice"],"sources":["../../../../../../src/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {\n exceptionListHelpers: {checkIfWordEndingIsOnExceptionList, checkIfWordIsOnListThatCanHavePrefix}\n} = languageProcessing;\n\nimport {detectAndStemRegularParticiple} from './detectAndStemRegularParticiple';\nimport {generateCorrectStemWithTAndDEnding} from './getStemWordsWithTAndDEnding';\nimport checkExceptionsWithFullForms from './checkExceptionsWithFullForms';\n\n/**\n * If the word ending in -t/-d was not matched in any of the checks for whether -t/-d should be stemmed or not, other checks still need\n * to be done in order to be sure whether we need to stem the word further or not.\n * If one of these checks returns true, we do not need to stem the word further.\n *\n * @param {Object} morphologyDataNL\tThe Dutch morphology data.\n * @param {string}\tstemmedWord\t\t\tThe stemmed word.\n * @param {string}\tword\t\t\t\tThe unstemmed word.\n * @returns {boolean}\tWhether one of the conditions returns true or not.\n */\nconst checkIfTorDIsUnambiguous = function(morphologyDataNL, stemmedWord, word) {\n const wordsNotToBeStemmed = morphologyDataNL.stemExceptions.wordsNotToBeStemmedExceptions;\n const adjectivesEndingInRd = morphologyDataNL.stemExceptions.removeSuffixesFromFullForms[1].forms;\n const wordsEndingInTOrDExceptionList =\n morphologyDataNL.ambiguousTAndDEndings.tOrDArePartOfStem.doNotStemTOrD;\n\n // Run the checks below. If one of the conditions returns true, return the stem.\n if (\n detectAndStemRegularParticiple(morphologyDataNL, word) ||\n generateCorrectStemWithTAndDEnding(morphologyDataNL, word) ||\n checkIfWordIsOnListThatCanHavePrefix(\n word,\n wordsNotToBeStemmed.verbs,\n morphologyDataNL.pastParticipleStemmer.compoundVerbsPrefixes\n ) ||\n checkIfWordEndingIsOnExceptionList(word, wordsNotToBeStemmed.endingMatch) ||\n wordsNotToBeStemmed.exactMatch.includes(word) ||\n adjectivesEndingInRd.includes(stemmedWord) ||\n checkExceptionsWithFullForms(morphologyDataNL, word) ||\n stemmedWord.endsWith('heid') ||\n checkIfWordEndingIsOnExceptionList(stemmedWord, wordsEndingInTOrDExceptionList)\n ) {\n return true;\n }\n};\n\n/**\n * If the word ending in -t/-d was not matched in any of the checks for whether -t/-d should be stemmed or not, and if it\n * is not a participle (which has its separate check), then it is still ambiguous whether -t/-d is part of the stem or a suffix.\n * Therefore, a second stem should be created with the -t/-d removed in case it was a suffix. For example, in the verb 'poolt',\n * -t is a suffix, but we could not predict in any of the previous checks that -t should be stemmed. To account for such cases,\n * we stem the -t here.\n *\n * @param {Object} morphologyDataNL\tThe Dutch morphology data.\n * @param {string}\tstemmedWord\t\t\tThe stemmed word.\n * @param {string}\tword\t\t\t\tThe unstemmed word.\n *\n * @returns {?string}\t\t\t\t The stemmed word or null if the -t/-d should not be stemmed.\n */\nexport function stemTOrDFromEndOfWord(morphologyDataNL, stemmedWord, word) {\n if (checkIfTorDIsUnambiguous(morphologyDataNL, stemmedWord, word)) {\n return null;\n }\n // If none of the conditions above is true, stem the t/d from the word.\n return stemmedWord.slice(0, -1);\n}\n"],"mappings":";;;;;;AAAA,IAAAA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AAW,EAAEQ,8BAA8B,CAAC,EAC/E;IACA,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASc,qBAAqBA,CAACvB,gBAAgB,EAAEC,WAAW,EAAEC,IAAI,EAAE;EACzE,IAAIH,wBAAwB,CAACC,gBAAgB,EAAEC,WAAW,EAAEC,IAAI,CAAC,EAAE;IACjE,OAAO,IAAI;EACb;EACA;EACA,OAAOD,WAAW,CAACuB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjC","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _lodash = require("lodash");
8
- var _index = require("@axyseo/index");
8
+ var _index = require("../../../index");
9
9
  var _functionWords = require("../config/functionWords");
10
10
  var _nonParticiples = _interopRequireDefault(require("../config/internal/nonParticiples"));
11
11
  var _getParticiples = _interopRequireDefault(require("../helpers/internal/getParticiples"));
@@ -1 +1 @@
1
- {"version":3,"file":"Clause.js","names":["_lodash","require","_index","_functionWords","_nonParticiples","_interopRequireDefault","_getParticiples","e","__esModule","default","directPrecedenceException","values","languageProcessing","Clause","DutchClause","constructor","clauseText","auxiliaries","_participles","getParticiples","getClauseText","checkParticiples","foundParticiples","filter","participle","includes","nonParticiples","hasNonParticipleEnding","cannotDirectlyPrecedePassiveParticiple","setPassive","length","test","_default","exports"],"sources":["../../../../../src/languageProcessing/languages/nl/values/Clause.js"],"sourcesContent":["import {includes} from 'lodash';\nimport {languageProcessing} from '@axyseo/index';\nconst {directPrecedenceException, values} = languageProcessing;\nconst {Clause} = values;\n\nimport {cannotDirectlyPrecedePassiveParticiple} from '../config/functionWords';\nimport nonParticiples from '../config/internal/nonParticiples';\nimport getParticiples from '../helpers/internal/getParticiples';\n\n/**\n * Creates a Clause object for the Dutch language.\n */\nclass DutchClause extends Clause {\n /**\n * Constructor.\n *\n * @param {string} clauseText The text of the clause.\n * @param {Array} auxiliaries The auxiliaries.\n *\n * @constructor\n */\n constructor(clauseText, auxiliaries) {\n super(clauseText, auxiliaries);\n this._participles = getParticiples(this.getClauseText());\n this.checkParticiples();\n }\n\n /**\n * Checks if any exceptions are applicable to this participle that would result in the clause not being passive.\n * If no exceptions are found and there is an auxiliary present, the clause is passive.\n *\n * @returns {void}\n */\n checkParticiples() {\n const foundParticiples = this.getParticiples().filter(participle => {\n return (\n !includes(nonParticiples, participle) &&\n !this.hasNonParticipleEnding(participle) &&\n !directPrecedenceException(\n this.getClauseText(),\n participle,\n cannotDirectlyPrecedePassiveParticiple\n )\n );\n });\n\n this.setPassive(foundParticiples.length > 0);\n }\n\n /**\n * Checks whether a found participle has a non-participle ending and is therefore not really a participle.\n *\n * @param {string} participle The participle to check.\n *\n * @returns {boolean} Returns true if the participle has a non-participle ending, otherwise returns false.\n */\n hasNonParticipleEnding(participle) {\n return /\\S+(heid|teit|tijd)($|[ \\n\\r\\t.,'()\"+\\-;!?:/»«‹›<>])/gi.test(participle);\n }\n}\n\nexport default DutchClause;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAIA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAAgE,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AALhE,MAAM;EAACG,yBAAyB;EAAEC;AAAM,CAAC,GAAGC,yBAAkB;AAC9D,MAAM;EAACC;AAAM,CAAC,GAAGF,MAAM;AAMvB;AACA;AACA;AACA,MAAMG,WAAW,SAASD,MAAM,CAAC;EAC/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,WAAWA,CAACC,UAAU,EAAEC,WAAW,EAAE;IACnC,KAAK,CAACD,UAAU,EAAEC,WAAW,CAAC;IAC9B,IAAI,CAACC,YAAY,GAAG,IAAAC,uBAAc,EAAC,IAAI,CAACC,aAAa,CAAC,CAAC,CAAC;IACxD,IAAI,CAACC,gBAAgB,CAAC,CAAC;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEA,gBAAgBA,CAAA,EAAG;IACjB,MAAMC,gBAAgB,GAAG,IAAI,CAACH,cAAc,CAAC,CAAC,CAACI,MAAM,CAACC,UAAU,IAAI;MAClE,OACE,CAAC,IAAAC,gBAAQ,EAACC,uBAAc,EAAEF,UAAU,CAAC,IACrC,CAAC,IAAI,CAACG,sBAAsB,CAACH,UAAU,CAAC,IACxC,CAACd,yBAAyB,CACxB,IAAI,CAACU,aAAa,CAAC,CAAC,EACpBI,UAAU,EACVI,qDACF,CAAC;IAEL,CAAC,CAAC;IAEF,IAAI,CAACC,UAAU,CAACP,gBAAgB,CAACQ,MAAM,GAAG,CAAC,CAAC;EAC9C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEH,sBAAsBA,CAACH,UAAU,EAAE;IACjC,OAAO,wDAAwD,CAACO,IAAI,CAACP,UAAU,CAAC;EAClF;AACF;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAEcK,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"Clause.js","names":["_lodash","require","_index","_functionWords","_nonParticiples","_interopRequireDefault","_getParticiples","e","__esModule","default","directPrecedenceException","values","languageProcessing","Clause","DutchClause","constructor","clauseText","auxiliaries","_participles","getParticiples","getClauseText","checkParticiples","foundParticiples","filter","participle","includes","nonParticiples","hasNonParticipleEnding","cannotDirectlyPrecedePassiveParticiple","setPassive","length","test","_default","exports"],"sources":["../../../../../src/languageProcessing/languages/nl/values/Clause.js"],"sourcesContent":["import {includes} from 'lodash';\nimport {languageProcessing} from '../../../index';\nconst {directPrecedenceException, values} = languageProcessing;\nconst {Clause} = values;\n\nimport {cannotDirectlyPrecedePassiveParticiple} from '../config/functionWords';\nimport nonParticiples from '../config/internal/nonParticiples';\nimport getParticiples from '../helpers/internal/getParticiples';\n\n/**\n * Creates a Clause object for the Dutch language.\n */\nclass DutchClause extends Clause {\n /**\n * Constructor.\n *\n * @param {string} clauseText The text of the clause.\n * @param {Array} auxiliaries The auxiliaries.\n *\n * @constructor\n */\n constructor(clauseText, auxiliaries) {\n super(clauseText, auxiliaries);\n this._participles = getParticiples(this.getClauseText());\n this.checkParticiples();\n }\n\n /**\n * Checks if any exceptions are applicable to this participle that would result in the clause not being passive.\n * If no exceptions are found and there is an auxiliary present, the clause is passive.\n *\n * @returns {void}\n */\n checkParticiples() {\n const foundParticiples = this.getParticiples().filter(participle => {\n return (\n !includes(nonParticiples, participle) &&\n !this.hasNonParticipleEnding(participle) &&\n !directPrecedenceException(\n this.getClauseText(),\n participle,\n cannotDirectlyPrecedePassiveParticiple\n )\n );\n });\n\n this.setPassive(foundParticiples.length > 0);\n }\n\n /**\n * Checks whether a found participle has a non-participle ending and is therefore not really a participle.\n *\n * @param {string} participle The participle to check.\n *\n * @returns {boolean} Returns true if the participle has a non-participle ending, otherwise returns false.\n */\n hasNonParticipleEnding(participle) {\n return /\\S+(heid|teit|tijd)($|[ \\n\\r\\t.,'()\"+\\-;!?:/»«‹›<>])/gi.test(participle);\n }\n}\n\nexport default DutchClause;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAIA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAAgE,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AALhE,MAAM;EAACG,yBAAyB;EAAEC;AAAM,CAAC,GAAGC,yBAAkB;AAC9D,MAAM;EAACC;AAAM,CAAC,GAAGF,MAAM;AAMvB;AACA;AACA;AACA,MAAMG,WAAW,SAASD,MAAM,CAAC;EAC/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,WAAWA,CAACC,UAAU,EAAEC,WAAW,EAAE;IACnC,KAAK,CAACD,UAAU,EAAEC,WAAW,CAAC;IAC9B,IAAI,CAACC,YAAY,GAAG,IAAAC,uBAAc,EAAC,IAAI,CAACC,aAAa,CAAC,CAAC,CAAC;IACxD,IAAI,CAACC,gBAAgB,CAAC,CAAC;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEA,gBAAgBA,CAAA,EAAG;IACjB,MAAMC,gBAAgB,GAAG,IAAI,CAACH,cAAc,CAAC,CAAC,CAACI,MAAM,CAACC,UAAU,IAAI;MAClE,OACE,CAAC,IAAAC,gBAAQ,EAACC,uBAAc,EAAEF,UAAU,CAAC,IACrC,CAAC,IAAI,CAACG,sBAAsB,CAACH,UAAU,CAAC,IACxC,CAACd,yBAAyB,CACxB,IAAI,CAACU,aAAa,CAAC,CAAC,EACpBI,UAAU,EACVI,qDACF,CAAC;IAEL,CAAC,CAAC;IAEF,IAAI,CAACC,UAAU,CAACP,gBAAgB,CAACQ,MAAM,GAAG,CAAC,CAAC;EAC9C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEH,sBAAsBA,CAACH,UAAU,EAAE;IACjC,OAAO,wDAAwD,CAACO,IAAI,CAACP,UAAU,CAAC;EAClF;AACF;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAEcK,WAAW","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _index = require("@axyseo/index");
7
+ var _index = require("../../../index");
8
8
  var _firstWordExceptions = _interopRequireDefault(require("./config/firstWordExceptions"));
9
9
  var _functionWords = require("./config/functionWords");
10
10
  var _stopWords = _interopRequireDefault(require("./config/stopWords"));
@@ -1 +1 @@
1
- {"version":3,"file":"Researcher.js","names":["_index","require","_firstWordExceptions","_interopRequireDefault","_functionWords","_stopWords","_transitionWords","_twoPartTransitionWords","_sentenceLength","_getClauses","_getStemmer","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","Object","assign","config","language","passiveConstructionType","firstWordExceptions","functionWords","stopWords","transitionWords","twoPartTransitionWords","sentenceLength","helpers","getClauses","getStemmer","exports"],"sources":["../../../../src/languageProcessing/languages/pl/Researcher.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index';\nconst {AbstractResearcher} = languageProcessing;\n\n// All config\nimport firstWordExceptions from './config/firstWordExceptions';\nimport {all as functionWords} from './config/functionWords';\nimport stopWords from './config/stopWords';\nimport transitionWords from './config/transitionWords';\nimport twoPartTransitionWords from './config/twoPartTransitionWords';\nimport sentenceLength from './config/sentenceLength';\n\n// All helpers\nimport getClauses from './helpers/getClauses';\nimport getStemmer from './helpers/getStemmer';\n\n/**\n * The researcher contains all the researches, helpers, data, and config.\n */\nexport default class Researcher extends AbstractResearcher {\n /**\n * Constructor\n * @param {Paper} paper The Paper object that is needed within the researches.\n * @constructor\n */\n constructor(paper) {\n super(paper);\n\n // Delete a research(es) that is not available in Polish\n delete this.defaultResearches.getFleschReadingScore;\n\n Object.assign(this.config, {\n language: 'pl',\n passiveConstructionType: 'periphrastic',\n firstWordExceptions,\n functionWords,\n stopWords,\n transitionWords,\n twoPartTransitionWords,\n sentenceLength: sentenceLength\n });\n\n Object.assign(this.helpers, {\n getClauses,\n getStemmer\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,uBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,eAAA,GAAAL,sBAAA,CAAAF,OAAA;AAGA,IAAAQ,WAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,WAAA,GAAAP,sBAAA,CAAAF,OAAA;AAA8C,SAAAE,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAZ9C,MAAM;EAACG;AAAkB,CAAC,GAAGC,yBAAkB;;AAE/C;;AAQA;;AAIA;AACA;AACA;AACe,MAAMC,UAAU,SAASF,kBAAkB,CAAC;EACzD;AACF;AACA;AACA;AACA;EACEG,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;;IAEZ;IACA,OAAO,IAAI,CAACC,iBAAiB,CAACC,qBAAqB;IAEnDC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACC,MAAM,EAAE;MACzBC,QAAQ,EAAE,IAAI;MACdC,uBAAuB,EAAE,cAAc;MACvCC,mBAAmB,EAAnBA,4BAAmB;MACnBC,aAAa,EAAbA,kBAAa;MACbC,SAAS,EAATA,kBAAS;MACTC,eAAe,EAAfA,wBAAe;MACfC,sBAAsB,EAAtBA,+BAAsB;MACtBC,cAAc,EAAEA;IAClB,CAAC,CAAC;IAEFV,MAAM,CAACC,MAAM,CAAC,IAAI,CAACU,OAAO,EAAE;MAC1BC,UAAU,EAAVA,mBAAU;MACVC,UAAU,EAAVA;IACF,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAtB,OAAA,GAAAG,UAAA","ignoreList":[]}
1
+ {"version":3,"file":"Researcher.js","names":["_index","require","_firstWordExceptions","_interopRequireDefault","_functionWords","_stopWords","_transitionWords","_twoPartTransitionWords","_sentenceLength","_getClauses","_getStemmer","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","Object","assign","config","language","passiveConstructionType","firstWordExceptions","functionWords","stopWords","transitionWords","twoPartTransitionWords","sentenceLength","helpers","getClauses","getStemmer","exports"],"sources":["../../../../src/languageProcessing/languages/pl/Researcher.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {AbstractResearcher} = languageProcessing;\n\n// All config\nimport firstWordExceptions from './config/firstWordExceptions';\nimport {all as functionWords} from './config/functionWords';\nimport stopWords from './config/stopWords';\nimport transitionWords from './config/transitionWords';\nimport twoPartTransitionWords from './config/twoPartTransitionWords';\nimport sentenceLength from './config/sentenceLength';\n\n// All helpers\nimport getClauses from './helpers/getClauses';\nimport getStemmer from './helpers/getStemmer';\n\n/**\n * The researcher contains all the researches, helpers, data, and config.\n */\nexport default class Researcher extends AbstractResearcher {\n /**\n * Constructor\n * @param {Paper} paper The Paper object that is needed within the researches.\n * @constructor\n */\n constructor(paper) {\n super(paper);\n\n // Delete a research(es) that is not available in Polish\n delete this.defaultResearches.getFleschReadingScore;\n\n Object.assign(this.config, {\n language: 'pl',\n passiveConstructionType: 'periphrastic',\n firstWordExceptions,\n functionWords,\n stopWords,\n transitionWords,\n twoPartTransitionWords,\n sentenceLength: sentenceLength\n });\n\n Object.assign(this.helpers, {\n getClauses,\n getStemmer\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,uBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,eAAA,GAAAL,sBAAA,CAAAF,OAAA;AAGA,IAAAQ,WAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,WAAA,GAAAP,sBAAA,CAAAF,OAAA;AAA8C,SAAAE,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAZ9C,MAAM;EAACG;AAAkB,CAAC,GAAGC,yBAAkB;;AAE/C;;AAQA;;AAIA;AACA;AACA;AACe,MAAMC,UAAU,SAASF,kBAAkB,CAAC;EACzD;AACF;AACA;AACA;AACA;EACEG,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;;IAEZ;IACA,OAAO,IAAI,CAACC,iBAAiB,CAACC,qBAAqB;IAEnDC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACC,MAAM,EAAE;MACzBC,QAAQ,EAAE,IAAI;MACdC,uBAAuB,EAAE,cAAc;MACvCC,mBAAmB,EAAnBA,4BAAmB;MACnBC,aAAa,EAAbA,kBAAa;MACbC,SAAS,EAATA,kBAAS;MACTC,eAAe,EAAfA,wBAAe;MACfC,sBAAsB,EAAtBA,+BAAsB;MACtBC,cAAc,EAAEA;IAClB,CAAC,CAAC;IAEFV,MAAM,CAACC,MAAM,CAAC,IAAI,CAACU,OAAO,EAAE;MAC1BC,UAAU,EAAVA,mBAAU;MACVC,UAAU,EAAVA;IACF,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAtB,OAAA,GAAAG,UAAA","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = getClauses;
7
- var _index = require("@axyseo/index");
7
+ var _index = require("../../../index");
8
8
  var _Clause = _interopRequireDefault(require("../values/Clause"));
9
9
  var _auxiliaries = _interopRequireDefault(require("../config/internal/auxiliaries.js"));
10
10
  var _stopWords = _interopRequireDefault(require("../config/stopWords.js"));
@@ -1 +1 @@
1
- {"version":3,"file":"getClauses.js","names":["_index","require","_Clause","_interopRequireDefault","_auxiliaries","_stopWords","e","__esModule","default","getClausesSplitOnStopWords","createRegexFromArray","languageProcessing","options","Clause","regexes","auxiliaryRegex","auxiliaries","stopwordRegex","stopwords","getClauses","sentence"],"sources":["../../../../../src/languageProcessing/languages/pl/helpers/getClauses.js"],"sourcesContent":["import {languageProcessing} from '@axyseo/index';\nconst {getClausesSplitOnStopWords, createRegexFromArray} = languageProcessing;\n\nimport Clause from '../values/Clause';\nimport auxiliaries from '../config/internal/auxiliaries.js';\nimport stopwords from '../config/stopWords.js';\n\nconst options = {\n Clause,\n regexes: {\n auxiliaryRegex: createRegexFromArray(auxiliaries),\n stopwordRegex: createRegexFromArray(stopwords)\n }\n};\n\n/**\n * Gets the sentence parts from a sentence by determining sentence breakers.\n *\n * @param {string} sentence The sentence to split up in sentence parts.\n *\n * @returns {Array} The array with all parts of a sentence that have an auxiliary.\n */\nexport default function getClauses(sentence) {\n return getClausesSplitOnStopWords(sentence, options);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA+C,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAJ/C,MAAM;EAACG,0BAA0B;EAAEC;AAAoB,CAAC,GAAGC,yBAAkB;AAM7E,MAAMC,OAAO,GAAG;EACdC,MAAM,EAANA,eAAM;EACNC,OAAO,EAAE;IACPC,cAAc,EAAEL,oBAAoB,CAACM,oBAAW,CAAC;IACjDC,aAAa,EAAEP,oBAAoB,CAACQ,kBAAS;EAC/C;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CAACC,QAAQ,EAAE;EAC3C,OAAOX,0BAA0B,CAACW,QAAQ,EAAER,OAAO,CAAC;AACtD","ignoreList":[]}
1
+ {"version":3,"file":"getClauses.js","names":["_index","require","_Clause","_interopRequireDefault","_auxiliaries","_stopWords","e","__esModule","default","getClausesSplitOnStopWords","createRegexFromArray","languageProcessing","options","Clause","regexes","auxiliaryRegex","auxiliaries","stopwordRegex","stopwords","getClauses","sentence"],"sources":["../../../../../src/languageProcessing/languages/pl/helpers/getClauses.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {getClausesSplitOnStopWords, createRegexFromArray} = languageProcessing;\n\nimport Clause from '../values/Clause';\nimport auxiliaries from '../config/internal/auxiliaries.js';\nimport stopwords from '../config/stopWords.js';\n\nconst options = {\n Clause,\n regexes: {\n auxiliaryRegex: createRegexFromArray(auxiliaries),\n stopwordRegex: createRegexFromArray(stopwords)\n }\n};\n\n/**\n * Gets the sentence parts from a sentence by determining sentence breakers.\n *\n * @param {string} sentence The sentence to split up in sentence parts.\n *\n * @returns {Array} The array with all parts of a sentence that have an auxiliary.\n */\nexport default function getClauses(sentence) {\n return getClausesSplitOnStopWords(sentence, options);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA+C,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAJ/C,MAAM;EAACG,0BAA0B;EAAEC;AAAoB,CAAC,GAAGC,yBAAkB;AAM7E,MAAMC,OAAO,GAAG;EACdC,MAAM,EAANA,eAAM;EACNC,OAAO,EAAE;IACPC,cAAc,EAAEL,oBAAoB,CAACM,oBAAW,CAAC;IACjDC,aAAa,EAAEP,oBAAoB,CAACQ,kBAAS;EAC/C;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CAACC,QAAQ,EAAE;EAC3C,OAAOX,0BAA0B,CAACW,QAAQ,EAAER,OAAO,CAAC;AACtD","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = getStemmer;
7
7
  var _lodash = require("lodash");
8
- var _index = require("@axyseo/index");
8
+ var _index = require("../../../index");
9
9
  var _stem = _interopRequireDefault(require("./internal/stem"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"getStemmer.js","names":["_lodash","require","_index","_stem","_interopRequireDefault","e","__esModule","default","baseStemmer","languageProcessing","getStemmer","researcher","morphologyData","get","getData","word","stem"],"sources":["../../../../../src/languageProcessing/languages/pl/helpers/getStemmer.js"],"sourcesContent":["import {get} from 'lodash';\nimport {languageProcessing} from '@axyseo/index';\nconst {baseStemmer} = languageProcessing;\n\nimport stem from './internal/stem';\n\n/**\n * Returns the stemmer for a researcher.\n *\n * @param {Researcher} researcher The researcher.\n *\n * @returns {Function} The stemmer.\n */\nexport default function getStemmer(researcher) {\n const morphologyData = get(researcher.getData('morphology'), 'pl', false);\n\n if (morphologyData) {\n return word => stem(word, morphologyData);\n }\n\n return baseStemmer;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAmC,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAFnC,MAAM;EAACG;AAAW,CAAC,GAAGC,yBAAkB;AAIxC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CAACC,UAAU,EAAE;EAC7C,MAAMC,cAAc,GAAG,IAAAC,WAAG,EAACF,UAAU,CAACG,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC;EAEzE,IAAIF,cAAc,EAAE;IAClB,OAAOG,IAAI,IAAI,IAAAC,aAAI,EAACD,IAAI,EAAEH,cAAc,CAAC;EAC3C;EAEA,OAAOJ,WAAW;AACpB","ignoreList":[]}
1
+ {"version":3,"file":"getStemmer.js","names":["_lodash","require","_index","_stem","_interopRequireDefault","e","__esModule","default","baseStemmer","languageProcessing","getStemmer","researcher","morphologyData","get","getData","word","stem"],"sources":["../../../../../src/languageProcessing/languages/pl/helpers/getStemmer.js"],"sourcesContent":["import {get} from 'lodash';\nimport {languageProcessing} from '../../../index';\nconst {baseStemmer} = languageProcessing;\n\nimport stem from './internal/stem';\n\n/**\n * Returns the stemmer for a researcher.\n *\n * @param {Researcher} researcher The researcher.\n *\n * @returns {Function} The stemmer.\n */\nexport default function getStemmer(researcher) {\n const morphologyData = get(researcher.getData('morphology'), 'pl', false);\n\n if (morphologyData) {\n return word => stem(word, morphologyData);\n }\n\n return baseStemmer;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAmC,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAFnC,MAAM;EAACG;AAAW,CAAC,GAAGC,yBAAkB;AAIxC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CAACC,UAAU,EAAE;EAC7C,MAAMC,cAAc,GAAG,IAAAC,WAAG,EAACF,UAAU,CAACG,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC;EAEzE,IAAIF,cAAc,EAAE;IAClB,OAAOG,IAAI,IAAI,IAAAC,aAAI,EAACD,IAAI,EAAEH,cAAc,CAAC;EAC3C;EAEA,OAAOJ,WAAW;AACpB","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = getParticiples;
7
7
  var _lodash = require("lodash");
8
- var _index = require("@axyseo/index");
8
+ var _index = require("../../../index");
9
9
  var _participles = _interopRequireDefault(require("../../config/internal/participles"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"getParticiples.js","names":["_lodash","require","_index","_participles","_interopRequireDefault","e","__esModule","default","getWords","languageProcessing","getParticiples","clauseText","words","filter","word","includes","participles"],"sources":["../../../../../../src/languageProcessing/languages/pl/helpers/internal/getParticiples.js"],"sourcesContent":["import {includes} from 'lodash';\nimport {languageProcessing} from '@axyseo/index';\nconst {getWords} = languageProcessing;\n\nimport participles from '../../config/internal/participles';\n\n/**\n * Creates an array of participles for the participles found in a clause.\n *\n * @param {string} clauseText The sentence part to find participles in.\n *\n * @returns {Array} The list with participles.\n */\nexport default function getParticiples(clauseText) {\n const words = getWords(clauseText);\n\n return words.filter(word => includes(participles, word));\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA4D,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAF5D,MAAM;EAACG;AAAQ,CAAC,GAAGC,yBAAkB;AAIrC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,cAAcA,CAACC,UAAU,EAAE;EACjD,MAAMC,KAAK,GAAGJ,QAAQ,CAACG,UAAU,CAAC;EAElC,OAAOC,KAAK,CAACC,MAAM,CAACC,IAAI,IAAI,IAAAC,gBAAQ,EAACC,oBAAW,EAAEF,IAAI,CAAC,CAAC;AAC1D","ignoreList":[]}
1
+ {"version":3,"file":"getParticiples.js","names":["_lodash","require","_index","_participles","_interopRequireDefault","e","__esModule","default","getWords","languageProcessing","getParticiples","clauseText","words","filter","word","includes","participles"],"sources":["../../../../../../src/languageProcessing/languages/pl/helpers/internal/getParticiples.js"],"sourcesContent":["import {includes} from 'lodash';\nimport {languageProcessing} from '../../../index';\nconst {getWords} = languageProcessing;\n\nimport participles from '../../config/internal/participles';\n\n/**\n * Creates an array of participles for the participles found in a clause.\n *\n * @param {string} clauseText The sentence part to find participles in.\n *\n * @returns {Array} The list with participles.\n */\nexport default function getParticiples(clauseText) {\n const words = getWords(clauseText);\n\n return words.filter(word => includes(participles, word));\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA4D,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAF5D,MAAM;EAACG;AAAQ,CAAC,GAAGC,yBAAkB;AAIrC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,cAAcA,CAACC,UAAU,EAAE;EACjD,MAAMC,KAAK,GAAGJ,QAAQ,CAACG,UAAU,CAAC;EAElC,OAAOC,KAAK,CAACC,MAAM,CAACC,IAAI,IAAI,IAAAC,gBAAQ,EAACC,oBAAW,EAAEF,IAAI,CAAC,CAAC;AAC1D","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _getParticiples = _interopRequireDefault(require("../helpers/internal/getParticiples.js"));
8
- var _index = require("@axyseo/index");
8
+ var _index = require("../../../index");
9
9
  var _functionWords = require("../config/functionWords");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"Clause.js","names":["_getParticiples","_interopRequireDefault","require","_index","_functionWords","e","__esModule","default","nonDirectPrecedenceException","directPrecedenceException","values","languageProcessing","Clause","PolishClause","constructor","clauseText","auxiliaries","_participles","getParticiples","getClauseText","checkParticiples","clause","getAuxiliaries","passiveParticiples","filter","participle","cannotDirectlyPrecedePassiveParticiple","cannotBeBetweenPassiveAuxiliaryAndParticiple","setPassive","length","_default","exports"],"sources":["../../../../../src/languageProcessing/languages/pl/values/Clause.js"],"sourcesContent":["import getParticiples from '../helpers/internal/getParticiples.js';\nimport {languageProcessing} from '@axyseo/index';\nconst {nonDirectPrecedenceException, directPrecedenceException, values} = languageProcessing;\nconst {Clause} = values;\nimport {\n cannotBeBetweenPassiveAuxiliaryAndParticiple,\n cannotDirectlyPrecedePassiveParticiple\n} from '../config/functionWords';\n\n/**\n * Creates a Clause object for the Polish language.\n */\nclass PolishClause extends Clause {\n /**\n * Constructor.\n *\n * @param {string} clauseText The text of the clause.\n * @param {Array} auxiliaries The auxiliaries.\n *\n * @constructor\n */\n constructor(clauseText, auxiliaries) {\n super(clauseText, auxiliaries);\n this._participles = getParticiples(this.getClauseText());\n this.checkParticiples();\n }\n\n /**\n * Checks if any exceptions are applicable to this participle that would result in the clause not being passive.\n * If no exceptions are found, the clause is passive.\n *\n * @returns {boolean} Returns true if no exception is found.\n */\n checkParticiples() {\n const clause = this.getClauseText();\n const auxiliaries = this.getAuxiliaries();\n\n const passiveParticiples = this.getParticiples().filter(\n participle =>\n !directPrecedenceException(clause, participle, cannotDirectlyPrecedePassiveParticiple) &&\n !nonDirectPrecedenceException(\n clause,\n participle,\n auxiliaries,\n cannotBeBetweenPassiveAuxiliaryAndParticiple\n )\n );\n\n this.setPassive(passiveParticiples.length > 0);\n }\n}\n\nexport default PolishClause;\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,cAAA,GAAAF,OAAA;AAGiC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AALjC,MAAM;EAACG,4BAA4B;EAAEC,yBAAyB;EAAEC;AAAM,CAAC,GAAGC,yBAAkB;AAC5F,MAAM;EAACC;AAAM,CAAC,GAAGF,MAAM;AAMvB;AACA;AACA;AACA,MAAMG,YAAY,SAASD,MAAM,CAAC;EAChC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,WAAWA,CAACC,UAAU,EAAEC,WAAW,EAAE;IACnC,KAAK,CAACD,UAAU,EAAEC,WAAW,CAAC;IAC9B,IAAI,CAACC,YAAY,GAAG,IAAAC,uBAAc,EAAC,IAAI,CAACC,aAAa,CAAC,CAAC,CAAC;IACxD,IAAI,CAACC,gBAAgB,CAAC,CAAC;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEA,gBAAgBA,CAAA,EAAG;IACjB,MAAMC,MAAM,GAAG,IAAI,CAACF,aAAa,CAAC,CAAC;IACnC,MAAMH,WAAW,GAAG,IAAI,CAACM,cAAc,CAAC,CAAC;IAEzC,MAAMC,kBAAkB,GAAG,IAAI,CAACL,cAAc,CAAC,CAAC,CAACM,MAAM,CACrDC,UAAU,IACR,CAAChB,yBAAyB,CAACY,MAAM,EAAEI,UAAU,EAAEC,qDAAsC,CAAC,IACtF,CAAClB,4BAA4B,CAC3Ba,MAAM,EACNI,UAAU,EACVT,WAAW,EACXW,2DACF,CACJ,CAAC;IAED,IAAI,CAACC,UAAU,CAACL,kBAAkB,CAACM,MAAM,GAAG,CAAC,CAAC;EAChD;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAEcM,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"Clause.js","names":["_getParticiples","_interopRequireDefault","require","_index","_functionWords","e","__esModule","default","nonDirectPrecedenceException","directPrecedenceException","values","languageProcessing","Clause","PolishClause","constructor","clauseText","auxiliaries","_participles","getParticiples","getClauseText","checkParticiples","clause","getAuxiliaries","passiveParticiples","filter","participle","cannotDirectlyPrecedePassiveParticiple","cannotBeBetweenPassiveAuxiliaryAndParticiple","setPassive","length","_default","exports"],"sources":["../../../../../src/languageProcessing/languages/pl/values/Clause.js"],"sourcesContent":["import getParticiples from '../helpers/internal/getParticiples.js';\nimport {languageProcessing} from '../../../index';\nconst {nonDirectPrecedenceException, directPrecedenceException, values} = languageProcessing;\nconst {Clause} = values;\nimport {\n cannotBeBetweenPassiveAuxiliaryAndParticiple,\n cannotDirectlyPrecedePassiveParticiple\n} from '../config/functionWords';\n\n/**\n * Creates a Clause object for the Polish language.\n */\nclass PolishClause extends Clause {\n /**\n * Constructor.\n *\n * @param {string} clauseText The text of the clause.\n * @param {Array} auxiliaries The auxiliaries.\n *\n * @constructor\n */\n constructor(clauseText, auxiliaries) {\n super(clauseText, auxiliaries);\n this._participles = getParticiples(this.getClauseText());\n this.checkParticiples();\n }\n\n /**\n * Checks if any exceptions are applicable to this participle that would result in the clause not being passive.\n * If no exceptions are found, the clause is passive.\n *\n * @returns {boolean} Returns true if no exception is found.\n */\n checkParticiples() {\n const clause = this.getClauseText();\n const auxiliaries = this.getAuxiliaries();\n\n const passiveParticiples = this.getParticiples().filter(\n participle =>\n !directPrecedenceException(clause, participle, cannotDirectlyPrecedePassiveParticiple) &&\n !nonDirectPrecedenceException(\n clause,\n participle,\n auxiliaries,\n cannotBeBetweenPassiveAuxiliaryAndParticiple\n )\n );\n\n this.setPassive(passiveParticiples.length > 0);\n }\n}\n\nexport default PolishClause;\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,cAAA,GAAAF,OAAA;AAGiC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AALjC,MAAM;EAACG,4BAA4B;EAAEC,yBAAyB;EAAEC;AAAM,CAAC,GAAGC,yBAAkB;AAC5F,MAAM;EAACC;AAAM,CAAC,GAAGF,MAAM;AAMvB;AACA;AACA;AACA,MAAMG,YAAY,SAASD,MAAM,CAAC;EAChC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,WAAWA,CAACC,UAAU,EAAEC,WAAW,EAAE;IACnC,KAAK,CAACD,UAAU,EAAEC,WAAW,CAAC;IAC9B,IAAI,CAACC,YAAY,GAAG,IAAAC,uBAAc,EAAC,IAAI,CAACC,aAAa,CAAC,CAAC,CAAC;IACxD,IAAI,CAACC,gBAAgB,CAAC,CAAC;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEA,gBAAgBA,CAAA,EAAG;IACjB,MAAMC,MAAM,GAAG,IAAI,CAACF,aAAa,CAAC,CAAC;IACnC,MAAMH,WAAW,GAAG,IAAI,CAACM,cAAc,CAAC,CAAC;IAEzC,MAAMC,kBAAkB,GAAG,IAAI,CAACL,cAAc,CAAC,CAAC,CAACM,MAAM,CACrDC,UAAU,IACR,CAAChB,yBAAyB,CAACY,MAAM,EAAEI,UAAU,EAAEC,qDAAsC,CAAC,IACtF,CAAClB,4BAA4B,CAC3Ba,MAAM,EACNI,UAAU,EACVT,WAAW,EACXW,2DACF,CACJ,CAAC;IAED,IAAI,CAACC,UAAU,CAACL,kBAAkB,CAACM,MAAM,GAAG,CAAC,CAAC;EAChD;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAEcM,YAAY","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _index = require("@axyseo/index");
7
+ var _index = require("../../../index");
8
8
  var _firstWordExceptions = _interopRequireDefault(require("./config/firstWordExceptions"));
9
9
  var _functionWords = require("./config/functionWords");
10
10
  var _stopWords = _interopRequireDefault(require("./config/stopWords"));