henkan 2.4.2 → 2.4.3
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/dist/index.cjs.js +17 -27
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.mjs +17 -27
- package/dist/index.mjs.map +2 -2
- package/dist/types/utils.d.ts.map +1 -1
- package/docs/api/functions/convertJawiktionaryAsync.md +1 -1
- package/docs/api/functions/convertJawiktionarySync.md +1 -1
- package/docs/api/functions/generateAnkiNote.md +1 -1
- package/docs/api/functions/generateAnkiNotesFile.md +1 -1
- package/docs/api/functions/getKanji.md +1 -1
- package/docs/api/functions/getKanjiExtended.md +1 -1
- package/docs/api/functions/getWord.md +1 -1
- package/docs/api/functions/getWordDefinitions.md +1 -1
- package/docs/api/functions/getWordDefinitionsWithFurigana.md +1 -1
- package/package.json +5 -5
- package/src/utils.ts +24 -30
package/dist/index.cjs.js
CHANGED
|
@@ -1780,44 +1780,34 @@ function createEntryMaps(jmDict, kanjiDic, tanakaExamples, wordDefinitionPairs,
|
|
|
1780
1780
|
for (const ex of tanakaExamples)
|
|
1781
1781
|
for (const part of ex.parts) {
|
|
1782
1782
|
if (entryParts.has(part.baseForm)) {
|
|
1783
|
-
|
|
1783
|
+
const exList = partExamplesMap.get(
|
|
1784
1784
|
part.baseForm
|
|
1785
1785
|
);
|
|
1786
|
-
if (exList === void 0)
|
|
1787
|
-
|
|
1788
|
-
partExamplesMap.set(part.baseForm, exList);
|
|
1789
|
-
}
|
|
1790
|
-
exList.push(ex);
|
|
1786
|
+
if (exList === void 0) partExamplesMap.set(part.baseForm, [ex]);
|
|
1787
|
+
else exList.push(ex);
|
|
1791
1788
|
}
|
|
1792
1789
|
if (part.reading !== void 0 && entryParts.has(part.reading)) {
|
|
1793
|
-
|
|
1790
|
+
const exList = partExamplesMap.get(
|
|
1794
1791
|
part.reading
|
|
1795
1792
|
);
|
|
1796
|
-
if (exList === void 0)
|
|
1797
|
-
|
|
1798
|
-
partExamplesMap.set(part.reading, exList);
|
|
1799
|
-
}
|
|
1800
|
-
exList.push(ex);
|
|
1793
|
+
if (exList === void 0) partExamplesMap.set(part.reading, [ex]);
|
|
1794
|
+
else exList.push(ex);
|
|
1801
1795
|
}
|
|
1802
1796
|
if (part.inflectedForm !== void 0 && entryParts.has(part.inflectedForm)) {
|
|
1803
|
-
|
|
1797
|
+
const exList = partExamplesMap.get(
|
|
1804
1798
|
part.inflectedForm
|
|
1805
1799
|
);
|
|
1806
|
-
if (exList === void 0)
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
}
|
|
1810
|
-
exList.push(ex);
|
|
1800
|
+
if (exList === void 0)
|
|
1801
|
+
partExamplesMap.set(part.inflectedForm, [ex]);
|
|
1802
|
+
else exList.push(ex);
|
|
1811
1803
|
}
|
|
1812
1804
|
if (part.referenceID !== void 0 && entryParts.has(part.referenceID)) {
|
|
1813
|
-
|
|
1805
|
+
const exList = partExamplesMap.get(
|
|
1814
1806
|
part.referenceID
|
|
1815
1807
|
);
|
|
1816
|
-
if (exList === void 0)
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
}
|
|
1820
|
-
exList.push(ex);
|
|
1808
|
+
if (exList === void 0)
|
|
1809
|
+
partExamplesMap.set(part.referenceID, [ex]);
|
|
1810
|
+
else exList.push(ex);
|
|
1821
1811
|
}
|
|
1822
1812
|
}
|
|
1823
1813
|
for (const word of jmDict) {
|
|
@@ -2611,8 +2601,8 @@ function getWord(searchedWord, dict, kanjiDic, examples, definitions, noteTypeNa
|
|
|
2611
2601
|
const readingAsReadingMatch = part.reading !== void 0 && readings.has(part.reading);
|
|
2612
2602
|
const readingAsInflectedFormMatch = part.inflectedForm !== void 0 && readings.has(part.inflectedForm);
|
|
2613
2603
|
const referenceIDMatch = part.referenceID === dictWord.id;
|
|
2614
|
-
if (kanjiForms !== void 0 && kanjiForms.has(part.baseForm)
|
|
2615
|
-
if (readingAsReadingMatch || readingAsInflectedFormMatch) {
|
|
2604
|
+
if (kanjiForms !== void 0 && kanjiForms.has(part.baseForm)) {
|
|
2605
|
+
if (readingAsReadingMatch || readingAsInflectedFormMatch || referenceIDMatch) {
|
|
2616
2606
|
readingMatchingKanjiFormExamples.push({
|
|
2617
2607
|
ex: example,
|
|
2618
2608
|
partIndex: i
|
|
@@ -2628,7 +2618,7 @@ function getWord(searchedWord, dict, kanjiDic, examples, definitions, noteTypeNa
|
|
|
2628
2618
|
break;
|
|
2629
2619
|
}
|
|
2630
2620
|
const readingAsBaseFormMatch = readings.has(part.baseForm);
|
|
2631
|
-
if (readingAsBaseFormMatch && kanjiForms === void 0) {
|
|
2621
|
+
if ((readingAsBaseFormMatch || referenceIDMatch) && kanjiForms === void 0) {
|
|
2632
2622
|
readingExamples.push({ ex: example, partIndex: i });
|
|
2633
2623
|
seenPhrases.add(example.phrase);
|
|
2634
2624
|
break;
|