A Node.JS library that helps you convert any dictionary from EDRDG, transform their entries into more user-friendly schemas and create Anki notes from them.
The library is used for the Full Japanese Study Deck, so some features might be tailored specifically to the deck.
# npm
npm install henkan
# or yarn
yarn add henkan
# or pnpm
pnpm add henkan- JMdict, KANJIDIC, Tanaka Corpus, RADK and KRAD conversion
- User-friendly schemas for dictionary entries
- Anki note generation
- "Japanese definition"-"JMdict entry" pairing (using
ja.wiktionary.orgdumps) - Other useful tools (Japanese RegExps, array checking etc.)
Download the JMdict_e.gz archive and extract JMdict_e from it.
import fs from 'fs';
import { convertJMdict, generateAnkiNotesFile, getWord } from 'henkan';
//const fs = require('fs');
//const { convertJMdict, generateAnkiNotesFile, getWord } = require('henkan');
const dictPath = './JMdict_e';
const dictContent = fs.readFileSync(dictPath, 'utf-8');
const dictWords = convertJMdict(dictContent);
const jmDict = undefined, kanjiDic = undefined, tanakaCorpus = undefined, definitions = undefined;
const noteTypeName = 'Word';
const deckName = 'Japanese::Vocabulary::No kanji form words';
const noKanjiFormWords = dictWords
.filter(word => word.kanjiForms === undefined)
.map(word => getWord(word, jmDict, kanjiDic, tanakaCorpus, definitions, noteTypeName, deckName));
const ankiNotesFile = generateAnkiNotesFile(noKanjiFormWords);
fs.writeFileSync('./nokfwords.json', ankiNotesFile, 'utf-8');See API README
See CONTRIBUTING.md
This library is licensed under the MIT License.