Code Monkey home page Code Monkey logo

kafkasl / chinese-character-generator Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 5.81 MB

Generate dynamic Chinese character learning wallpapers with stroke order, Pinyin & Zhuyin (Bopomofo) annotations, and english definition. Perfect for language learners looking to immerse themselves in Chinese script.

License: MIT License

Python 100.00%
bopomofo chinese-characters chinese-learning pinyin spaced-repetition-flashcards stroke-order wallpapers zhuyin

chinese-character-generator's Introduction

Chinese Character Image Generator

This is a Python script for generating images of Chinese characters, along with their pronunciation (in Pinyin and Zhuyin), stroke order, and definition.

Why?

Learning Chinese characters is an exciting journey and I wanted to make it a part of my everyday life. So, I came up with this project to transform my macOS desktop background into a dynamic learning tool. Now every day I have a new character, its stroke order, and meaning.

Each image features a Chinese character alongside its stroke order, depicted in shades of red, visually guiding you through the correct order and direction of each stroke. This is crucial for learning how to write Chinese characters correctly and can help improve your understanding and memory of each character's structure.

You can choose to generate images for characters from specific HSK levels, allowing you to start with simpler characters and gradually add more complex ones as your confidence grows. For example, you might start with only HSK level 1 characters, then progressively incorporate higher-level characters as your proficiency improves.

Prerequisites

You'll need to have Python 3 and Go installed on your machine.

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/chinese-character-generator.git
    cd chinese-character-generator
  2. Install the required Python packages:

    pip install -r requirements.txt
  3. Install go-zhuyin:

    go get github.com/shmokmt/go-zhuyin

Usage

You can run the script with the following command:

python main.py

You can specify several command-line arguments:

  • --output-zhuyin: Include Zhuyin in the output image (default: True).
  • --character-type: The type of Chinese characters to use (choices: traditional, simplified; default: traditional).
  • --output-dir: Directory to save the output images (default: ./images).
  • --font: Path to the font file to use (default: NotoSansTC-Regular.otf).
  • --input-file: CSV file to read the Hanzi data from (default: hanziDB.csv).
  • --hsk-level: HSK level for which characters should be generated (default: all levels).

Acknowledgments

This project makes use of the following resources:

  • Stroke order images are sourced from Wikimedia Commons.
  • Hanzi data is sourced from hanziDB.
  • Zhuyin conversion is performed using go-zhuyin.

Fonts

  • The Noto fonts used in this project are from Google's Noto Fonts project, and are licensed under the SIL Open Font License.

Contributing

We welcome contributions! Please feel free to submit a Pull Request or open an Issue.

License

This project is licensed under MIT License - see the LICENSE file for details.

chinese-character-generator's People

Contributors

kafkasl avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.