Browse Source

update README

main
parent
commit
d2599f1efc
5 changed files with 32 additions and 12 deletions
  1. +17
    -0
      README.md
  2. +0
    -6
      docs/kanji/beyond.md
  3. +4
    -0
      docs/kanji/wanikani.md
  4. +4
    -4
      scripts/get-kanji-level.ts
  5. +7
    -2
      scripts/sort-anki.ts

+ 17
- 0
README.md View File

@ -2,6 +2,18 @@
Extra contents beyond [WaniKani](https://www.wanikani.com).
## [Yomichan](https://foosoft.net/projects/yomichan/) or whatever custom vocab-to-Anki creator, card sorter
This also sorts any vocabulary by WaniKani levels. I also have an old project of [Kanji beyond WaniKani](https://community.wanikani.com/t/fake-levels-61-70-or-%E7%84%A1%E9%99%90-infinity/16399). You can also use that (or opt not to).
- Clone this repo
- Get `WANIKANI_API_KEY` from <https://www.wanikani.com/settings/personal_access_tokens>
- Install [Node.js](https://nodejs.org/en/), `npm i -g yarn`, `yarn`
- Confirm the constants in [`scripts/sort-anki.ts`](https://git.polv.cc/polv/wk-extra/src/branch/main/scripts/sort-anki.ts)
- Run `yarn ts scripts/sort-anki.ts`
Note that [Kanji beyond WaniKani](https://community.wanikani.com/t/fake-levels-61-70-or-%E7%84%A1%E9%99%90-infinity/16399) **may be modified** or sorted in the future, depending on [Kanji with common components that aren’t Wanikani radicals](https://community.wanikani.com/t/x/56335) and my experience.
## [Kanji with common components that aren’t Wanikani radicals](https://community.wanikani.com/t/x/56335)
- [Wanikani Kanji that can serve as radicals](https://git.polv.cc/polv/wk-extra/src/branch/main/docs/kanji/radicalized-kanji.md)
@ -22,3 +34,8 @@ I also consider stepping into fonts' territory, if I deem that necessary; for ex
- I will create a full website, if necessary to render "fonts".
It is also possible that I will add Chinese contents (Hanzi) in the future.
## Extras
- Typed [AnkiConnect](https://foosoft.net/projects/anki-connect) can be found at [`src/ankiconnect.ts`](https://git.polv.cc/polv/wk-extra/src/branch/main/src/ankiconnect.ts)
- Typed [WaniKani API v2](https://www.wanikani.com/api/v2) can be found at [`src/wanikani.ts`](https://git.polv.cc/polv/wk-extra/src/branch/main/src/wanikani.ts)

+ 0
- 6
docs/kanji/beyond.md View File

@ -2,12 +2,6 @@
## Joyo
### 脊
spine, Joyo, セキ
[Stroke order and direction](https://jisho.org/search/%E8%84%8A%20%23kanji) for this, [in Chinese](https://www.mdbg.net/chinese/dictionary?page=worddict&wdrst=0&wdqb=%E8%84%8A), is a little different.
## Newspaper
### 偲

+ 4
- 0
docs/kanji/wanikani.md View File

@ -19,6 +19,10 @@
### 碑
[55 - stature](https://www.wanikani.com/kanji/%E8%84%8A), セキ せ せい
- [Stroke order and direction](https://jisho.org/search/%E8%84%8A%20%23kanji) for this, [in Chinese](https://www.mdbg.net/chinese/dictionary?page=worddict&wdrst=0&wdqb=%E8%84%8A), is a little different.
[56 - tombstone](https://www.wanikani.com/kanji/%E7%A2%91), ヒ いしぶみ
- <ruby>碑文<rt>ひぶん</rt></ruby>

+ 4
- 4
scripts/get-kanji-level.ts View File

@ -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,

+ 7
- 2
scripts/sort-anki.ts View File

@ -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,
{

Loading…
Cancel
Save