update README
This commit is contained in:
1 parent
b4bda0ccbf
commit
d2599f1efc
5 files changed
+32
-12
No files matched your search
@@ -2,6 +2,18 @@
|
|||||||
|
|
||||||
Extra contents beyond [WaniKani](https://www.wanikani.com).
|
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)
|
## [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)
|
- [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".
|
- 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.
|
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)
|
||||||
@@ -2,12 +2,6 @@
|
|||||||
|
|
||||||
## Joyo
|
## 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
|
## Newspaper
|
||||||
|
|
||||||
### 偲
|
### 偲
|
||||||
|
|||||||
@@ -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), ヒ いしぶみ
|
[56 - tombstone](https://www.wanikani.com/kanji/%E7%A2%91), ヒ いしぶみ
|
||||||
|
|
||||||
- <ruby>碑文<rt>ひぶん</rt></ruby>
|
- <ruby>碑文<rt>ひぶん</rt></ruby>
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ async function makeWaniKaniKanjiLevels(opts: { cache?: boolean } = {}) {
|
|||||||
return levelMap;
|
return levelMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function makeKanjiLevels() {
|
export async function makeKanjiLevels(opts: { useBeyond: boolean }) {
|
||||||
const wk = await makeWaniKaniKanjiLevels({ cache: true });
|
const wk = await makeWaniKaniKanjiLevels({ cache: true });
|
||||||
const beyond = yaml.load(
|
const beyond = opts.useBeyond
|
||||||
readFileSync('assets/beyond.yaml', 'utf-8'),
|
? (yaml.load(readFileSync('assets/beyond.yaml', 'utf-8')) as ILevelMap)
|
||||||
) as ILevelMap;
|
: {};
|
||||||
|
|
||||||
const kanjiToLevel = new Map<
|
const kanjiToLevel = new Map<
|
||||||
string,
|
string,
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import { makeKanjiLevels } from './get-kanji-level';
|
|||||||
|
|
||||||
const DECK = 'Takoboto';
|
const DECK = 'Takoboto';
|
||||||
const KANJI_FIELD = 'Japanese';
|
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() {
|
async function main() {
|
||||||
const anki = new AnkiConnect();
|
const anki = new AnkiConnect();
|
||||||
@@ -13,6 +19,7 @@ async function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const deckQuery = `deck:${DECK} -deck:${DECK}::*`;
|
const deckQuery = `deck:${DECK} -deck:${DECK}::*`;
|
||||||
|
const kanjiLevels = await makeKanjiLevels({ useBeyond: USE_BEYOND });
|
||||||
|
|
||||||
await anki
|
await anki
|
||||||
.api('findCards', {
|
.api('findCards', {
|
||||||
@@ -20,8 +27,6 @@ async function main() {
|
|||||||
})
|
})
|
||||||
.then((cards) => anki.api('cardsInfo', { cards }))
|
.then((cards) => anki.api('cardsInfo', { cards }))
|
||||||
.then(async (rs) => {
|
.then(async (rs) => {
|
||||||
const kanjiLevels = await makeKanjiLevels();
|
|
||||||
|
|
||||||
const modelToSubdecks = new Map<
|
const modelToSubdecks = new Map<
|
||||||
string,
|
string,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user