MandarinBanana Mnemonics Anki Import

Today I’ve created a text file with the mnemonics from to import in Anki. You can download the file here:

It is a tab-separated text file (compressed as zip, because it is 45 MB large uncompressed). This is what the import looks like:

Anki import screen
# / nameWhat’s inside
1 / hanziJust a single Chinese character, no HTML formatting. Example: 仍
2 / componentsA simple line showing the components (example: 仍 = 乃 + 亻), followed by dictionary entries for the components and mnemonics for the components.
3 / translationsDictionary entries for the character and any mnemonics associated with the character.
4 / imagesLinks to the comics associated with the character (no download option available so far)
5 / appearancesA list of characters which use the root character as component (example: 仍 appears in 芿)
6 / subtitlesSubtitles of the movies on which contain the character. If you click on the sentence, it will open in the browser.
7 / wordsA list of CC-CEDICT dictionary entries for words the character appears in.

There’s a lot of HTML formatting inside. Here’s what my styling section in Anki looks like (just as an example):

.card {
 font-size: 16px;
 text-align: center;
 background: black;
 color: white;

.mnemonics {
  margin-top: 1em;
  padding-top: 1em;
  border-top: 1px solid gray;

table {
  margin-left: auto;
  margin-right: auto;

td {
  border: 1px solid;
  padding: 5px;

div {
  margin: 5px;

.hanzi {
font-size: 2em;
font-family: "zenhei";

a {
text-decoration: none;
color: inherit;

ul {
  list-style-type: none;

.mandarinbananalink a {
text-decoration: none;
color: orange;

img.mimage {
width: 200px;
background-color: white;
border: 1px solid white;
margin: 1px;

@font-face {
  font-family: uming;
  src: url('_UMingCN.ttf');

@font-face {
  font-family: simfang;
  src: url('_simfang.ttf');

@font-face {
 font-family: zenhei;
 src: url('_WenQuanYiZenHei.ttf');

.color1 {
color: orangered;

.color2 {
color: yellow;

.color3 {
color: limegreen;

.color4 {
color: dodgerblue;

Each mnemonic is followed by the author’s name (since all mnemonics are CC-BY). If you like to, you can hide this information by including the following code in your “Styling” section:

.authorattribution {
display: none;

I hope this is useful for you! If you need a different format let me know in the comments.

If you want to have a look how the file is generated, please head over to It takes a few minutes for the script to run because there are so many database calls, which makes it difficult to, for example, post a link on which always returns the latest collection. I’ll have to implement some caching mechanism first, but it’s one of the things I definitely want to do to complete the site.

Have fun learning Chinese!

Copyright information: all mnemonics CC-BY by the respective authors. Dictionary entries: CC-SA CC-CEDICT (

Chinese Text Analyzer (in Python)

Now that I’ve finished writing mnemonics for all HSK characters I started reading 活着 by 余华 and needed to figure out which characters I should learn (i.e. write mnemonics for) to enjoy reading this novel. Therefore I wrote a simple Chinese Text Analyzer which counts the appearance of each character and sorts by HSK. Here it is:

Continue reading Chinese Text Analyzer (in Python)

Controlling Ankidroid with a Joycon

This post is kind of an addendum to my previous post, but it’s about controlling Ankidroid. You’ll need the app “External keyboard helper pro” (about $2). Here are the steps:

  1. Press the sync button on the Joycon and pair it with your Android device.
  2. Open “EKH Settings”, go to “Advanced settings”, “Keyboard mapping”, “Customize keyboard mappings”, and click on “Add new key mapping” for each button you want to map. For Example, I have SL and SR mapped to 0 and space respectively as in my previous post.
  3. Open Ankidroid and enjoy flipping your cards with your Joycon! You’ll have to set External Keyboard Helper as input method before.

More info on using the buttons on your headphones (similar approach):

Controlling Anki on Linux using a Nintendo Switch Joycon

I’m lying in bed all day curing a cold and I can’t really motivate myself to tackle the 1000+ reviews I’ve amassed over the last few weeks. There’s one gimmick I just implemented to motivate myself, and that is to use one of the Joycons of my Nintendo Switch to control Anki on Ubuntu. Much more comfortable than the laptop keyboard.

Continue reading Controlling Anki on Linux using a Nintendo Switch Joycon

Practicing Chinese character stroke order in Anki: Natural tracing with JavaScript

A couple of weeks ago I found an amazing resource: makemeahanzi on Github by the excellent Shaunak Kishore. It is a repository of Chinese character stroke order information which he created by applying machine learning to the fonts Arphic PL KaitiM GB and Arphic PL UKai. There is also a natural app he is working on and you should definitely check it out: Inkstone. In the makemeahanzi repository, the individual strokes are saved in SVG format, and it is not very complicated to render them via JavaScript. The big advantage is that Anki naturally supports JavaScript, no plug-ins are necessary (edit: see below), and so the whole thing also works on Ankidroid. Have a look at this short video to see what it looks like:

Continue reading Practicing Chinese character stroke order in Anki: Natural tracing with JavaScript

Matplotlib tricks

Two little things I need now and then and am tired of looking up. To change the default font to one which supports Greek characters:

from matplotlib import rcParams
rcParams['font.sans-serif'] = 'DejaVu Sans'

To scale the xticklabels:

ax.set_xticklabels([ int(np.round(i)) for i in ax.get_xticks()*10**6 ])