update README
This commit is contained in:
1 parent
b4bda0ccbf
commit
d2599f1efc
5 files changed
+32
-12
No files matched your search
@@ -61,11 +61,11 @@ async function makeWaniKaniKanjiLevels(opts: { cache?: boolean } = {}) {
|
||||
return levelMap;
|
||||
}
|
||||
|
||||
export async function makeKanjiLevels() {
|
||||
export async function makeKanjiLevels(opts: { useBeyond: boolean }) {
|
||||
const wk = await makeWaniKaniKanjiLevels({ cache: true });
|
||||
const beyond = yaml.load(
|
||||
readFileSync('assets/beyond.yaml', 'utf-8'),
|
||||
) as ILevelMap;
|
||||
const beyond = opts.useBeyond
|
||||
? (yaml.load(readFileSync('assets/beyond.yaml', 'utf-8')) as ILevelMap)
|
||||
: {};
|
||||
|
||||
const kanjiToLevel = new Map<
|
||||
string,
|
||||
|
||||
@@ -4,6 +4,12 @@ import { makeKanjiLevels } from './get-kanji-level';
|
||||
|
||||
const DECK = 'Takoboto';
|
||||
const KANJI_FIELD = 'Japanese';
|
||||
/**
|
||||
* Whether to use Level > 60, i.e. outside WaniKani
|
||||
*
|
||||
* @link https://community.wanikani.com/t/fake-levels-61-70-or-%E7%84%A1%E9%99%90-infinity/16399
|
||||
*/
|
||||
const USE_BEYOND = true;
|
||||
|
||||
async function main() {
|
||||
const anki = new AnkiConnect();
|
||||
@@ -13,6 +19,7 @@ async function main() {
|
||||
});
|
||||
|
||||
const deckQuery = `deck:${DECK} -deck:${DECK}::*`;
|
||||
const kanjiLevels = await makeKanjiLevels({ useBeyond: USE_BEYOND });
|
||||
|
||||
await anki
|
||||
.api('findCards', {
|
||||
@@ -20,8 +27,6 @@ async function main() {
|
||||
})
|
||||
.then((cards) => anki.api('cardsInfo', { cards }))
|
||||
.then(async (rs) => {
|
||||
const kanjiLevels = await makeKanjiLevels();
|
||||
|
||||
const modelToSubdecks = new Map<
|
||||
string,
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user