{ "info": { "author": "Luc Wastiaux", "author_email": "lucw@airpost.net", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.7", "Topic :: Text Processing :: Linguistic" ], "description": "python-pinyin-jyutping-sentence\n===============================\n\nPython module which converts a Chinese sentence from Simplified to Mandarin/Pinyin and Traditional to Cantonese/Jyutping, outputting diacritics (accented characters). I designed this library to create Mandarin and Cantonese flashcards.\n\nInstall\n-------\n\n.. code:: bash\n\n $ pip install pinyin_jyutping_sentence\n\nUsage\n-----\n\n.. code:: python\n\n >>> import pinyin_jyutping_sentence\n >>> pinyin_jyutping_sentence.pinyin(\"\u63d0\u9ad8\u53e3\u8bed\")\n 't\u00edg\u0101o k\u01d2uy\u01d4'\n >>> pinyin_jyutping_sentence.jyutping(\"\u6211\u51fa\u53bb\u651e\u91ce\u98df\")\n 'ng\u01d2 c\u0113oth\u00eaoi l\u00f3 j\u011bsik'\n # the tone_numbers argument can be used to disable diacritics\n >>> pinyin_jyutping_sentence.pinyin(\"\u5fd8\u62ff\u4e00\u4e9b\u4e1c\u897f\u4e86\", tone_numbers=True)\n 'wang4 na2 yi1xie1 dong1xi5 le5'\n # the spaces argument adds a space between each syllable\n >>> pinyin_jyutping_sentence.pinyin(\"\u5fd8\u62ff\u4e00\u4e9b\u4e1c\u897f\u4e86\", tone_numbers=True, spaces=True)\n 'wang4 na2 yi1 xie1 dong1 xi5 le5'\n >>> pinyin_jyutping_sentence.jyutping(\"\u6709\u5572\u597d\u8cb4\", tone_numbers=True)\n 'jau5 di1 hou3 gwai3'\n \nREST API\n--------\n\nYou can use the REST API at the following URL:\n\n.. code:: python\n\n http://api.mandarincantonese.com/jyutping/\u6211\u54cb\u76ea\u5931\u5497\n {\"jyutping\": \"ng\u01d2 d\u00e9i dongs\u0101t z\u00f3\"}\n http://api.mandarincantonese.com/pinyin/\u529e\u6240\u6709\u7684\u4e8b\u60c5\n {\"pinyin\": \"b\u00e0n su\u01d2y\u01d2u de sh\u00ecq\u00edng\"}\n\n # calling the API from python\n import requests\n import json\n\n url = \"http://api.mandarincantonese.com/jyutping/\u6211\u54cb\u76ea\u5931\u5497\"\n response = requests.get(url)\n print(json.loads(response.content)[\"jyutping\"]) \n >>> ng\u01d2 d\u00e9i dongs\u0101t z\u00f3\n\nGoogle Sheets add-on\n--------------------\n\nThis library is available in the form of a Google Sheets Add-on. You can read about it here: https://medium.com/@lucw/converting-chinese-characters-to-pinyin-or-jyutping-on-google-sheets-eb12cca669cb\n\nHow it works\n------------\n\nUses the Jieba library (https://github.com/fxsjy/jieba) to tokenize the sentence. Then words are converted to Pinyin/Jyutping either as a whole, or character by character, using the CC-Canto dictionary (http://cantonese.org/about.html). The Jyutping diacritic conversion is not standard but originally described here: http://www.cantonese.sheik.co.uk/phorum/read.php?1,127274,129006\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lucwastiaux/python-pinyin-jyutping-sentence", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "pinyin_jyutping_sentence", "package_url": "https://pypi.org/project/pinyin_jyutping_sentence/", "platform": "", "project_url": "https://pypi.org/project/pinyin_jyutping_sentence/", "project_urls": { "Homepage": "https://github.com/lucwastiaux/python-pinyin-jyutping-sentence" }, "release_url": "https://pypi.org/project/pinyin_jyutping_sentence/0.5/", "requires_dist": null, "requires_python": "", "summary": "Convert a Chinese sentence to Pinyin or Jyutping", "version": "0.5" }, "last_serial": 5812690, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "36cea2513b3e03c65c7dc9732e5ae770", "sha256": "8f61e61cd868374097a10b016eb783e605672ae5eb61092600d6a29a66ecfaed" }, "downloads": -1, "filename": "pinyin_jyutping_sentence-0.1.tar.gz", "has_sig": false, "md5_digest": "36cea2513b3e03c65c7dc9732e5ae770", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2728059, "upload_time": "2019-04-17T12:40:27", "url": "https://files.pythonhosted.org/packages/f8/2d/44e72c43c642af38a30e0b03291522127145bf0e39b7bb4522712065f335/pinyin_jyutping_sentence-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "634cb2ff9e6082cca682199b3672e1de", "sha256": "cb3a7a5c8635de96e8122bdc9900788c9e42f155ef452bf2a2b684a60a8f4434" }, "downloads": -1, "filename": "pinyin_jyutping_sentence-0.2.tar.gz", "has_sig": false, "md5_digest": "634cb2ff9e6082cca682199b3672e1de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5761975, "upload_time": "2019-04-19T06:26:24", "url": "https://files.pythonhosted.org/packages/69/66/97edf86de1cb3166d2c544432acbbc8cec283006502c7c0fc6459b6fd9cb/pinyin_jyutping_sentence-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "e9186e18f66d378817e01cef3d63bb8d", "sha256": "3baa3dfc89c479438f864760ac6b771278ada72ad6c7da2d4005edd9fe6a5e8b" }, "downloads": -1, "filename": "pinyin_jyutping_sentence-0.3.tar.gz", "has_sig": false, "md5_digest": "e9186e18f66d378817e01cef3d63bb8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5762099, "upload_time": "2019-04-19T06:29:41", "url": "https://files.pythonhosted.org/packages/fb/af/84f7eeb5a875d69994464d2545603c419a9127d95a347c64fe18eb9a713e/pinyin_jyutping_sentence-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "1caa604dae645ebd62bcecc8ddf5c036", "sha256": "869cf677526d7ecffe5b5150284d35efbe862a5a83d1c2a13771af6d1316856b" }, "downloads": -1, "filename": "pinyin_jyutping_sentence-0.4.tar.gz", "has_sig": false, "md5_digest": "1caa604dae645ebd62bcecc8ddf5c036", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5762867, "upload_time": "2019-09-09T13:08:13", "url": "https://files.pythonhosted.org/packages/1c/4b/57e3066b7ab3d395c557c8cc2af5bb0768a055d29a594121e883686ffdfd/pinyin_jyutping_sentence-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "7cac6c212b94f9d917cb9a9103a3c1d9", "sha256": "bb31aed02039b4009e919b5bc25637077909961628f1ad93da4e290c2564cf16" }, "downloads": -1, "filename": "pinyin_jyutping_sentence-0.5.tar.gz", "has_sig": false, "md5_digest": "7cac6c212b94f9d917cb9a9103a3c1d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5763100, "upload_time": "2019-09-11T04:34:33", "url": "https://files.pythonhosted.org/packages/69/55/fd99c07019fb47277f26cd6a566f9cd7b7b195ea4f9c7e6bfa22666ff8f5/pinyin_jyutping_sentence-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7cac6c212b94f9d917cb9a9103a3c1d9", "sha256": "bb31aed02039b4009e919b5bc25637077909961628f1ad93da4e290c2564cf16" }, "downloads": -1, "filename": "pinyin_jyutping_sentence-0.5.tar.gz", "has_sig": false, "md5_digest": "7cac6c212b94f9d917cb9a9103a3c1d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5763100, "upload_time": "2019-09-11T04:34:33", "url": "https://files.pythonhosted.org/packages/69/55/fd99c07019fb47277f26cd6a566f9cd7b7b195ea4f9c7e6bfa22666ff8f5/pinyin_jyutping_sentence-0.5.tar.gz" } ] }