# Automatically show japanese kanji meanings for premade vocabulary deck?

**URL:** <https://forums.ankiweb.net/t/automatically-show-japanese-kanji-meanings-for-premade-vocabulary-deck/33410>\
**Category:** Help\
**Created:** [August 19, 2023, 1:11pm UTC](https://forums.ankiweb.net/t/automatically-show-japanese-kanji-meanings-for-premade-vocabulary-deck/33410 "2023-08-19T13:11:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![quantonium](https://avatars.discourse-cdn.com/v4/letter/q/94ad74/32.png) [@quantonium](https://forums.ankiweb.net/u/quantonium)\
**Post date:** [August 19, 2023, 1:11pm UTC](https://forums.ankiweb.net/t/automatically-show-japanese-kanji-meanings-for-premade-vocabulary-deck/33410/1 "2023-08-19T13:11:12Z")

</div>

I have a premade japanese vocabulary deck of 6000 cards, where most words include kanji. However, these cards do not include the meaning of the kanji used in the words. Does anyone know of a way I could “automatically” add the necessary kanji meanings that each card requires?

---

<div class="post-metadata">

**Author:** ![Shigeyuki](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/shigeyuki/32/23878_2.png) [@Shigeyuki](https://forums.ankiweb.net/u/Shigeyuki)\
**Post date:** [August 19, 2023, 4:29pm UTC](https://forums.ankiweb.net/t/automatically-show-japanese-kanji-meanings-for-premade-vocabulary-deck/33410/2 "2023-08-19T16:29:42Z")

</div>

These add-ons are similar to that functionality so may be helpful.

- [Anki Dojo](https://ankiweb.net/shared/info/433778282)
- [Jisho Support](https://ankiweb.net/shared/info/1262434132)
- [Japanese Definition Scraper from weblio Dictionary](https://ankiweb.net/shared/info/2055037404)
- [Daijirin Dictionary Scraper](https://ankiweb.net/shared/info/311119199)
- [Migaku Anki Add-on](https://ankiweb.net/shared/info/1846879528)

Or, try asking on the language learning reddit for a good way to do it.

- [r/LearnJapanese](https://www.reddit.com/r/LearnJapanese/)

---

<div class="post-metadata">

**Author:** ![quantonium](https://avatars.discourse-cdn.com/v4/letter/q/94ad74/32.png) [@quantonium](https://forums.ankiweb.net/u/quantonium)\
**Post date:** [August 19, 2023, 7:24pm UTC](https://forums.ankiweb.net/t/automatically-show-japanese-kanji-meanings-for-premade-vocabulary-deck/33410/3 "2023-08-19T19:24:15Z")

</div>

I managed to solve the problem by making my own python script. Thank you, though.

---

<div class="post-metadata">

**Author:** ![ferophila](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/ferophila/32/10566_2.png) [@ferophila](https://forums.ankiweb.net/u/ferophila)\
**Post date:** [August 19, 2023, 7:44pm UTC](https://forums.ankiweb.net/t/automatically-show-japanese-kanji-meanings-for-premade-vocabulary-deck/33410/4 "2023-08-19T19:44:02Z")

</div>

Some else could profit from your script, do you mind sharing it?

---

<div class="post-metadata">

**Author:** ![quantonium](https://avatars.discourse-cdn.com/v4/letter/q/94ad74/32.png) [@quantonium](https://forums.ankiweb.net/u/quantonium)\
**Post date:** [August 20, 2023, 4:37am UTC](https://forums.ankiweb.net/t/automatically-show-japanese-kanji-meanings-for-premade-vocabulary-deck/33410/5 "2023-08-20T04:37:55Z")

</div>

I’m very busy at the moment, so I won’t elaborate on the process. In any case, it was very convoluted and specific to my case. But you’re right, I will post the (ugly) script below, as well as link to the two necessary files I used: a list of all kanji thaught through wanikani, with their primary meaning, as well as an ordered list of all vocabulary found in these anki decks [https://ankiweb.net/shared/by-author/1863168610](https://ankiweb.net/shared/by-author/1863168610). I then simply imported the resulting text file (also given in the link below) into anki, and it somehow added the meaning automatically to the vocab cards (i needed to add a new field to the vocab cards, and import the text file using the same note style).

> **[kanji.rar](https://www.dropbox.com/scl/fi/lsw24nkjvmfteuxoy6sqo/kanji.rar?rlkey=mhfuowzzk20qm2tfgy1nsabam&dl=0)**
>
> Shared with Dropbox

> **Code**
>
> ```auto
> lines = []
> with open("kanjimeanings.txt", "r", encoding="utf8") as infile:   
> for line in infile:
> line = line.split("\t")
> lines.append(line)
> kanjis = lines.copy()
> 
> kanjidict = {}
> for i in range(0, len(kanjis)):
> kanjidict[kanjis[i][0]] = kanjis[i][1]
>     
> 
> lines = []
> with open("orderedvocablist.txt", "r", encoding="utf8") as infile:   
> for line in infile:
> line = line.split("\t")
> lines.append(line)
> vocab = lines.copy()
> 
> i = 0
> for tup in vocab:
> vocab[i][1] += str(i+1)+"\t"
> for letter in tup[2]:
> if letter in kanjidict:
> vocab[i][1] += kanjidict[letter].rstrip("\n") + " - "
> vocab[i][1] = vocab[i][1].rstrip(" - ")
> vocab[i][1] += " "+"\n"
> i += 1
>     
> 
> file = open("orderedvocablistwithkanjimeanings.txt", "w")
> for a in vocab:
> file.write(a[1])
> file.close()
> 
> ```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [September 19, 2023, 4:38am UTC](https://forums.ankiweb.net/t/automatically-show-japanese-kanji-meanings-for-premade-vocabulary-deck/33410/6 "2023-09-19T04:38:53Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
