Giter VIP home page Giter VIP logo

cedict-json's Introduction

cedict-json

cedict-json individual json data of dictionary term according to simplified terms.

Quick Start

  1. Fork this repository
  2. Get meaning using cdn for v2 data
https://cdn.jsdelivr.net/gh/<your-username>/cedict-json/v2/我.json

Note: <your-username> is your GitHub username

  1. The v2 data
{
    "simplified": "",
    "traditional": "",
    "pinyin": [
        "wo3"
    ],
    "definitions": {
        "wo3": "I; me; my; "
    }
}
  1. Multiple meanings are separated by semi-color ;. For e.g. three meaning for
    "definitions": {
        "wo3": "I; me; my; "
    }

Version 2

Generated using toJson.py script

Difference between Version 1 (v1) and Version 2 (v2) data

Some words (approx. 3000) have same character and different pinyin and meaning. So using toJson.py words merged. For e.g. have more than one pinyin and meaning. But in version 1 there is one pinyin. So use v2 for getting meaning data. Also the multiple meanings are separated by semi-colon ; for respective pinyin.

{
    "simplified": "",
    "traditional": "",
    "pinyin": [
        "de5",
        "di1",
        "di2",
        "di4"
    ],
    "definitions": {
        "de5": "of; ~'s (possessive particle); (used after an attribute); (used to form a nominal expression); (used at the end of a declarative sentence for emphasis); ",
        "di1": "see 的士[di1 shi4]; ",
        "di2": "really and truly; ",
        "di4": "aim; clear; "
    }
}

Version 1

Generated using following script:

with open('cedict.json', encoding='utf8') as json_file:
    data = json.load(json_file)
    for x in range(0, 114852):
        print(data[x]['simplified'])
        name = data[x]['simplified']
        name += '.json'
        
        with open(name, "w", encoding='utf8') as f:
            json.dump(data[x],f,indent=4,sort_keys=True, ensure_ascii=False)

cedict.json file generated using following:

https://github.com/kevb34ns/CEDICT2JSON

To get meaning of any term from cedict-json data

Example 1

https://cdn.jsdelivr.net/gh/<your-username>/cedict-json/data/我.json

Fork this and then,
your-username is your github username

Fetched data

{
    "definitions": [
        "I",
        "my"
    ],
    "pinyin": "wo3",
    "simplified": "",
    "traditional": ""
}

Example 2

https://cdn.jsdelivr.net/gh/infinyte7/cedict-json/data/知道.json

Fetched data

{
    "definitions": [
        "to know",
        "also pr. [zhi1 dao5]"
    ],
    "pinyin": "zhi1 dao4",
    "simplified": "知道",
    "traditional": "知道"
}

Apps and Websites using cedict-json

Simple 中文 Vocabulary Generator

License

cedict chinese dictionary

Creative Commons Attribution-Share Alike 4.0 License
https://cc-cedict.org/wiki/

cedict-json

Mani (Infinyte7)
Creative Commons Attribution-Share Alike 4.0 License

Python packages used

hanziconv
googletrans
colorize_pinyin

cedict-json's People

Contributors

krmanik 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.