add tag adder

This commit is contained in:
polv committed 2022-04-28 15:03:57 +07:00
1 parent e178881b37
commit 16d1307744
4 files changed
+148 -26

No files matched your search

+4 -16
View File
@@ -25,24 +25,12 @@ async function makeWaniKaniKanjiLevels(
for (const k of wkKanji) {
const { level, characters } = k.data;
let category: string;
if (level < 11) {
category = '01-10: 快 PLEASANT';
} else if (level < 21) {
category = '11-21: 苦 PAINFUL';
} else if (level < 31) {
category = '21-30: 死 DEATH';
} else if (level < 41) {
category = '31-40: 地獄 HELL';
} else if (level < 51) {
category = '41-50: 天国 PARADISE';
} else {
category = '51-60: 現実 REALITY';
}
const label = WaniKani.getLevelLabel(level);
const category = `${label.range}: ${
label.ja
} ${label.en.toLocaleUpperCase()}`;
const catMap = levelMap[category] || {};
const levelString = level.toString().padStart(2, '0');
const ks = catMap[levelString] || [];
+3 -10
View File
@@ -6,14 +6,7 @@ if (require.main === module) {
// { ja: 'Japanese', audio: 'JapaneseAudio' },
// { mode: { online: true } },
// );
new WaniKani().populateSentence(
'note:jp.takoboto',
{
vocabJa: 'Japanese',
sentenceJa: 'Sentence',
sentenceAudio: 'SentenceAudio',
sentenceEn: 'SentenceMeaning',
},
{ overwrite: true },
);
new WaniKani().addTags('note:jp.takoboto', {
ja: 'Japanese',
});
}