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.
- package/build/languageProcessing/helpers/highlighting/getMarkingsInSentence.js +1 -1
- package/build/languageProcessing/helpers/highlighting/getMarkingsInSentence.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/buildTopicStems.js +1 -1
- package/build/languageProcessing/helpers/morphology/buildTopicStems.js.map +1 -1
- package/build/languageProcessing/helpers/morphology/getAllWordsFromPaper.js +1 -1
- package/build/languageProcessing/helpers/morphology/getAllWordsFromPaper.js.map +1 -1
- package/build/languageProcessing/languages/_default/Researcher.js +1 -1
- package/build/languageProcessing/languages/_default/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/_default/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/_default/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/ar/Researcher.js +1 -1
- package/build/languageProcessing/languages/ar/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/ar/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/ar/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/ar/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/ar/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/ca/Researcher.js +1 -1
- package/build/languageProcessing/languages/ca/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/ca/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/ca/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/cs/Researcher.js +1 -1
- package/build/languageProcessing/languages/cs/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/cs/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/cs/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/cs/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/cs/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/cs/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/cs/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/cs/values/Clause.js +1 -1
- package/build/languageProcessing/languages/cs/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/de/Researcher.js +1 -1
- package/build/languageProcessing/languages/de/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js +1 -1
- package/build/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/de/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/de/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/determineStem.js +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/determineStem.js.map +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/de/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/de/values/Clause.js +1 -1
- package/build/languageProcessing/languages/de/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/el/Researcher.js +1 -1
- package/build/languageProcessing/languages/el/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/el/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/el/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/el/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/el/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/el/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/el/values/Clause.js +1 -1
- package/build/languageProcessing/languages/el/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/en/Researcher.js +1 -1
- package/build/languageProcessing/languages/en/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js +1 -1
- package/build/languageProcessing/languages/en/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/en/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/en/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/determineStem.js +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/determineStem.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getAdjectiveStem.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getVerbStem.js +1 -1
- package/build/languageProcessing/languages/en/helpers/internal/getVerbStem.js.map +1 -1
- package/build/languageProcessing/languages/en/values/Clause.js +1 -1
- package/build/languageProcessing/languages/en/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/es/Researcher.js +1 -1
- package/build/languageProcessing/languages/es/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js +1 -1
- package/build/languageProcessing/languages/es/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/es/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/es/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js +3 -3
- package/build/languageProcessing/languages/es/helpers/internal/checkVerbStemModifications.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/es/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/es/helpers/internal/stem.js +1 -1
- package/build/languageProcessing/languages/es/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/es/values/Clause.js +1 -1
- package/build/languageProcessing/languages/es/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/fa/Researcher.js +1 -1
- package/build/languageProcessing/languages/fa/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/fa/helpers/createBasicWordForms.js +1 -1
- package/build/languageProcessing/languages/fa/helpers/createBasicWordForms.js.map +1 -1
- package/build/languageProcessing/languages/fa/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/fa/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/fa/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/fa/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/fr/Researcher.js +1 -1
- package/build/languageProcessing/languages/fr/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js +1 -1
- package/build/languageProcessing/languages/fr/helpers/calculateFleschReadingScore.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/fr/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/fr/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/fr/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/fr/helpers/internal/stem.js +1 -1
- package/build/languageProcessing/languages/fr/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/fr/values/Clause.js +1 -1
- package/build/languageProcessing/languages/fr/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/he/Researcher.js +1 -1
- package/build/languageProcessing/languages/he/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/he/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/he/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/he/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/he/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/hu/Researcher.js +1 -1
- package/build/languageProcessing/languages/hu/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/hu/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/hu/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/hu/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/hu/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/hu/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/hu/values/Clause.js +1 -1
- package/build/languageProcessing/languages/hu/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/id/Researcher.js +1 -1
- package/build/languageProcessing/languages/id/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/id/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/internal/stem.js +1 -1
- package/build/languageProcessing/languages/id/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/internal/stemHelpers.js +1 -1
- package/build/languageProcessing/languages/id/helpers/internal/stemHelpers.js.map +1 -1
- package/build/languageProcessing/languages/id/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/id/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/it/Researcher.js +1 -1
- package/build/languageProcessing/languages/it/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/it/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/it/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/it/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/it/helpers/internal/stem.js +1 -1
- package/build/languageProcessing/languages/it/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/it/values/Clause.js +1 -1
- package/build/languageProcessing/languages/it/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/ja/Researcher.js +1 -1
- package/build/languageProcessing/languages/ja/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/countCharacters.js +1 -1
- package/build/languageProcessing/languages/ja/helpers/countCharacters.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/customGetStemmer.js +1 -1
- package/build/languageProcessing/languages/ja/helpers/customGetStemmer.js.map +1 -1
- package/build/languageProcessing/languages/ja/helpers/getWords.js +1 -1
- package/build/languageProcessing/languages/ja/helpers/getWords.js.map +1 -1
- package/build/languageProcessing/languages/nb/Researcher.js +1 -1
- package/build/languageProcessing/languages/nb/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/nb/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/nb/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/nb/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/nb/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/nb/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/nb/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/nb/values/Clause.js +1 -1
- package/build/languageProcessing/languages/nb/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/nl/Researcher.js +1 -1
- package/build/languageProcessing/languages/nl/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/checkExceptionsWithFullForms.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/detectAndStemRegularParticiple.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/determineStem.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/determineStem.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/getStemWordsWithTAndDEnding.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stem.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stemModificationHelpers.js.map +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js +1 -1
- package/build/languageProcessing/languages/nl/helpers/internal/stemTOrDFromEndOfWord.js.map +1 -1
- package/build/languageProcessing/languages/nl/values/Clause.js +1 -1
- package/build/languageProcessing/languages/nl/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/pl/Researcher.js +1 -1
- package/build/languageProcessing/languages/pl/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/pl/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/pl/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/pl/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/pl/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/pl/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/pl/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/pl/values/Clause.js +1 -1
- package/build/languageProcessing/languages/pl/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/pt/Researcher.js +1 -1
- package/build/languageProcessing/languages/pt/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/pt/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/pt/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/pt/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/pt/helpers/internal/stem.js +1 -1
- package/build/languageProcessing/languages/pt/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/pt/values/Clause.js +1 -1
- package/build/languageProcessing/languages/pt/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/ru/Researcher.js +1 -1
- package/build/languageProcessing/languages/ru/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/ru/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/ru/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/ru/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/ru/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/sk/Researcher.js +1 -1
- package/build/languageProcessing/languages/sk/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/sk/helpers/getClauses.js +1 -1
- package/build/languageProcessing/languages/sk/helpers/getClauses.js.map +1 -1
- package/build/languageProcessing/languages/sk/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/sk/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/sk/helpers/internal/getParticiples.js +1 -1
- package/build/languageProcessing/languages/sk/helpers/internal/getParticiples.js.map +1 -1
- package/build/languageProcessing/languages/sk/values/Clause.js +1 -1
- package/build/languageProcessing/languages/sk/values/Clause.js.map +1 -1
- package/build/languageProcessing/languages/sv/Researcher.js +1 -1
- package/build/languageProcessing/languages/sv/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/sv/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/sv/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/sv/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/sv/helpers/isPassiveSentence.js.map +1 -1
- package/build/languageProcessing/languages/tr/Researcher.js +1 -1
- package/build/languageProcessing/languages/tr/Researcher.js.map +1 -1
- package/build/languageProcessing/languages/tr/helpers/getStemmer.js +1 -1
- package/build/languageProcessing/languages/tr/helpers/getStemmer.js.map +1 -1
- package/build/languageProcessing/languages/tr/helpers/internal/stem.js +1 -1
- package/build/languageProcessing/languages/tr/helpers/internal/stem.js.map +1 -1
- package/build/languageProcessing/languages/tr/helpers/isPassiveSentence.js +1 -1
- package/build/languageProcessing/languages/tr/helpers/isPassiveSentence.js.map +1 -1
- package/build/parsedPaper/build/linguisticParsing/SentenceTokenizer.js +1 -1
- package/build/parsedPaper/build/linguisticParsing/SentenceTokenizer.js.map +1 -1
- package/build/parsedPaper/build/tree/metadata/buildTree.js +1 -1
- package/build/parsedPaper/build/tree/metadata/buildTree.js.map +1 -1
- package/build/scoring/assessments/assessment.js +1 -1
- package/build/scoring/assessments/assessment.js.map +1 -1
- package/build/scoring/assessments/index.js +5 -5
- package/build/scoring/assessments/index.js.map +1 -1
- package/build/scoring/assessments/readability/TransitionWordsAssessment.js +3 -3
- package/build/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +1 -1
- package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js +1 -1
- package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
- package/build/scoring/assessors/avadaAssessor.js +2 -2
- package/build/scoring/assessors/avadaAssessor.js.map +1 -1
- package/build/scoring/assessors/seoAssessor.js +6 -6
- package/build/scoring/assessors/seoAssessor.js.map +1 -1
- package/build/scoring/helpers/assessments/recommendedKeywordCount.js +1 -1
- package/build/scoring/helpers/assessments/recommendedKeywordCount.js.map +1 -1
- package/build/scoring/helpers/index.js +1 -1
- package/build/scoring/helpers/index.js.map +1 -1
- package/package.json +2 -3
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _Mark = _interopRequireDefault(require("
|
|
7
|
+
var _Mark = _interopRequireDefault(require("../../../values/Mark"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const markStart = "<yoastmark class='yoast-text-mark'>";
|
|
10
10
|
const markEnd = "</yoastmark>";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMarkingsInSentence.js","names":["_Mark","_interopRequireDefault","require","e","__esModule","default","markStart","markEnd","createMarksForSentence","sentence","matches","tokens","newTokens","i","length","token","some","match","sourceCodeRange","startOffset","endOffset","unshift","text","markedSentence","join","replace","RegExp","mergeConsecutiveAndOverlappingMarkings","markings","newMarkings","sort","a","b","getPositionStart","forEach","marking","push","lastMarking","getPositionEnd","setPositionEnd","setBlockPositionEnd","getBlockPositionEnd","getMarkingsInSentence","matchesInSentence","map","Mark","position","startOffsetBlock","parentStartOffset","endOffsetBlock","clientId","parentClientId","attributeId","parentAttributeId","isFirstSection","isParentFirstSectionOfBlock","marked","original","_default","exports"],"sources":["../../../../src/languageProcessing/helpers/highlighting/getMarkingsInSentence.js"],"sourcesContent":["import Mark from \"
|
|
1
|
+
{"version":3,"file":"getMarkingsInSentence.js","names":["_Mark","_interopRequireDefault","require","e","__esModule","default","markStart","markEnd","createMarksForSentence","sentence","matches","tokens","newTokens","i","length","token","some","match","sourceCodeRange","startOffset","endOffset","unshift","text","markedSentence","join","replace","RegExp","mergeConsecutiveAndOverlappingMarkings","markings","newMarkings","sort","a","b","getPositionStart","forEach","marking","push","lastMarking","getPositionEnd","setPositionEnd","setBlockPositionEnd","getBlockPositionEnd","getMarkingsInSentence","matchesInSentence","map","Mark","position","startOffsetBlock","parentStartOffset","endOffsetBlock","clientId","parentClientId","attributeId","parentAttributeId","isFirstSection","isParentFirstSectionOfBlock","marked","original","_default","exports"],"sources":["../../../../src/languageProcessing/helpers/highlighting/getMarkingsInSentence.js"],"sourcesContent":["import Mark from \"../../../values/Mark\";\n\nconst markStart = \"<yoastmark class='yoast-text-mark'>\";\nconst markEnd = \"</yoastmark>\";\n\n/**\n * Adds `yoastmark` tags to the keyphrase matches in the sentence.\n *\n * This is a helper for search-based highlighting.\n *\n * @param {Sentence}\tsentence\tThe sentence to add the `yoastmark` tags to.\n * @param {Token[]}\t\tmatches\t\tThe array of the keyphrase matches.\n *\n * @returns {string} The sentence with the added `yoastmark` tags.\n */\nconst createMarksForSentence = ( sentence, matches ) => {\n\tconst tokens = sentence.tokens;\n\n\tconst newTokens = [];\n\tfor ( let i = tokens.length - 1; i >= 0; i-- ) {\n\t\tconst token = tokens[ i ];\n\t\tif ( matches.some( match => match.sourceCodeRange.startOffset === token.sourceCodeRange.startOffset ||\n\t\t\tmatch.sourceCodeRange.endOffset === token.sourceCodeRange.endOffset ) ) {\n\t\t\tnewTokens.unshift( markStart, token.text, markEnd );\n\t\t} else {\n\t\t\tnewTokens.unshift( token.text );\n\t\t}\n\t}\n\tconst markedSentence = newTokens.join( \"\" );\n\t// Merge consecutive markings into one marking.\n\treturn markedSentence.replace( new RegExp( \"</yoastmark>([ \\u00A0]?)<yoastmark class='yoast-text-mark'>\", \"ig\" ), \"$1\" );\n};\n\n/**\n * Merges consecutive and overlapping markings into one marking.\n *\n * This is a helper for position-based highlighting.\n *\n * @param {Mark[]}\tmarkings\tAn array of markings to merge.\n *\n * @returns {Mark[]} An array of markings where consecutive and overlapping markings are merged.\n */\nconst mergeConsecutiveAndOverlappingMarkings = ( markings ) => {\n\tconst newMarkings = [];\n\n\t// Sort markings by start offset. This is probably redundant, but for extra safety.\n\tmarkings.sort( function( a, b ) {\n\t\treturn a.getPositionStart() - b.getPositionStart();\n\t} );\n\n\tmarkings.forEach( ( marking ) => {\n\t\tif ( newMarkings.length === 0 ) {\n\t\t\tnewMarkings.push( marking );\n\t\t\treturn;\n\t\t}\n\n\t\tconst lastMarking = newMarkings[ newMarkings.length - 1 ];\n\t\t// Adding 1 to the position end, with the assumption that the language uses spaces.\n\t\t// When we adapt Japanese to use this helper, this check should also be adapted.\n\t\tif ( ( lastMarking.getPositionEnd() + 1 === marking.getPositionStart() ) ||\n\t\t\t( marking.getPositionStart() <= lastMarking.getPositionEnd() ) ) {\n\t\t\t// The marking is consecutive to the last marking, so we extend the last marking to include the new marking.\n\t\t\tlastMarking.setPositionEnd( marking.getPositionEnd() );\n\t\t\tlastMarking.setBlockPositionEnd( marking.getBlockPositionEnd() );\n\t\t} else {\n\t\t\t// The marking is not consecutive to the last marking, so we add it to the array by itself.\n\t\t\tnewMarkings.push( marking );\n\t\t}\n\t} );\n\n\treturn newMarkings;\n};\n\n\n/**\n * Gets the Mark objects of all keyphrase matches in the sentence.\n * Currently, this function creates Mark objects compatible for both search-based and position-based highlighting.\n * In a pure position-based highlighting, we don't need to provide 'marked' and 'original' when creating the Mark object.\n *\n * @param {Sentence}\tsentence\t\t\tThe sentence to check.\n * @param {Token[]}\t\tmatchesInSentence\tAn array containing the keyphrase matches in the sentence.\n *\n * @returns {Mark[]} The array of Mark objects of the keyphrase matches in the sentence.\n */\nfunction getMarkingsInSentence( sentence, matchesInSentence ) {\n\tif ( matchesInSentence.length === 0 ) {\n\t\treturn [];\n\t}\n\n\t// Create the marked sentence that is used for search-based highlighting.\n\tconst markedSentence = createMarksForSentence( sentence, matchesInSentence );\n\n\t/*\n\t * Note that there is a paradigm shift:\n\t * With search-based highlighting, there would be one Mark object for the entire sentence.\n\t * With position-based highlighting, there is a Mark object for each match.\n\t * Hence, in order to be backwards compatible with search-based highlighting,\n\t * all Mark objects for a sentence have the same markedSentence.\n\t */\n\tconst markings = matchesInSentence.map( token => {\n\t\tconst startOffset = token.sourceCodeRange.startOffset;\n\t\tconst endOffset = token.sourceCodeRange.endOffset;\n\t\treturn new Mark( {\n\t\t\tposition: {\n\t\t\t\tstartOffset: startOffset,\n\t\t\t\tendOffset: endOffset,\n\t\t\t\t// Relative to start of block positions.\n\t\t\t\tstartOffsetBlock: startOffset - ( sentence.parentStartOffset || 0 ),\n\t\t\t\tendOffsetBlock: endOffset - ( sentence.parentStartOffset || 0 ),\n\t\t\t\t// The client id of the block the match was found in.\n\t\t\t\tclientId: sentence.parentClientId || \"\",\n\t\t\t\t// The attribute id of the Yoast sub-block the match was found in.\n\t\t\t\tattributeId: sentence.parentAttributeId || \"\",\n\t\t\t\t// Whether the match was found in the first section of the Yoast sub-block.\n\t\t\t\tisFirstSection: sentence.isParentFirstSectionOfBlock || false,\n\t\t\t},\n\t\t\tmarked: markedSentence,\n\t\t\toriginal: sentence.text,\n\t\t} );\n\t} );\n\n\treturn mergeConsecutiveAndOverlappingMarkings( markings );\n}\n\nexport default getMarkingsInSentence;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExC,MAAMG,SAAS,GAAG,qCAAqC;AACvD,MAAMC,OAAO,GAAG,cAAc;;AAE9B;AACA;AACA;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pB;QACA2B,gBAAgB,EAAE5B,WAAW,IAAKV,QAAQ,CAACuC,iBAAiB,IAAI,CAAC,CAAE;QACnEC,cAAc,EAAE7B,SAAS,IAAKX,QAAQ,CAACuC,iBAAiB,IAAI,CAAC,CAAE;QAC/D;QACAE,QAAQ,EAAEzC,QAAQ,CAAC0C,cAAc,IAAI,EAAE;QACvC;QACAC,WAAW,EAAE3C,QAAQ,CAAC4C,iBAAiB,IAAI,EAAE;QAC7C;QACAC,cAAc,EAAE7C,QAAQ,CAAC8C,2BAA2B,IAAI;MACzD,CAAC;MACDC,MAAM,EAAEjC,cAAc;MACtBkC,QAAQ,EAAEhD,QAAQ,CAACa;IACpB,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAOK,sCAAsC,CAAEC,QAAS,CAAC;AAC1D;AAAC,IAAA8B,QAAA,GAAAC,OAAA,CAAAtD,OAAA,GAEcqC,qBAAqB","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ exports.collectStems = collectStems;
|
|
|
9
9
|
exports.primeLanguageSpecificData = void 0;
|
|
10
10
|
var _getWords = _interopRequireDefault(require("../word/getWords.js"));
|
|
11
11
|
var _quotes = require("../sanitize/quotes");
|
|
12
|
-
var _wordBoundariesWithoutPunctuation = require("
|
|
12
|
+
var _wordBoundariesWithoutPunctuation = require("../../../config/wordBoundariesWithoutPunctuation");
|
|
13
13
|
var _lodash = require("lodash");
|
|
14
14
|
var _isDoubleQuoted = _interopRequireDefault(require("../match/isDoubleQuoted"));
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTopicStems.js","names":["_getWords","_interopRequireDefault","require","_quotes","_wordBoundariesWithoutPunctuation","_lodash","_isDoubleQuoted","e","__esModule","default","TopicPhrase","constructor","stemOriginalPairs","exactMatch","getStems","map","stemOriginalPair","stem","exports","StemOriginalPair","original","buildStems","keyphrase","stemmer","functionWords","areHyphensWordBoundaries","isUndefined","isDoubleQuoted","substring","length","escapeRegExp","keyphraseWords","getWords","WORD_BOUNDARY_WITH_HYPHEN","WORD_BOUNDARY_WITHOUT_HYPHEN","wordsWithoutFunctionWords","filter","word","includes","normalizeSingle","collectKeyphraseAndSynonymsStems","synonyms","keyphraseStems","synonymsStems","synonym","primeLanguageSpecificData","memoize","join","collectStems","collectStemsWithLanguageSpecificData"],"sources":["../../../../src/languageProcessing/helpers/morphology/buildTopicStems.js"],"sourcesContent":["import getWords from \"../word/getWords.js\";\nimport { normalizeSingle } from \"../sanitize/quotes\";\nimport { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from \"@axyseo/config/wordBoundariesWithoutPunctuation\";\n\nimport { isUndefined, escapeRegExp, memoize } from \"lodash\";\nimport isDoubleQuoted from \"../match/isDoubleQuoted\";\n\n/**\n * A TopicPhrase (i.e., a keyphrase or synonym) with stem-original pairs for the words in the topic phrase.\n */\nclass TopicPhrase {\n\t/**\n\t * Constructs a new TopicPhrase.\n\t *\n\t * @param {StemOriginalPair[]} stemOriginalPairs The stem-original pairs for the words in the topic phrase.\n\t * @param {boolean} exactMatch Whether the topic phrase is an exact match.\n\t *\n\t * @constructor\n\t */\n\tconstructor( stemOriginalPairs = [], exactMatch = false ) {\n\t\tthis.stemOriginalPairs = stemOriginalPairs;\n\t\tthis.exactMatch = exactMatch;\n\t}\n\n\t/**\n\t * Returns all stems in the topic phrase.\n\t *\n\t * @returns {string[]|[]} The stems in the topic phrase or empty array if the topic phrase is exact match.\n\t */\n\tgetStems() {\n\t\t// An exact match keyphrase doesn't have stems.\n\t\tif ( this.exactMatch ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn this.stemOriginalPairs.map( stemOriginalPair => stemOriginalPair.stem );\n\t}\n}\n\n/**\n * A stem-original pair ƒor a word in a topic phrase.\n *\n * @param {string} stem The stem of the topic phrase word.\n * @param {string} original The original word form the topic phrase (unsanitized)\n *\n * @constructor\n */\nfunction StemOriginalPair( stem, original ) {\n\tthis.stem = stem;\n\tthis.original = original;\n}\n\n/**\n * Analyzes the focus keyword string or one synonym phrase.\n * Checks if morphology is requested or if the user wants to match the exact string.\n * If morphology is required, the module finds a stem for all words (if no function words list is available), or\n * for all content words (i.e., excluding prepositions, articles, conjunctions, if the function words list is available).\n *\n * @param {string} keyphrase \t\t\t\tThe keyphrase of the paper (or a synonym phrase) to get stem for.\n * @param {function} stemmer \t\t\t\tThe language-specific stemmer.\n * @param {string[]} functionWords \t\t\t\tThe language-specific function words.\n * @param {boolean}\t areHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {TopicPhrase} Object with an array of StemOriginalPairs of all (content) words in the keyphrase or synonym\n * phrase and information about whether the keyphrase/synonym should be matched exactly.\n */\nconst buildStems = function( keyphrase, stemmer, functionWords, areHyphensWordBoundaries ) {\n\tif ( isUndefined( keyphrase ) || keyphrase === \"\" ) {\n\t\treturn new TopicPhrase();\n\t}\n\n\t// If the keyphrase is embedded in double quotation marks, return the keyphrase itself, without the outermost quotation marks.\n\tif ( isDoubleQuoted( keyphrase ) ) {\n\t\tkeyphrase = keyphrase.substring( 1, keyphrase.length - 1 );\n\t\treturn new TopicPhrase(\n\t\t\t[ new StemOriginalPair( escapeRegExp( keyphrase ), keyphrase ) ],\n\t\t\ttrue\n\t\t);\n\t}\n\n\t/*\n\t * \tIf hyphens should be treated as word boundaries, pass a custom word boundary regex string that includes whitespaces,\n\t * hyphens (u002d), and en-dashes (u2013). Otherwise, pass a regex that includes only whitespaces and en-dashes.\n\t */\n\tlet keyphraseWords = areHyphensWordBoundaries ? getWords( keyphrase, WORD_BOUNDARY_WITH_HYPHEN )\n\t\t: getWords( keyphrase, WORD_BOUNDARY_WITHOUT_HYPHEN );\n\n\t// Filter function words from the keyphrase. Don't filter if the keyphrase only consists of function words.\n\tconst wordsWithoutFunctionWords = keyphraseWords.filter( ( word ) => ! functionWords.includes( word ) );\n\tif ( wordsWithoutFunctionWords.length > 0 ) {\n\t\tkeyphraseWords = wordsWithoutFunctionWords;\n\t}\n\n\t// Return a stem-original pair with a stem.\n\tconst stemOriginalPairs = keyphraseWords.map( word => {\n\t\treturn new StemOriginalPair( stemmer( normalizeSingle( escapeRegExp( word ) ) ), word );\n\t} );\n\n\treturn new TopicPhrase( stemOriginalPairs );\n};\n\n/**\n * Builds stems of words of the keyphrase and of each synonym phrase.\n *\n * @param {string} keyphrase \t\t\t\tThe paper's keyphrase.\n * @param {string[]} synonyms \t\t\t\tThe paper's synonyms.\n * @param {function} stemmer \t\t\t\tThe language-specific stemmer (if available).\n * @param {string[]} functionWords \t\t\t\tThe language-specific function words.\n * @param {boolean}\t areHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {Object} Object with an array of stems of words in the keyphrase and an array of arrays of stems of words in the synonyms.\n */\nconst collectKeyphraseAndSynonymsStems = function( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries ) {\n\tconst keyphraseStems = buildStems( keyphrase, stemmer, functionWords, areHyphensWordBoundaries );\n\tconst synonymsStems = synonyms.map( synonym => buildStems( synonym, stemmer, functionWords, areHyphensWordBoundaries ) );\n\n\treturn {\n\t\tkeyphraseStems,\n\t\tsynonymsStems,\n\t};\n};\n\n/**\n * Caches stems depending on the currently available stemmer and functionWords and (separately) keyphrase and synonyms.\n * In this way, if the stemmer and functionWords remain the same in multiple calls of this function, the function\n * that collects actual stems only needs to check if the keyphrase and synonyms also remain the\n * same to return the cached result. The joining of keyphrase and synonyms for this function is needed,\n * because by default memoize caches by the first key only, which in the current case would mean that the function would\n * return the cached forms if the keyphrase has not changed (without checking if synonyms were changed).\n *\n * @param {function} stemmer \t\t\t\tThe language-specific stemmer (if available).\n * @param {string[]} functionWords \t\t\t\tThe language-specific function words.\n * @param {boolean}\t areHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {function} The function that collects the stems for a given set of keyphrase, synonyms, stemmer and functionWords.\n */\nconst primeLanguageSpecificData = memoize( ( stemmer, functionWords, areHyphensWordBoundaries ) => {\n\treturn memoize( ( keyphrase, synonyms ) => {\n\t\treturn collectKeyphraseAndSynonymsStems( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries );\n\t}, ( keyphrase, synonyms ) => {\n\t\treturn keyphrase + \",\" + synonyms.join( \",\" );\n\t} );\n} );\n\n/**\n * Retrieves stems of words of the keyphrase and of each synonym phrase using the function that caches\n * the results of previous calls of this function.\n *\n * @param {string} keyphrase \t\t\tThe paper's keyphrase.\n * @param {string[]} synonyms \t\t\tThe paper's synonyms.\n * @param {function} stemmer \t\t\tThe language-specific stemmer (if available).\n * @param {string[]} functionWords \t\t\tThe language-specific function words.\n * @param {boolean}\t\tareHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {Object} Object with an array of stems of words in the keyphrase and an array of arrays of stems of words in the synonyms.\n */\nfunction collectStems( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries ) {\n\tconst collectStemsWithLanguageSpecificData = primeLanguageSpecificData( stemmer, functionWords, areHyphensWordBoundaries );\n\n\treturn collectStemsWithLanguageSpecificData( keyphrase, synonyms );\n}\n\nexport {\n\tbuildStems,\n\tcollectStems,\n\tTopicPhrase,\n\tStemOriginalPair,\n\tprimeLanguageSpecificData,\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iCAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAqD,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErD;AACA;AACA;AACA,MAAMG,WAAW,CAAC;EACjB;AACD;AACA;AACA;AACA;AACA;AACA;AACA;EACCC,WAAWA,CA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AG,IAAAC,eAAO,EAAE,CAAEvB,OAAO,EAAEC,aAAa,EAAEC,wBAAwB,KAAM;EAClG,OAAO,IAAAqB,eAAO,EAAE,CAAExB,SAAS,EAAEmB,QAAQ,KAAM;IAC1C,OAAOD,gCAAgC,CAAElB,SAAS,EAAEmB,QAAQ,EAAElB,OAAO,EAAEC,aAAa,EAAEC,wBAAyB,CAAC;EACjH,CAAC,EAAE,CAAEH,SAAS,EAAEmB,QAAQ,KAAM;IAC7B,OAAOnB,SAAS,GAAG,GAAG,GAAGmB,QAAQ,CAACM,IAAI,CAAE,GAAI,CAAC;EAC9C,CAAE,CAAC;AACJ,CAAE,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAE1B,SAAS,EAAEmB,QAAQ,EAAElB,OAAO,EAAEC,aAAa,EAAEC,wBAAwB,EAAG;EAC9F,MAAMwB,oCAAoC,GAAGJ,yBAAyB,CAAEtB,OAAO,EAAEC,aAAa,EAAEC,wBAAyB,CAAC;EAE1H,OAAOwB,oCAAoC,CAAE3B,SAAS,EAAEmB,QAAS,CAAC;AACnE","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"buildTopicStems.js","names":["_getWords","_interopRequireDefault","require","_quotes","_wordBoundariesWithoutPunctuation","_lodash","_isDoubleQuoted","e","__esModule","default","TopicPhrase","constructor","stemOriginalPairs","exactMatch","getStems","map","stemOriginalPair","stem","exports","StemOriginalPair","original","buildStems","keyphrase","stemmer","functionWords","areHyphensWordBoundaries","isUndefined","isDoubleQuoted","substring","length","escapeRegExp","keyphraseWords","getWords","WORD_BOUNDARY_WITH_HYPHEN","WORD_BOUNDARY_WITHOUT_HYPHEN","wordsWithoutFunctionWords","filter","word","includes","normalizeSingle","collectKeyphraseAndSynonymsStems","synonyms","keyphraseStems","synonymsStems","synonym","primeLanguageSpecificData","memoize","join","collectStems","collectStemsWithLanguageSpecificData"],"sources":["../../../../src/languageProcessing/helpers/morphology/buildTopicStems.js"],"sourcesContent":["import getWords from \"../word/getWords.js\";\nimport { normalizeSingle } from \"../sanitize/quotes\";\nimport { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from \"../../../config/wordBoundariesWithoutPunctuation\";\n\nimport { isUndefined, escapeRegExp, memoize } from \"lodash\";\nimport isDoubleQuoted from \"../match/isDoubleQuoted\";\n\n/**\n * A TopicPhrase (i.e., a keyphrase or synonym) with stem-original pairs for the words in the topic phrase.\n */\nclass TopicPhrase {\n\t/**\n\t * Constructs a new TopicPhrase.\n\t *\n\t * @param {StemOriginalPair[]} stemOriginalPairs The stem-original pairs for the words in the topic phrase.\n\t * @param {boolean} exactMatch Whether the topic phrase is an exact match.\n\t *\n\t * @constructor\n\t */\n\tconstructor( stemOriginalPairs = [], exactMatch = false ) {\n\t\tthis.stemOriginalPairs = stemOriginalPairs;\n\t\tthis.exactMatch = exactMatch;\n\t}\n\n\t/**\n\t * Returns all stems in the topic phrase.\n\t *\n\t * @returns {string[]|[]} The stems in the topic phrase or empty array if the topic phrase is exact match.\n\t */\n\tgetStems() {\n\t\t// An exact match keyphrase doesn't have stems.\n\t\tif ( this.exactMatch ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn this.stemOriginalPairs.map( stemOriginalPair => stemOriginalPair.stem );\n\t}\n}\n\n/**\n * A stem-original pair ƒor a word in a topic phrase.\n *\n * @param {string} stem The stem of the topic phrase word.\n * @param {string} original The original word form the topic phrase (unsanitized)\n *\n * @constructor\n */\nfunction StemOriginalPair( stem, original ) {\n\tthis.stem = stem;\n\tthis.original = original;\n}\n\n/**\n * Analyzes the focus keyword string or one synonym phrase.\n * Checks if morphology is requested or if the user wants to match the exact string.\n * If morphology is required, the module finds a stem for all words (if no function words list is available), or\n * for all content words (i.e., excluding prepositions, articles, conjunctions, if the function words list is available).\n *\n * @param {string} keyphrase \t\t\t\tThe keyphrase of the paper (or a synonym phrase) to get stem for.\n * @param {function} stemmer \t\t\t\tThe language-specific stemmer.\n * @param {string[]} functionWords \t\t\t\tThe language-specific function words.\n * @param {boolean}\t areHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {TopicPhrase} Object with an array of StemOriginalPairs of all (content) words in the keyphrase or synonym\n * phrase and information about whether the keyphrase/synonym should be matched exactly.\n */\nconst buildStems = function( keyphrase, stemmer, functionWords, areHyphensWordBoundaries ) {\n\tif ( isUndefined( keyphrase ) || keyphrase === \"\" ) {\n\t\treturn new TopicPhrase();\n\t}\n\n\t// If the keyphrase is embedded in double quotation marks, return the keyphrase itself, without the outermost quotation marks.\n\tif ( isDoubleQuoted( keyphrase ) ) {\n\t\tkeyphrase = keyphrase.substring( 1, keyphrase.length - 1 );\n\t\treturn new TopicPhrase(\n\t\t\t[ new StemOriginalPair( escapeRegExp( keyphrase ), keyphrase ) ],\n\t\t\ttrue\n\t\t);\n\t}\n\n\t/*\n\t * \tIf hyphens should be treated as word boundaries, pass a custom word boundary regex string that includes whitespaces,\n\t * hyphens (u002d), and en-dashes (u2013). Otherwise, pass a regex that includes only whitespaces and en-dashes.\n\t */\n\tlet keyphraseWords = areHyphensWordBoundaries ? getWords( keyphrase, WORD_BOUNDARY_WITH_HYPHEN )\n\t\t: getWords( keyphrase, WORD_BOUNDARY_WITHOUT_HYPHEN );\n\n\t// Filter function words from the keyphrase. Don't filter if the keyphrase only consists of function words.\n\tconst wordsWithoutFunctionWords = keyphraseWords.filter( ( word ) => ! functionWords.includes( word ) );\n\tif ( wordsWithoutFunctionWords.length > 0 ) {\n\t\tkeyphraseWords = wordsWithoutFunctionWords;\n\t}\n\n\t// Return a stem-original pair with a stem.\n\tconst stemOriginalPairs = keyphraseWords.map( word => {\n\t\treturn new StemOriginalPair( stemmer( normalizeSingle( escapeRegExp( word ) ) ), word );\n\t} );\n\n\treturn new TopicPhrase( stemOriginalPairs );\n};\n\n/**\n * Builds stems of words of the keyphrase and of each synonym phrase.\n *\n * @param {string} keyphrase \t\t\t\tThe paper's keyphrase.\n * @param {string[]} synonyms \t\t\t\tThe paper's synonyms.\n * @param {function} stemmer \t\t\t\tThe language-specific stemmer (if available).\n * @param {string[]} functionWords \t\t\t\tThe language-specific function words.\n * @param {boolean}\t areHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {Object} Object with an array of stems of words in the keyphrase and an array of arrays of stems of words in the synonyms.\n */\nconst collectKeyphraseAndSynonymsStems = function( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries ) {\n\tconst keyphraseStems = buildStems( keyphrase, stemmer, functionWords, areHyphensWordBoundaries );\n\tconst synonymsStems = synonyms.map( synonym => buildStems( synonym, stemmer, functionWords, areHyphensWordBoundaries ) );\n\n\treturn {\n\t\tkeyphraseStems,\n\t\tsynonymsStems,\n\t};\n};\n\n/**\n * Caches stems depending on the currently available stemmer and functionWords and (separately) keyphrase and synonyms.\n * In this way, if the stemmer and functionWords remain the same in multiple calls of this function, the function\n * that collects actual stems only needs to check if the keyphrase and synonyms also remain the\n * same to return the cached result. The joining of keyphrase and synonyms for this function is needed,\n * because by default memoize caches by the first key only, which in the current case would mean that the function would\n * return the cached forms if the keyphrase has not changed (without checking if synonyms were changed).\n *\n * @param {function} stemmer \t\t\t\tThe language-specific stemmer (if available).\n * @param {string[]} functionWords \t\t\t\tThe language-specific function words.\n * @param {boolean}\t areHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {function} The function that collects the stems for a given set of keyphrase, synonyms, stemmer and functionWords.\n */\nconst primeLanguageSpecificData = memoize( ( stemmer, functionWords, areHyphensWordBoundaries ) => {\n\treturn memoize( ( keyphrase, synonyms ) => {\n\t\treturn collectKeyphraseAndSynonymsStems( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries );\n\t}, ( keyphrase, synonyms ) => {\n\t\treturn keyphrase + \",\" + synonyms.join( \",\" );\n\t} );\n} );\n\n/**\n * Retrieves stems of words of the keyphrase and of each synonym phrase using the function that caches\n * the results of previous calls of this function.\n *\n * @param {string} keyphrase \t\t\tThe paper's keyphrase.\n * @param {string[]} synonyms \t\t\tThe paper's synonyms.\n * @param {function} stemmer \t\t\tThe language-specific stemmer (if available).\n * @param {string[]} functionWords \t\t\tThe language-specific function words.\n * @param {boolean}\t\tareHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {Object} Object with an array of stems of words in the keyphrase and an array of arrays of stems of words in the synonyms.\n */\nfunction collectStems( keyphrase, synonyms, stemmer, functionWords, areHyphensWordBoundaries ) {\n\tconst collectStemsWithLanguageSpecificData = primeLanguageSpecificData( stemmer, functionWords, areHyphensWordBoundaries );\n\n\treturn collectStemsWithLanguageSpecificData( keyphrase, synonyms );\n}\n\nexport {\n\tbuildStems,\n\tcollectStems,\n\tTopicPhrase,\n\tStemOriginalPair,\n\tprimeLanguageSpecificData,\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iCAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAqD,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErD;AACA;AACA;AACA,MAAMG,WAAW,CAAC;EACjB;AACD;AACA;AACA;AACA;AACA;AACA;AACA;EACCC,WAAWA,CAAEC,iBAAiB,GAAG,EAAE,EAAEC,UAAU,GAAG,KAAK,EAAG;IACzD,IAAI,CAACD,iBAAiB,GAAGA,iBAAiB;IAC1C,IAAI,CAACC,UAAU,GAAGA,UAAU;EAC7B;;EAEA;AACD;AACA;AACA;AACA;EACCC,QAAQA,CAAA,EAAG;IACV;IACA,IAAK,IAAI,CAACD,UAAU,EAAG;MACtB,OAAO,EAAE;IACV;IAEA,OAAO,IAAI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mB,QAAQ,KAAM;IAC7B,OAAOnB,SAAS,GAAG,GAAG,GAAGmB,QAAQ,CAACM,IAAI,CAAE,GAAI,CAAC;EAC9C,CAAE,CAAC;AACJ,CAAE,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAE1B,SAAS,EAAEmB,QAAQ,EAAElB,OAAO,EAAEC,aAAa,EAAEC,wBAAwB,EAAG;EAC9F,MAAMwB,oCAAoC,GAAGJ,yBAAyB,CAAEtB,OAAO,EAAEC,aAAa,EAAEC,wBAAyB,CAAC;EAE1H,OAAOwB,oCAAoC,CAAE3B,SAAS,EAAEmB,QAAS,CAAC;AACnE","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ var _quotes = require("../sanitize/quotes");
|
|
|
10
10
|
var _parseSlug = _interopRequireDefault(require("../url/parseSlug"));
|
|
11
11
|
var _getWords = _interopRequireDefault(require("../word/getWords"));
|
|
12
12
|
var _getImagesInTree = _interopRequireDefault(require("../image/getImagesInTree"));
|
|
13
|
-
var _wordBoundariesWithoutPunctuation = require("
|
|
13
|
+
var _wordBoundariesWithoutPunctuation = require("../../../config/wordBoundariesWithoutPunctuation");
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
/**
|
|
16
16
|
* Gets all words found in the text, title, slug and meta description of a given paper.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAllWordsFromPaper.js","names":["_lodash","require","_getAltAttribute","_interopRequireDefault","_quotes","_parseSlug","_getWords","_getImagesInTree","_wordBoundariesWithoutPunctuation","e","__esModule","default","_default","paper","areHyphensWordBoundaries","paperText","getText","altTagsInText","getImagesInTree","map","image","getAltAttribute","paperContent","getTitle","getSlug","parseSlug","getDescription","join","words","getWords","WORD_BOUNDARY_WITH_HYPHEN","WORD_BOUNDARY_WITHOUT_HYPHEN","word","normalizeSingle","escapeRegExp"],"sources":["../../../../src/languageProcessing/helpers/morphology/getAllWordsFromPaper.js"],"sourcesContent":["import { escapeRegExp } from \"lodash\";\nimport getAltAttribute from \"../image/getAltAttribute\";\nimport { normalizeSingle } from \"../sanitize/quotes\";\nimport parseSlug from \"../url/parseSlug\";\nimport getWords from \"../word/getWords\";\nimport getImagesInTree from \"../image/getImagesInTree\";\nimport { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from \"
|
|
1
|
+
{"version":3,"file":"getAllWordsFromPaper.js","names":["_lodash","require","_getAltAttribute","_interopRequireDefault","_quotes","_parseSlug","_getWords","_getImagesInTree","_wordBoundariesWithoutPunctuation","e","__esModule","default","_default","paper","areHyphensWordBoundaries","paperText","getText","altTagsInText","getImagesInTree","map","image","getAltAttribute","paperContent","getTitle","getSlug","parseSlug","getDescription","join","words","getWords","WORD_BOUNDARY_WITH_HYPHEN","WORD_BOUNDARY_WITHOUT_HYPHEN","word","normalizeSingle","escapeRegExp"],"sources":["../../../../src/languageProcessing/helpers/morphology/getAllWordsFromPaper.js"],"sourcesContent":["import { escapeRegExp } from \"lodash\";\nimport getAltAttribute from \"../image/getAltAttribute\";\nimport { normalizeSingle } from \"../sanitize/quotes\";\nimport parseSlug from \"../url/parseSlug\";\nimport getWords from \"../word/getWords\";\nimport getImagesInTree from \"../image/getImagesInTree\";\nimport { WORD_BOUNDARY_WITH_HYPHEN, WORD_BOUNDARY_WITHOUT_HYPHEN } from \"../../../config/wordBoundariesWithoutPunctuation\";\n\n/**\n * Gets all words found in the text, title, slug and meta description of a given paper.\n *\n * @param {Paper} \tpaper \t\t\t\t\tThe paper for which to get the words.\n * @param {boolean}\tareHyphensWordBoundaries\tWhether hyphens should be treated as word boundaries.\n *\n * @returns {string[]} All words found.\n */\nexport default function( paper, areHyphensWordBoundaries ) {\n\tconst paperText = paper.getText();\n\tconst altTagsInText = getImagesInTree( paper ).map( image => getAltAttribute( image ) );\n\n\tconst paperContent = [\n\t\tpaperText,\n\t\tpaper.getTitle(),\n\t\tpaper.getSlug(),\n\t\tparseSlug( paper.getSlug() ),\n\t\tpaper.getDescription(),\n\t\taltTagsInText.join( \" \" ),\n\t].join( \" \" );\n\n\t/*\n * If hyphens should be treated as word boundaries, pass a custom word boundary regex string that includes whitespaces,\n * hyphens (u002d), and en-dashes (u2013). Otherwise, pass a regex that includes only whitespaces and en-dashes.\n \t */\n\tconst words = areHyphensWordBoundaries ? getWords( paperContent, WORD_BOUNDARY_WITH_HYPHEN )\n\t\t: getWords( paperContent, WORD_BOUNDARY_WITHOUT_HYPHEN );\n\n\treturn words.map(\n\t\tword => normalizeSingle( escapeRegExp( word ) ) );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,gBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,iCAAA,GAAAP,OAAA;AAA2H,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAAG,SAAUC,KAAK,EAAEC,wBAAwB,EAAG;EAC1D,MAAMC,SAAS,GAAGF,KAAK,CAACG,OAAO,CAAC,CAAC;EACjC,MAAMC,aAAa,GAAG,IAAAC,wBAAe,EAAEL,KAAM,CAAC,CAACM,GAAG,CAAEC,KAAK,IAAI,IAAAC,wBAAe,EAAED,KAAM,CAAE,CAAC;EAEvF,MAAME,YAAY,GAAG,CACpBP,SAAS,EACTF,KAAK,CAACU,QAAQ,CAAC,CAAC,EAChBV,KAAK,CAACW,OAAO,CAAC,CAAC,EACf,IAAAC,kBAAS,EAAEZ,KAAK,CAACW,OAAO,CAAC,CAAE,CAAC,EAC5BX,KAAK,CAACa,cAAc,CAAC,CAAC,EACtBT,aAAa,CAACU,IAAI,CAAE,GAAI,CAAC,CACzB,CAACA,IAAI,CAAE,GAAI,CAAC;;EAEb;AACD;AACA;AACA;EACC,MAAMC,KAAK,GAAGd,wBAAwB,GAAG,IAAAe,iBAAQ,EAAEP,YAAY,EAAEQ,2DAA0B,CAAC,GACzF,IAAAD,iBAAQ,EAAEP,YAAY,EAAES,8DAA6B,CAAC;EAEzD,OAAOH,KAAK,CAACT,GAAG,CACfa,IAAI,IAAI,IAAAC,uBAAe,EAAE,IAAAC,oBAAY,EAAEF,IAAK,CAAE,CAAE,CAAC;AACnD","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("
|
|
7
|
+
var _index = require("../../../index");
|
|
8
8
|
var _getStemmer = _interopRequireDefault(require("./helpers/getStemmer"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Researcher.js","names":["_index","require","_getStemmer","_interopRequireDefault","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","getPassiveVoiceResult","getSentenceBeginnings","findTransitionWords","functionWordsInKeyphrase","Object","assign","config","functionWords","helpers","getStemmer","exports"],"sources":["../../../../src/languageProcessing/languages/_default/Researcher.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"Researcher.js","names":["_index","require","_getStemmer","_interopRequireDefault","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","getPassiveVoiceResult","getSentenceBeginnings","findTransitionWords","functionWordsInKeyphrase","Object","assign","config","functionWords","helpers","getStemmer","exports"],"sources":["../../../../src/languageProcessing/languages/_default/Researcher.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {AbstractResearcher} = languageProcessing;\n\n// All helpers\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 // Deletes researches that are not available for languages that we haven't supported yet.\n delete this.defaultResearches.getFleschReadingScore;\n delete this.defaultResearches.getPassiveVoiceResult;\n delete this.defaultResearches.getSentenceBeginnings;\n delete this.defaultResearches.findTransitionWords;\n delete this.defaultResearches.functionWordsInKeyphrase;\n\n Object.assign(this.config, {\n functionWords: []\n });\n\n Object.assign(this.helpers, {\n getStemmer\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8C,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH9C,MAAM;EAACG;AAAkB,CAAC,GAAGC,yBAAkB;;AAE/C;;AAGA;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;IACnD,OAAO,IAAI,CAACD,iBAAiB,CAACE,qBAAqB;IACnD,OAAO,IAAI,CAACF,iBAAiB,CAACG,qBAAqB;IACnD,OAAO,IAAI,CAACH,iBAAiB,CAACI,mBAAmB;IACjD,OAAO,IAAI,CAACJ,iBAAiB,CAACK,wBAAwB;IAEtDC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACC,MAAM,EAAE;MACzBC,aAAa,EAAE;IACjB,CAAC,CAAC;IAEFH,MAAM,CAACC,MAAM,CAAC,IAAI,CAACG,OAAO,EAAE;MAC1BC,UAAU,EAAVA;IACF,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAlB,OAAA,GAAAG,UAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStemmer.js","names":["_index","require","baseStemmer","languageProcessing","getStemmer"],"sources":["../../../../../src/languageProcessing/languages/_default/helpers/getStemmer.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"getStemmer.js","names":["_index","require","baseStemmer","languageProcessing","getStemmer"],"sources":["../../../../../src/languageProcessing/languages/_default/helpers/getStemmer.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {baseStemmer} = languageProcessing;\n\n/**\n * Returns the stemmer for a researcher.\n *\n * @returns {Function} The stemmer.\n */\nexport default function getStemmer() {\n return baseStemmer;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,MAAM;EAACC;AAAW,CAAC,GAAGC,yBAAkB;;AAExC;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CAAA,EAAG;EACnC,OAAOF,WAAW;AACpB","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("
|
|
7
|
+
var _index = require("../../../index");
|
|
8
8
|
var _firstWordExceptions = _interopRequireDefault(require("./config/firstWordExceptions"));
|
|
9
9
|
var _functionWords = require("./config/functionWords");
|
|
10
10
|
var _transitionWords = _interopRequireDefault(require("./config/transitionWords"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Researcher.js","names":["_index","require","_firstWordExceptions","_interopRequireDefault","_functionWords","_transitionWords","_twoPartTransitionWords","_prefixedFunctionWords","_createBasicWordForms","_getStemmer","_isPassiveSentence","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","Object","assign","config","language","passiveConstructionType","firstWordExceptions","functionWords","transitionWords","twoPartTransitionWords","prefixedFunctionWordsRegex","PREFIXED_FUNCTION_WORDS_REGEX","helpers","createBasicWordForms","getStemmer","isPassiveSentence","exports"],"sources":["../../../../src/languageProcessing/languages/ar/Researcher.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"Researcher.js","names":["_index","require","_firstWordExceptions","_interopRequireDefault","_functionWords","_transitionWords","_twoPartTransitionWords","_prefixedFunctionWords","_createBasicWordForms","_getStemmer","_isPassiveSentence","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","Object","assign","config","language","passiveConstructionType","firstWordExceptions","functionWords","transitionWords","twoPartTransitionWords","prefixedFunctionWordsRegex","PREFIXED_FUNCTION_WORDS_REGEX","helpers","createBasicWordForms","getStemmer","isPassiveSentence","exports"],"sources":["../../../../src/languageProcessing/languages/ar/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 transitionWords from './config/transitionWords';\nimport twoPartTransitionWords from './config/twoPartTransitionWords';\nimport {PREFIXED_FUNCTION_WORDS_REGEX} from './config/prefixedFunctionWords';\n\n// All helpers\nimport {createBasicWordForms} from './helpers/createBasicWordForms';\nimport getStemmer from './helpers/getStemmer';\nimport isPassiveSentence from './helpers/isPassiveSentence';\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 this.defaultResearches.getFleschReadingScore;\n\n Object.assign(this.config, {\n language: 'ar',\n passiveConstructionType: 'morphological',\n firstWordExceptions,\n functionWords,\n transitionWords,\n twoPartTransitionWords,\n prefixedFunctionWordsRegex: PREFIXED_FUNCTION_WORDS_REGEX\n });\n\n Object.assign(this.helpers, {\n createBasicWordForms,\n getStemmer,\n isPassiveSentence\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,uBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AAGA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,kBAAA,GAAAP,sBAAA,CAAAF,OAAA;AAA4D,SAAAE,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAZ5D,MAAM;EAACG;AAAkB,CAAC,GAAGC,yBAAkB;;AAE/C;;AAOA;;AAKA;AACA;AACA;AACe,MAAMC,UAAU,SAASF,kBAAkB,CAAC;EACzD;AACF;AACA;AACA;AACA;EACEG,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,OAAO,IAAI,CAACC,iBAAiB,CAACC,qBAAqB;IAEnDC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACC,MAAM,EAAE;MACzBC,QAAQ,EAAE,IAAI;MACdC,uBAAuB,EAAE,eAAe;MACxCC,mBAAmB,EAAnBA,4BAAmB;MACnBC,aAAa,EAAbA,kBAAa;MACbC,eAAe,EAAfA,wBAAe;MACfC,sBAAsB,EAAtBA,+BAAsB;MACtBC,0BAA0B,EAAEC;IAC9B,CAAC,CAAC;IAEFV,MAAM,CAACC,MAAM,CAAC,IAAI,CAACU,OAAO,EAAE;MAC1BC,oBAAoB,EAApBA,0CAAoB;MACpBC,UAAU,EAAVA,mBAAU;MACVC,iBAAiB,EAAjBA;IACF,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAvB,OAAA,GAAAG,UAAA","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("
|
|
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/ar/helpers/getStemmer.js"],"sourcesContent":["import {get} from 'lodash';\nimport {languageProcessing} from '
|
|
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/ar/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'), 'ar', 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 = isPassiveSentence;
|
|
7
7
|
var _passiveVerbsWithLongVowel = _interopRequireDefault(require("../config/internal/passiveVerbsWithLongVowel"));
|
|
8
|
-
var _index = require("
|
|
8
|
+
var _index = require("../../../index");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const {
|
|
11
11
|
getWords
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPassiveSentence.js","names":["_passiveVerbsWithLongVowel","_interopRequireDefault","require","_index","e","__esModule","default","getWords","languageProcessing","isPassiveSentence","sentence","arabicPrepositionalPrefix","words","passiveVerbs","word","startsWith","slice","wordWithDamma","length","search","getPassiveVerbs","includes","push"],"sources":["../../../../../src/languageProcessing/languages/ar/helpers/isPassiveSentence.js"],"sourcesContent":["import getPassiveVerbs from '../config/internal/passiveVerbsWithLongVowel';\nimport {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"isPassiveSentence.js","names":["_passiveVerbsWithLongVowel","_interopRequireDefault","require","_index","e","__esModule","default","getWords","languageProcessing","isPassiveSentence","sentence","arabicPrepositionalPrefix","words","passiveVerbs","word","startsWith","slice","wordWithDamma","length","search","getPassiveVerbs","includes","push"],"sources":["../../../../../src/languageProcessing/languages/ar/helpers/isPassiveSentence.js"],"sourcesContent":["import getPassiveVerbs from '../config/internal/passiveVerbsWithLongVowel';\nimport {languageProcessing} from '../../../index';\nconst {getWords} = languageProcessing;\n\n/**\n * Checks the passed sentence to see if it contains Arabic passive verb-forms.\n *\n * @param {string} sentence The sentence to match against.\n *\n * @returns {Boolean} Whether the sentence contains Arabic passive voice.\n */\nexport default function isPassiveSentence(sentence) {\n const arabicPrepositionalPrefix = 'و';\n const words = getWords(sentence);\n const passiveVerbs = [];\n\n for (let word of words) {\n // Check if the word starts with prefix و\n if (word.startsWith(arabicPrepositionalPrefix)) {\n word = word.slice(1);\n }\n let wordWithDamma = -1;\n // Check if the first character has a damma or if the word is in the list of Arabic passive verbs\n if (word.length >= 2) {\n wordWithDamma = word[1].search('\\u064F');\n }\n if (wordWithDamma !== -1 || getPassiveVerbs.includes(word)) {\n passiveVerbs.push(word);\n }\n }\n\n return passiveVerbs.length !== 0;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAkD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAClD,MAAM;EAACG;AAAQ,CAAC,GAAGC,yBAAkB;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,iBAAiBA,CAACC,QAAQ,EAAE;EAClD,MAAMC,yBAAyB,GAAG,GAAG;EACrC,MAAMC,KAAK,GAAGL,QAAQ,CAACG,QAAQ,CAAC;EAChC,MAAMG,YAAY,GAAG,EAAE;EAEvB,KAAK,IAAIC,IAAI,IAAIF,KAAK,EAAE;IACtB;IACA,IAAIE,IAAI,CAACC,UAAU,CAACJ,yBAAyB,CAAC,EAAE;MAC9CG,IAAI,GAAGA,IAAI,CAACE,KAAK,CAAC,CAAC,CAAC;IACtB;IACA,IAAIC,aAAa,GAAG,CAAC,CAAC;IACtB;IACA,IAAIH,IAAI,CAACI,MAAM,IAAI,CAAC,EAAE;MACpBD,aAAa,GAAGH,IAAI,CAAC,CAAC,CAAC,CAACK,MAAM,CAAC,QAAQ,CAAC;IAC1C;IACA,IAAIF,aAAa,KAAK,CAAC,CAAC,IAAIG,kCAAe,CAACC,QAAQ,CAACP,IAAI,CAAC,EAAE;MAC1DD,YAAY,CAACS,IAAI,CAACR,IAAI,CAAC;IACzB;EACF;EAEA,OAAOD,YAAY,CAACK,MAAM,KAAK,CAAC;AAClC","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("
|
|
7
|
+
var _index = require("../../../index");
|
|
8
8
|
var _transitionWords = _interopRequireDefault(require("./config/transitionWords"));
|
|
9
9
|
var _twoPartTransitionWords = _interopRequireDefault(require("./config/twoPartTransitionWords"));
|
|
10
10
|
var _sentenceLength = _interopRequireDefault(require("./config/sentenceLength"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Researcher.js","names":["_index","require","_transitionWords","_interopRequireDefault","_twoPartTransitionWords","_sentenceLength","_getStemmer","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","getPassiveVoiceResult","getSentenceBeginnings","functionWordsInKeyphrase","Object","assign","config","language","functionWords","transitionWords","twoPartTransitionWords","sentenceLength","helpers","getStemmer","exports"],"sources":["../../../../src/languageProcessing/languages/ca/Researcher.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"Researcher.js","names":["_index","require","_transitionWords","_interopRequireDefault","_twoPartTransitionWords","_sentenceLength","_getStemmer","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","getPassiveVoiceResult","getSentenceBeginnings","functionWordsInKeyphrase","Object","assign","config","language","functionWords","transitionWords","twoPartTransitionWords","sentenceLength","helpers","getStemmer","exports"],"sources":["../../../../src/languageProcessing/languages/ca/Researcher.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {AbstractResearcher} = languageProcessing;\n\n// All config\nimport transitionWords from './config/transitionWords';\nimport twoPartTransitionWords from './config/twoPartTransitionWords';\nimport sentenceLength from './config/sentenceLength';\n\n// All helpers\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 // Deletes researches that are currently not available in Catalan.\n // When the research is available, this line should be removed.\n delete this.defaultResearches.getFleschReadingScore;\n delete this.defaultResearches.getPassiveVoiceResult;\n delete this.defaultResearches.getSentenceBeginnings;\n delete this.defaultResearches.functionWordsInKeyphrase;\n\n Object.assign(this.config, {\n language: 'ca',\n functionWords: [],\n transitionWords,\n twoPartTransitionWords,\n sentenceLength\n });\n\n Object.assign(this.helpers, {\n getStemmer\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,eAAA,GAAAF,sBAAA,CAAAF,OAAA;AAGA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAA8C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAR9C,MAAM;EAACG;AAAkB,CAAC,GAAGC,yBAAkB;;AAE/C;;AAKA;;AAGA;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;IACA,OAAO,IAAI,CAACC,iBAAiB,CAACC,qBAAqB;IACnD,OAAO,IAAI,CAACD,iBAAiB,CAACE,qBAAqB;IACnD,OAAO,IAAI,CAACF,iBAAiB,CAACG,qBAAqB;IACnD,OAAO,IAAI,CAACH,iBAAiB,CAACI,wBAAwB;IAEtDC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACC,MAAM,EAAE;MACzBC,QAAQ,EAAE,IAAI;MACdC,aAAa,EAAE,EAAE;MACjBC,eAAe,EAAfA,wBAAe;MACfC,sBAAsB,EAAtBA,+BAAsB;MACtBC,cAAc,EAAdA;IACF,CAAC,CAAC;IAEFP,MAAM,CAACC,MAAM,CAAC,IAAI,CAACO,OAAO,EAAE;MAC1BC,UAAU,EAAVA;IACF,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAArB,OAAA,GAAAG,UAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStemmer.js","names":["_index","require","baseStemmer","languageProcessing","getStemmer"],"sources":["../../../../../src/languageProcessing/languages/ca/helpers/getStemmer.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"getStemmer.js","names":["_index","require","baseStemmer","languageProcessing","getStemmer"],"sources":["../../../../../src/languageProcessing/languages/ca/helpers/getStemmer.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {baseStemmer} = languageProcessing;\n\n/**\n * Returns the stemmer for a researcher.\n *\n * @returns {Function} The stemmer.\n */\nexport default function getStemmer() {\n return baseStemmer;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,MAAM;EAACC;AAAW,CAAC,GAAGC,yBAAkB;;AAExC;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CAAA,EAAG;EACnC,OAAOF,WAAW;AACpB","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("
|
|
7
|
+
var _index = require("../../../index");
|
|
8
8
|
var _firstWordExceptions = _interopRequireDefault(require("./config/firstWordExceptions"));
|
|
9
9
|
var _stopWords = _interopRequireDefault(require("./config/stopWords"));
|
|
10
10
|
var _functionWords = require("./config/functionWords");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Researcher.js","names":["_index","require","_firstWordExceptions","_interopRequireDefault","_stopWords","_functionWords","_transitionWords","_twoPartTransitionWords","_getClauses","_getStemmer","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","Object","assign","config","language","passiveConstructionType","firstWordExceptions","stopWords","functionWords","transitionWords","twoPartTransitionWords","helpers","getClauses","getStemmer","exports"],"sources":["../../../../src/languageProcessing/languages/cs/Researcher.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"Researcher.js","names":["_index","require","_firstWordExceptions","_interopRequireDefault","_stopWords","_functionWords","_transitionWords","_twoPartTransitionWords","_getClauses","_getStemmer","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","defaultResearches","getFleschReadingScore","Object","assign","config","language","passiveConstructionType","firstWordExceptions","stopWords","functionWords","transitionWords","twoPartTransitionWords","helpers","getClauses","getStemmer","exports"],"sources":["../../../../src/languageProcessing/languages/cs/Researcher.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {AbstractResearcher} = languageProcessing;\n\n// All config\nimport firstWordExceptions from './config/firstWordExceptions';\nimport stopWords from './config/stopWords';\nimport {all as functionWords} from './config/functionWords';\nimport transitionWords from './config/transitionWords';\nimport twoPartTransitionWords from './config/twoPartTransitionWords';\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 this.defaultResearches.getFleschReadingScore;\n\n Object.assign(this.config, {\n language: 'cs',\n passiveConstructionType: 'periphrastic',\n firstWordExceptions,\n stopWords,\n functionWords,\n transitionWords,\n twoPartTransitionWords\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,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,uBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAGA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,WAAA,GAAAN,sBAAA,CAAAF,OAAA;AAA8C,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAX9C,MAAM;EAACG;AAAkB,CAAC,GAAGC,yBAAkB;;AAE/C;;AAOA;;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,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,SAAS,EAATA,kBAAS;MACTC,aAAa,EAAbA,kBAAa;MACbC,eAAe,EAAfA,wBAAe;MACfC,sBAAsB,EAAtBA;IACF,CAAC,CAAC;IAEFT,MAAM,CAACC,MAAM,CAAC,IAAI,CAACS,OAAO,EAAE;MAC1BC,UAAU,EAAVA,mBAAU;MACVC,UAAU,EAAVA;IACF,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAArB,OAAA,GAAAG,UAAA","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getCzechClauses;
|
|
7
|
-
var _index = require("
|
|
7
|
+
var _index = require("../../../index");
|
|
8
8
|
var _Clause = _interopRequireDefault(require("../values/Clause"));
|
|
9
9
|
var _passiveVoiceAuxiliaries = _interopRequireDefault(require("../config/internal/passiveVoiceAuxiliaries.js"));
|
|
10
10
|
var _stopWords = _interopRequireDefault(require("../config/stopWords.js"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClauses.js","names":["_index","require","_Clause","_interopRequireDefault","_passiveVoiceAuxiliaries","_stopWords","e","__esModule","default","getClausesSplitOnStopWords","createRegexFromArray","languageProcessing","options","Clause","CzechClause","regexes","auxiliaryRegex","auxiliaries","stopCharacterRegex","stopwordRegex","stopwords","getCzechClauses","sentence"],"sources":["../../../../../src/languageProcessing/languages/cs/helpers/getClauses.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"getClauses.js","names":["_index","require","_Clause","_interopRequireDefault","_passiveVoiceAuxiliaries","_stopWords","e","__esModule","default","getClausesSplitOnStopWords","createRegexFromArray","languageProcessing","options","Clause","CzechClause","regexes","auxiliaryRegex","auxiliaries","stopCharacterRegex","stopwordRegex","stopwords","getCzechClauses","sentence"],"sources":["../../../../../src/languageProcessing/languages/cs/helpers/getClauses.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {getClausesSplitOnStopWords, createRegexFromArray} = languageProcessing;\n\nimport CzechClause from '../values/Clause';\nimport auxiliaries from '../config/internal/passiveVoiceAuxiliaries.js';\nimport stopwords from '../config/stopWords.js';\n\nconst options = {\n Clause: CzechClause,\n regexes: {\n auxiliaryRegex: createRegexFromArray(auxiliaries),\n stopCharacterRegex: /([:,])(?=[ \\n\\r\\t'\"+\\-»«‹›<>])/gi,\n stopwordRegex: createRegexFromArray(stopwords)\n }\n};\n\n/**\n * Gets the clauses from a sentence by determining sentence breakers.\n *\n * @param {string} sentence The sentence to split up into clauses.\n *\n * @returns {Array} The array with all clauses that have an auxiliary.\n */\nexport default function getCzechClauses(sentence) {\n return getClausesSplitOnStopWords(sentence, options);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,wBAAA,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,EAAEC,eAAW;EACnBC,OAAO,EAAE;IACPC,cAAc,EAAEN,oBAAoB,CAACO,gCAAW,CAAC;IACjDC,kBAAkB,EAAE,kCAAkC;IACtDC,aAAa,EAAET,oBAAoB,CAACU,kBAAS;EAC/C;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,eAAeA,CAACC,QAAQ,EAAE;EAChD,OAAOb,0BAA0B,CAACa,QAAQ,EAAEV,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("
|
|
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/cs/helpers/getStemmer.js"],"sourcesContent":["import {get} from 'lodash';\nimport {languageProcessing} from '
|
|
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/cs/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'), 'cs', 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":[]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
var _index = require("
|
|
7
|
+
var _index = require("../../../index");
|
|
8
8
|
var _passiveVoiceEndings = _interopRequireDefault(require("../../config/internal/passiveVoiceEndings"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getParticiples.js","names":["_index","require","_passiveVoiceEndings","_interopRequireDefault","e","__esModule","default","getWords","languageProcessing","_default","clauseText","words","filter","word","getPassiveEndingsCzech","some","ending","endsWith"],"sources":["../../../../../../src/languageProcessing/languages/cs/helpers/internal/getParticiples.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"getParticiples.js","names":["_index","require","_passiveVoiceEndings","_interopRequireDefault","e","__esModule","default","getWords","languageProcessing","_default","clauseText","words","filter","word","getPassiveEndingsCzech","some","ending","endsWith"],"sources":["../../../../../../src/languageProcessing/languages/cs/helpers/internal/getParticiples.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {getWords} = languageProcessing;\nimport getPassiveEndingsCzech from '../../config/internal/passiveVoiceEndings';\n\n/**\n * Creates an array of participles found in a clause.\n *\n * @param {string} clauseText The clause to find participles in.\n *\n * @returns {Array} The list with participles found.\n */\nexport default function(clauseText) {\n const words = getWords(clauseText);\n\n return words.filter(word => getPassiveEndingsCzech.some(ending => word.endsWith(ending)));\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA+E,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAD/E,MAAM;EAACG;AAAQ,CAAC,GAAGC,yBAAkB;AAGrC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAAC,SAASC,UAAU,EAAE;EAClC,MAAMC,KAAK,GAAGJ,QAAQ,CAACG,UAAU,CAAC;EAElC,OAAOC,KAAK,CAACC,MAAM,CAACC,IAAI,IAAIC,4BAAsB,CAACC,IAAI,CAACC,MAAM,IAAIH,IAAI,CAACI,QAAQ,CAACD,MAAM,CAAC,CAAC,CAAC;AAC3F","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("
|
|
7
|
+
var _index = require("../../../index");
|
|
8
8
|
var _getParticiples = _interopRequireDefault(require("../helpers/internal/getParticiples"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clause.js","names":["_index","require","_getParticiples","_interopRequireDefault","e","__esModule","default","values","languageProcessing","Clause","CzechClause","constructor","clauseText","auxiliaries","_participles","getParticiples","getClauseText","checkParticiples","setPassive","length","_default","exports"],"sources":["../../../../../src/languageProcessing/languages/cs/values/Clause.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"Clause.js","names":["_index","require","_getParticiples","_interopRequireDefault","e","__esModule","default","values","languageProcessing","Clause","CzechClause","constructor","clauseText","auxiliaries","_participles","getParticiples","getClauseText","checkParticiples","setPassive","length","_default","exports"],"sources":["../../../../../src/languageProcessing/languages/cs/values/Clause.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nimport getParticiples from '../helpers/internal/getParticiples';\nconst {values} = languageProcessing;\nconst {Clause} = values;\n\n/**\n * Creates a Clause object for the Czech language.\n */\nclass CzechClause 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 * Sets the clause passiveness to true if there is a participle present in the clause, otherwise sets it to false.\n *\n * @returns {void}\n */\n checkParticiples() {\n this.setPassive(this.getParticiples().length > 0);\n }\n}\n\nexport default CzechClause;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAgE,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAChE,MAAM;EAACG;AAAM,CAAC,GAAGC,yBAAkB;AACnC,MAAM;EAACC;AAAM,CAAC,GAAGF,MAAM;;AAEvB;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;EACEA,gBAAgBA,CAAA,EAAG;IACjB,IAAI,CAACC,UAAU,CAAC,IAAI,CAACH,cAAc,CAAC,CAAC,CAACI,MAAM,GAAG,CAAC,CAAC;EACnD;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEcI,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("
|
|
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","_syllables","_keyphraseLength","_memoizedSentenceTokenizer","_getClauses","_getStemmer","_calculateFleschReadingScore","_checkIfWordIsFunction","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","Object","assign","config","language","passiveConstructionType","firstWordExceptions","functionWords","stopWords","transitionWords","twoPartTransitionWords","syllables","keyphraseLength","helpers","getClauses","getStemmer","fleschReadingScore","memoizedTokenizer","checkIfWordIsFunction","exports"],"sources":["../../../../src/languageProcessing/languages/de/Researcher.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"Researcher.js","names":["_index","require","_firstWordExceptions","_interopRequireDefault","_functionWords","_stopWords","_transitionWords","_twoPartTransitionWords","_syllables","_keyphraseLength","_memoizedSentenceTokenizer","_getClauses","_getStemmer","_calculateFleschReadingScore","_checkIfWordIsFunction","e","__esModule","default","AbstractResearcher","languageProcessing","Researcher","constructor","paper","Object","assign","config","language","passiveConstructionType","firstWordExceptions","functionWords","stopWords","transitionWords","twoPartTransitionWords","syllables","keyphraseLength","helpers","getClauses","getStemmer","fleschReadingScore","memoizedTokenizer","checkIfWordIsFunction","exports"],"sources":["../../../../src/languageProcessing/languages/de/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 syllables from './config/syllables.json';\nimport keyphraseLength from './config/keyphraseLength';\nimport memoizedTokenizer from './helpers/memoizedSentenceTokenizer';\n\n// All helpers\nimport getClauses from './helpers/getClauses';\nimport getStemmer from './helpers/getStemmer';\nimport fleschReadingScore from './helpers/calculateFleschReadingScore';\nimport checkIfWordIsFunction from './helpers/checkIfWordIsFunction';\n\n/**\n * The researcher contains all the researches, helpers, data, and config.\n */\nexport default class Researcher extends AbstractResearcher {\n /**\n * Constructor\n * @param {Paper} paper The Paper object that is needed within the researches.\n * @constructor\n */\n constructor(paper) {\n super(paper);\n\n Object.assign(this.config, {\n language: 'de',\n passiveConstructionType: 'periphrastic',\n firstWordExceptions,\n functionWords,\n stopWords,\n transitionWords,\n twoPartTransitionWords,\n syllables,\n keyphraseLength\n });\n\n Object.assign(this.helpers, {\n getClauses,\n getStemmer,\n fleschReadingScore,\n memoizedTokenizer,\n checkIfWordIsFunction\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,UAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,gBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,0BAAA,GAAAP,sBAAA,CAAAF,OAAA;AAGA,IAAAU,WAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,WAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,4BAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,sBAAA,GAAAX,sBAAA,CAAAF,OAAA;AAAoE,SAAAE,uBAAAY,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAhBpE,MAAM;EAACG;AAAkB,CAAC,GAAGC,yBAAkB;;AAE/C;;AAUA;;AAMA;AACA;AACA;AACe,MAAMC,UAAU,SAASF,kBAAkB,CAAC;EACzD;AACF;AACA;AACA;AACA;EACEG,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACC,MAAM,EAAE;MACzBC,QAAQ,EAAE,IAAI;MACdC,uBAAuB,EAAE,cAAc;MACvCC,mBAAmB,EAAnBA,4BAAmB;MACnBC,aAAa,EAAbA,kBAAa;MACbC,SAAS,EAATA,kBAAS;MACTC,eAAe,EAAfA,wBAAe;MACfC,sBAAsB,EAAtBA,+BAAsB;MACtBC,SAAS,EAATA,kBAAS;MACTC,eAAe,EAAfA;IACF,CAAC,CAAC;IAEFX,MAAM,CAACC,MAAM,CAAC,IAAI,CAACW,OAAO,EAAE;MAC1BC,UAAU,EAAVA,mBAAU;MACVC,UAAU,EAAVA,mBAAU;MACVC,kBAAkB,EAAlBA,oCAAkB;MAClBC,iBAAiB,EAAjBA,kCAAiB;MACjBC,qBAAqB,EAArBA;IACF,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAxB,OAAA,GAAAG,UAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateFleschReadingScore.js","names":["_index","require","formatNumber","helpers","calculateScore","statistics","score","averageWordsPerSentence","numberOfSyllables","numberOfWords"],"sources":["../../../../../src/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js"],"sourcesContent":["import {helpers} from '
|
|
1
|
+
{"version":3,"file":"calculateFleschReadingScore.js","names":["_index","require","formatNumber","helpers","calculateScore","statistics","score","averageWordsPerSentence","numberOfSyllables","numberOfWords"],"sources":["../../../../../src/languageProcessing/languages/de/helpers/calculateFleschReadingScore.js"],"sourcesContent":["import {helpers} from '../../../index';\nconst {formatNumber} = helpers;\n\n/**\n * Returns the Flesch reading score for German.\n *\n * @param {Object} statistics The Flesch reading statistics.\n *\n * @returns {number} The Flesch reading score for German.\n */\nexport default function calculateScore(statistics) {\n const score =\n 180 -\n statistics.averageWordsPerSentence -\n (58.5 * statistics.numberOfSyllables) / statistics.numberOfWords;\n\n return formatNumber(score);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,MAAM;EAACC;AAAY,CAAC,GAAGC,cAAO;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,cAAcA,CAACC,UAAU,EAAE;EACjD,MAAMC,KAAK,GACT,GAAG,GACHD,UAAU,CAACE,uBAAuB,GACjC,IAAI,GAAGF,UAAU,CAACG,iBAAiB,GAAIH,UAAU,CAACI,aAAa;EAElE,OAAOP,YAAY,CAACI,KAAK,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getClauses;
|
|
7
|
-
var _index = require("
|
|
7
|
+
var _index = require("../../../index");
|
|
8
8
|
var _Clause = _interopRequireDefault(require("../values/Clause"));
|
|
9
9
|
var _passiveVoiceAuxiliaries = _interopRequireDefault(require("../config/internal/passiveVoiceAuxiliaries.js"));
|
|
10
10
|
var _stopWords = _interopRequireDefault(require("../config/stopWords.js"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClauses.js","names":["_index","require","_Clause","_interopRequireDefault","_passiveVoiceAuxiliaries","_stopWords","e","__esModule","default","getClausesSplitOnStopWords","createRegexFromArray","languageProcessing","options","Clause","GermanClause","regexes","auxiliaryRegex","auxiliaries","all","stopwordRegex","stopwords","getClauses","sentence"],"sources":["../../../../../src/languageProcessing/languages/de/helpers/getClauses.js"],"sourcesContent":["import {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"getClauses.js","names":["_index","require","_Clause","_interopRequireDefault","_passiveVoiceAuxiliaries","_stopWords","e","__esModule","default","getClausesSplitOnStopWords","createRegexFromArray","languageProcessing","options","Clause","GermanClause","regexes","auxiliaryRegex","auxiliaries","all","stopwordRegex","stopwords","getClauses","sentence"],"sources":["../../../../../src/languageProcessing/languages/de/helpers/getClauses.js"],"sourcesContent":["import {languageProcessing} from '../../../index';\nconst {getClausesSplitOnStopWords, createRegexFromArray} = languageProcessing;\n\nimport GermanClause from '../values/Clause';\nimport auxiliaries from '../config/internal/passiveVoiceAuxiliaries.js';\nimport stopwords from '../config/stopWords.js';\n\nconst options = {\n Clause: GermanClause,\n regexes: {\n auxiliaryRegex: createRegexFromArray(auxiliaries.all),\n stopwordRegex: createRegexFromArray(stopwords)\n }\n};\n\n/**\n * Gets the clauses from a sentence by determining sentence breakers.\n *\n * @param {string} sentence The sentence to split up into clauses.\n *\n * @returns {Array} The array with all clauses 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,wBAAA,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,EAAEC,eAAY;EACpBC,OAAO,EAAE;IACPC,cAAc,EAAEN,oBAAoB,CAACO,gCAAW,CAACC,GAAG,CAAC;IACrDC,aAAa,EAAET,oBAAoB,CAACU,kBAAS;EAC/C;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CAACC,QAAQ,EAAE;EAC3C,OAAOb,0BAA0B,CAACa,QAAQ,EAAEV,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("
|
|
8
|
+
var _index = require("../../../index");
|
|
9
9
|
var _determineStem = _interopRequireDefault(require("./internal/determineStem"));
|
|
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","_determineStem","_interopRequireDefault","e","__esModule","default","baseStemmer","languageProcessing","getStemmer","researcher","morphologyData","get","getData","word","determineStem"],"sources":["../../../../../src/languageProcessing/languages/de/helpers/getStemmer.js"],"sourcesContent":["import {get} from 'lodash';\nimport {languageProcessing} from '
|
|
1
|
+
{"version":3,"file":"getStemmer.js","names":["_lodash","require","_index","_determineStem","_interopRequireDefault","e","__esModule","default","baseStemmer","languageProcessing","getStemmer","researcher","morphologyData","get","getData","word","determineStem"],"sources":["../../../../../src/languageProcessing/languages/de/helpers/getStemmer.js"],"sourcesContent":["import {get} from 'lodash';\nimport {languageProcessing} from '../../../index';\nconst {baseStemmer} = languageProcessing;\n\nimport determineStem from './internal/determineStem';\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'), 'de', false);\n\n if (morphologyData) {\n return word => determineStem(word, morphologyData);\n }\n\n return baseStemmer;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAqD,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAFrD,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,sBAAa,EAACD,IAAI,EAAEH,cAAc,CAAC;EACpD;EAEA,OAAOJ,WAAW;AACpB","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("
|
|
8
|
+
var _index = require("../../../index");
|
|
9
9
|
var _detectAndStemRegularParticiple = require("./detectAndStemRegularParticiple");
|
|
10
10
|
var _stem = _interopRequireDefault(require("./stem"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|