krmanik / Anki-Chinese-Vocabulary-Generator

Enter only simplified characters and create word meaning with Traditional, Pinyin, Meaning, Audio and example sentences
Other
30 stars 6 forks source link
anki ankidroid chinese-language gtts mandarin vocabulary-builder vocabulary-lists

Anki-Chinese-Vocabulary-Generator

Enter only simplified characters and create word meaning with Traditional, Pinyin, Meaning, Audio and example sentences offline.

Demo

demo

Features

Quick start (Windows)

  1. Install Python
    https://www.python.org
  2. Download this repository
    https://github.com/infinyte7/Anki-Chinese-Vocabulary-Generator/archive/master.zip
  3. Install git
    https://git-scm.com/
  4. Install required library in requirements.txt To install
    pip install -r requirements.txt

    requirements.txt file contains following

    jieba
    gTTS
    pinyin
    pycedict
    hanziconv
    googletrans
    git+https://github.com/DeepHorizons/tts

    Install latest version googletrans==4.0.0rc1.

  1. Run main.py and start adding words

To run on linux

Download this repository and then follow the steps:

  1. Install python3
    https://www.python.org
  2. Download this repository
    https://github.com/infinyte7/Anki-Chinese-Vocabulary-Generator/archive/master.zip
  3. Install pip3
    python3-pip
  4. Install following dependencies
    jieba
    gTTS
    pinyin
    pycedict
    hanziconv
    googletrans==4.0.0rc1

    Command to install

    python3 -m pip install -r requirements_linux.txt
  5. Run main_for_linux.py
    python3 main_for_linux.py

To run on mac

Download this repository and then follow the steps:

  1. Install python3
    https://www.python.org

  2. Download this repository
    https://github.com/infinyte7/Anki-Chinese-Vocabulary-Generator/archive/master.zip

  3. Install following dependencies

    jieba
    gTTS
    pinyin
    pycedict
    hanziconv
    googletrans==4.0.0rc1

    Command to install

    pip3 install -r requirements_mac.txt
  4. Run main_for_mac.py

    python3 main_for_mac.py

Demo

To run on Android using Pydroid 3

  1. Install Pydroid 3 from play store
  2. Download this repository
    https://github.com/infinyte7/Anki-Chinese-Vocabulary-Generator/archive/master.zip
  3. Install following using Pip inside Pydroid 3. It requires Pydroid repository plugin also.
    jieba
    gTTS
    pinyin
    pycedict
    hanziconv
    googletrans==4.0.0rc1
  4. Download this keyboard 搜狗输入法 sōugǒu shūrù fǎ sogou Input from play store
    Note: Other keyboard will not help in typing chinese characters
  5. Open the main_for_android.py inside Pydroid 3
  6. Run the script and start adding words

Image

Demo

Note

Languages & voices for DeepHorizons/tts may be needed to install for windows.

Data

Dictionary

The json_data folder contains dictionary data of CC-CEDICT converted to individual .json file using cedict-json.
CC-CEDICT

Sentences

The data.db contains sentences downloaded from https://tatoeba.org/eng/downloads. For accessing sentences matching the words offline.

Audio

The audio_data folder contains audio taken from https://github.com/hugolpz/audio-cmn.
Those audio taken from http://shtooka.net/download.php

Import in Anki

Use Anki Desktop to import it for Anki-xiehanzi

  1. Copy audio from xiehanzi folder to collection.media folder in Anki
  2. Create a new deck
  3. Import generated xiehanzi.txt file
  4. Select Fields separated by: Tabs
  5. Map the fields to respective fields
  6. Then import

Demo

Changelog

Changelog.md

Contribute

Code optimization will be appreciated.

Todo

License

Read License.md