Interactive analyzing of a Chinese sentence and looking up words in the CC-CEDCIT dictionary. With Pinyin, Zhuyin and tone colors.
- Read sentence from clipboard or command-line argument
- Show Pinyin or Zhuyin with MDBG-style tone colours for readings
- Add words to Anki (using Anki Connect)
- Search/Open selected word in certain websites (See keybinds)
python3 -m pip install cedict_utils dragonmapper pyperclip
(All other libraries should already be included with the python standard library.)
Download and extract the CC-CEDICT dictionary file into the folder of this program. You can at any time re-download and replace the file to update the dictionary.
When starting the program for the first time, it will create a settings.py
file and prompt you to edit it.
If you want to use the Anki interface, make sure you have the Anki Connect addon installed in Anki and set the settings in settings.py
according to your setup (deck, note type, field names). The default values are just what I use, so they won't work out of the box.
python3 cedict-curses.py [SENTENCE]
SENTENCE - The initial sentence to load. Can be omitted.
Inside the program you can use the following keys:
Key | Alt. Key | Function |
---|---|---|
q | ESCAPE | Quit the program |
SPACE | Load sentence from clipboard | |
RIGHT | l | Move right in the sentence |
LEFT | h | Move left in the sentence |
DOWN | j | Select the next result |
UP | k | Select the previous result |
r | Toggle between Pinyin and Zhuyin | |
a | ENTER | Add selected result to / show in Anki |
l | F1 | Search selected result on LINE Dict |
f | F2 | Search selected result on Forvo (Simplified) |
Shift + f | SHIFT + F2 | Search selected result on Forvo (Traditional) |
g | F3 | Search selected result on the Chinese Grammar Wiki |
i | F4 | Search selected result on iCIBA |
m | F5 | Search selected result on MDBG |
t | F6 | Search selected result on Moedict (萌典) |
- The F1,F2,... keys are roughly based on the Alt+1,Alt+2,... keybinds of the Zhongwen Browser Addon, so I don't confuse myself too much.
- Forvo differentiates between simplified and traditional versions of words, hence the two keybinds. Though note that you'll get a mix of Mainland and Taiwan (and other) pronounciations in either case...
- Maybe a cleaner way to handle "too many results" (scrolling?)
- Google Cloud TTS intergration?