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.mjs CHANGED
@@ -1717,44 +1717,34 @@ function createEntryMaps(jmDict, kanjiDic, tanakaExamples, wordDefinitionPairs,
1717
1717
  for (const ex of tanakaExamples)
1718
1718
  for (const part of ex.parts) {
1719
1719
  if (entryParts.has(part.baseForm)) {
1720
- let exList = partExamplesMap.get(
1720
+ const exList = partExamplesMap.get(
1721
1721
  part.baseForm
1722
1722
  );
1723
- if (exList === void 0) {
1724
- exList = [];
1725
- partExamplesMap.set(part.baseForm, exList);
1726
- }
1727
- exList.push(ex);
1723
+ if (exList === void 0) partExamplesMap.set(part.baseForm, [ex]);
1724
+ else exList.push(ex);
1728
1725
  }
1729
1726
  if (part.reading !== void 0 && entryParts.has(part.reading)) {
1730
- let exList = partExamplesMap.get(
1727
+ const exList = partExamplesMap.get(
1731
1728
  part.reading
1732
1729
  );
1733
- if (exList === void 0) {
1734
- exList = [];
1735
- partExamplesMap.set(part.reading, exList);
1736
- }
1737
- exList.push(ex);
1730
+ if (exList === void 0) partExamplesMap.set(part.reading, [ex]);
1731
+ else exList.push(ex);
1738
1732
  }
1739
1733
  if (part.inflectedForm !== void 0 && entryParts.has(part.inflectedForm)) {
1740
- let exList = partExamplesMap.get(
1734
+ const exList = partExamplesMap.get(
1741
1735
  part.inflectedForm
1742
1736
  );
1743
- if (exList === void 0) {
1744
- exList = [];
1745
- partExamplesMap.set(part.inflectedForm, exList);
1746
- }
1747
- exList.push(ex);
1737
+ if (exList === void 0)
1738
+ partExamplesMap.set(part.inflectedForm, [ex]);
1739
+ else exList.push(ex);
1748
1740
  }
1749
1741
  if (part.referenceID !== void 0 && entryParts.has(part.referenceID)) {
1750
- let exList = partExamplesMap.get(
1742
+ const exList = partExamplesMap.get(
1751
1743
  part.referenceID
1752
1744
  );
1753
- if (exList === void 0) {
1754
- exList = [];
1755
- partExamplesMap.set(part.referenceID, exList);
1756
- }
1757
- exList.push(ex);
1745
+ if (exList === void 0)
1746
+ partExamplesMap.set(part.referenceID, [ex]);
1747
+ else exList.push(ex);
1758
1748
  }
1759
1749
  }
1760
1750
  for (const word of jmDict) {
@@ -2548,8 +2538,8 @@ function getWord(searchedWord, dict, kanjiDic, examples, definitions, noteTypeNa
2548
2538
  const readingAsReadingMatch = part.reading !== void 0 && readings.has(part.reading);
2549
2539
  const readingAsInflectedFormMatch = part.inflectedForm !== void 0 && readings.has(part.inflectedForm);
2550
2540
  const referenceIDMatch = part.referenceID === dictWord.id;
2551
- if (kanjiForms !== void 0 && kanjiForms.has(part.baseForm) || referenceIDMatch) {
2552
- if (readingAsReadingMatch || readingAsInflectedFormMatch) {
2541
+ if (kanjiForms !== void 0 && kanjiForms.has(part.baseForm)) {
2542
+ if (readingAsReadingMatch || readingAsInflectedFormMatch || referenceIDMatch) {
2553
2543
  readingMatchingKanjiFormExamples.push({
2554
2544
  ex: example,
2555
2545
  partIndex: i
@@ -2565,7 +2555,7 @@ function getWord(searchedWord, dict, kanjiDic, examples, definitions, noteTypeNa
2565
2555
  break;
2566
2556
  }
2567
2557
  const readingAsBaseFormMatch = readings.has(part.baseForm);
2568
- if (readingAsBaseFormMatch && kanjiForms === void 0) {
2558
+ if ((readingAsBaseFormMatch || referenceIDMatch) && kanjiForms === void 0) {
2569
2559
  readingExamples.push({ ex: example, partIndex: i });
2570
2560
  seenPhrases.add(example.phrase);
2571
2561
  break;