máobĭ (毛笔) is an Anki add-on to create cards with writing quizzes for Hanzi (Chinese characters). Have a look:
Learning words consisting of more than one Hanzi also work (thanks to arueckle):
Learning Chinese is difficult, remembering what you have learned even more so. I heavily rely on Anki to review my vocabulary. It has changed my study life and made it possible for me to remember all the words, characters, chengyu, sentences and pass my exams.
While Anki itself is good to remember the meaning of words and characters, I found it difficult to use for remembering writing Hanzi. There is the possiblity of using AnkiDroid and the built-in whiteboard or defining a workflow as described in a blog entry of EastAsiaStudent. I tried it, but I did not like it too much.
A paid alternative that I used heavily in the past is Skritter. Right now, I really dislike the Version 2, their update policy and the bugs in the scheduling. It also is really unresponsive, making me wasting (lots of!) time by just waiting for the app. A contender of Skritter for mobile is Inkstone, but I did not get warm with that either.
Another aspect is that I personally do not like to use many different programs and tools to collect vocabulary. Therefore, I built maobi to remember writing Hanzi within Anki. Now, I have all my learning progress in one tool!
I did not design the writing component, it comes from the awesome Hanzi Writer JavaScript library. Without it, this would not be possible. maobi merely bundles it with Anki. Please visit the Hanzi Writer website and look how nice it looks!
The chinese character and stroke order data used by Hanzi Writer is derived from the Make me a Hanzi. The data can be found in the Hanzi Writer Data repo.
- Install the addon via the code found on the maobi Anki page.
- Download and import the example deck.
- Restart Anki.
- Open the deck and start writing!
In order to use maobi for your own deck, you need to follow these simple steps:
Use the code found on the maobi Anki page.
You need to create a note type which has a field that contains the character, e.g. Hanzi
. The other
fields are up to you. You can e.g. use the card types that come with the extremely useful
Chinese Support Redux add-on.
When using this addon, you can optionally configure Maobi to display tone colors from the Colors
field.
Then, you need to create cards with this note type. I personally generated a deck with all important characters from CC-CEDICT. After I imported it, I immediately suspended all cards. Whenever I want to learn a new character, I just search and then unsuspend it. This saves time from creating cards and looking up definitions.
In order to let maobi insert the quiz into a card, its template need to contain
<div id="character-target-div"></div>
on the question side. In its position, the quiz will be inserted. In addition, an optional button may be inserted in the template to reveal the current character's strokes:
<div id="reveal-character-btn" label="Reveal"></div>
Further, an optional button to restart the current quiz can be inserted. This will restart the quiz of the current Hanzi if there are already completed strokes for this Hanzi, otherwise it will restart the quizzes of all Hanzi in the current card:
<div id="restart-quiz-btn" label="Restart Quiz"></div>
You can add or overwrite the default style by using the character-target-div
id, by adding e.g.
#character-target-div > div {
background-color: magenta;
}
to the CSS part in the card editor.
An example deck with example notes can be found in data/Maobi.apkg
.
Before using maobi, it has to be specified for which decks and templates the add-on should be enabled. The field that contains the character to write also has to be given.
In order to tell maobi these values, you need to edit the add-on configuration. This can be done in the Card Layout view:
The configuration is done per deck and card template. The following paragraphs explains the values in detail.
- Field
- The name of the field that should be used to quiz.
- Grid
- This specifies the type of grid background that will be used. Currently available are `None`, `Rice` or `Field`:
- Size
- This specifies the size of the quiz box in px (default 200).
- Leniency
- This can be set to make stroke grading more or less lenient. The smaller this is, the more strictly the quiz is graded.
- Show hint after misses
- This specifies after how many wrong strokes a hint is displayed. 0 means never show hints (default 3).
This add-on right now just contains a basic implementation. It is by no means feature complete or well-tested. If you have feature requests or encounter bugs, please open an issue in the issue tracker.
You can import this repository as a poetry
package in the IDE of your choice. To test it with Anki,
I checkout this repository into my git
folder, then symlink the maobi
folder into ${AnkiData}\addons21
.
# Windows (as root)
New-Item -ItemType SymbolicLink -Path C:\Users\klie\AppData\Roaming\Anki2\addons21\maobi -Target D:\git\anki-maobi\maobi\
For a more detailed contribution guideline, see here.
- Bump the version number in
maobi\__version__.py
- Run
scripts\package.py
- Upload to
https://ankiweb.net/shared/upload
I did not design the writing component, it comes from the awesome Hanzi Writer JavaScript library. Without it, this would not be possible. maobi merely bundles it with Anki. Please visit the Hanzi Writer website and look how nice it looks!
Sadly, Anki desktop addons do not work on mobile. A workaround can be found here. It uses the hand-written input of the mobile keyboard. An alternative to try is using this by infinyte7.
Yes, it does. maobi is bundled with the character data from the Hanzi Writer Data repo. The Javascript from Hanzi Writer is also shipped with this addon.
In order to generate the quizzes and display characters, stroke information is needed. Although the character data for one Hanzi is relatively small, it adds up when you support over 9000 characters. I already compressed the data to reduce the footprint.
Yes. I personally use a Wacom graphics tablet, e.g. the Wacom Intuos.
Change log
- Adapt to PyQt 6
- Filter non-Chinese characters
- Adjust stroke color to night mode
- Fix for Anki 2.1.33
- Add restart button
- Fix for Anki 2.1.20
- Add optional reveal button
- Quizzes with multiple characters work
- Can configure after how many wrong strokes hints are displayed
- Added missing file to Anki package.
- Refactor plugin code
- Configuration is now per deck and template
- Add config dialog
- Display error messages on exception
- Refactor plugin code
- Add grid background option
- Change default configuration to use example deck parameters
- Change configuration to enable different fields for the same deck, e.g. to quiz simplified and traditional
- Make grid size configurable
- First release
maobi is released under an MIT license.
This add-on uses several third-party components.
Hanzi Writer is released under an MIT license.
The Hanzi Writer data comes from the Make Me A Hanzi project, which extracted the data from fonts by Arphic Technology, a Taiwanese font forge that released their work under a permissive license in 1999. You can redistribute and/or modify this data under the terms of the Arphic Public License as published by Arphic Technology Co., Ltd. A copy of this license can be found in ARPHICPL.TXT.