henkan 2.2.2 → 2.2.4
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 +8 -8
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +2 -2
- package/dist/types/utils.d.ts.map +1 -1
- package/docs/api/functions/convertJMdict.md +1 -1
- package/docs/api/functions/convertJawiktionaryAsync.md +1 -1
- package/docs/api/functions/convertJawiktionarySync.md +1 -1
- package/docs/api/functions/convertKanjiDic.md +1 -1
- package/docs/api/functions/convertKradFile.md +1 -1
- package/docs/api/functions/convertRadkFile.md +1 -1
- package/docs/api/functions/convertTanakaCorpus.md +1 -1
- package/docs/api/functions/convertTanakaCorpusWithFurigana.md +1 -1
- package/docs/api/functions/createEntryMaps.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 +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1273,7 +1273,8 @@ function shuffleArray(arr) {
|
|
|
1273
1273
|
function getValidForms(readings, kanjiForms, wordIsCommon) {
|
|
1274
1274
|
const kanjiFormRestrictions = /* @__PURE__ */ new Set();
|
|
1275
1275
|
const validReadings = readings.filter(
|
|
1276
|
-
(reading) => {
|
|
1276
|
+
(reading, index) => {
|
|
1277
|
+
if (index === 0) return true;
|
|
1277
1278
|
if (reading.notes === void 0 || !reading.notes.some((note) => notSearchedForms.has(note))) {
|
|
1278
1279
|
if (reading.kanjiFormRestrictions) {
|
|
1279
1280
|
for (const kfr of reading.kanjiFormRestrictions)
|
|
@@ -1286,10 +1287,11 @@ function getValidForms(readings, kanjiForms, wordIsCommon) {
|
|
|
1286
1287
|
return false;
|
|
1287
1288
|
}
|
|
1288
1289
|
);
|
|
1289
|
-
const existValidKf = kanjiForms ? kanjiForms.some(
|
|
1290
|
-
(kf) => (kf.notes === void 0 || !kf.notes.some((note) => notSearchedForms.has(note))) && (wordIsCommon === void 0 || kf.commonness !== void 0) || kanjiFormRestrictions.has(kf.form)
|
|
1290
|
+
const existValidKf = kanjiForms !== void 0 ? kanjiForms.some(
|
|
1291
|
+
(kf, index) => index !== 0 && ((kf.notes === void 0 || !kf.notes.some((note) => notSearchedForms.has(note))) && (wordIsCommon === void 0 || kf.commonness !== void 0) || kanjiFormRestrictions.has(kf.form))
|
|
1291
1292
|
) : void 0;
|
|
1292
|
-
const validKanjiForms = kanjiForms ? kanjiForms.filter((kanjiForm) => {
|
|
1293
|
+
const validKanjiForms = kanjiForms !== void 0 ? kanjiForms.filter((kanjiForm, index) => {
|
|
1294
|
+
if (index === 0) return true;
|
|
1293
1295
|
if (existValidKf === true)
|
|
1294
1296
|
return (kanjiForm.notes === void 0 || !kanjiForm.notes.some(
|
|
1295
1297
|
(note) => notSearchedForms.has(note)
|
|
@@ -2461,9 +2463,7 @@ function getWord(word, dict, kanjiDic, examples, definitions, noteTypeName, deck
|
|
|
2461
2463
|
}
|
|
2462
2464
|
}
|
|
2463
2465
|
}
|
|
2464
|
-
if (glossSpecificExamples.length
|
|
2465
|
-
wordExamples = glossSpecificExamples;
|
|
2466
|
-
else if (glossSpecificExamples.length > 0) {
|
|
2466
|
+
if (glossSpecificExamples.length > 0) {
|
|
2467
2467
|
const exes = glossSpecificExamples;
|
|
2468
2468
|
if (exes.length < 5) {
|
|
2469
2469
|
wordExamples = wordExamples.filter(
|
|
@@ -2478,7 +2478,7 @@ function getWord(word, dict, kanjiDic, examples, definitions, noteTypeName, deck
|
|
|
2478
2478
|
wordExamples = exes;
|
|
2479
2479
|
}
|
|
2480
2480
|
if (wordExamples.length > 0) {
|
|
2481
|
-
word2.phrases = (
|
|
2481
|
+
word2.phrases = (glossSpecificExamples.length === 0 ? wordExamples.slice(0, 5) : wordExamples).map((ex) => {
|
|
2482
2482
|
var _a2;
|
|
2483
2483
|
return {
|
|
2484
2484
|
phrase: (_a2 = ex.ex.furigana) != null ? _a2 : ex.ex.phrase,
|