{ "info": { "author": "Ratijas", "author_email": "ratijas.t@me.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Plugins", "Intended Audience :: Developers", "License :: Public Domain", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Topic :: Education", "Topic :: Text Processing", "Topic :: Text Processing :: Linguistic" ], "description": "search for chinese pinyin and wrap it with HTML.\n\ncolorize pinyin\n===============\n\nsearch for chinese pinyin and wrap it with HTML.\n\nmodule provides some useful functions for working with Chinese pinyin,\n\"phonetic system for transcribing the Mandarin pronunciations of\nChinese characters into the Latin alphabet\" (c) `wikipedia `_\n.\n\nusage sample\n============\n\n >>> colorized_HTML_string_from_string('n\u01d0 h\u01ceo')\n 'n\u01d0 h\u01ceo'\n\n >>> ranges_of_pinyin_in_string('n\u01d0 h\u01ceo')\n [Range(location=0, length=2), Range(location=3, length=3)] # == [(0, 2), (3, 3)]\n\nrequirements\n============\n\n``lxml`` is only required if you want to work with DOM. but it does not listed in requirements because if you want to use them, surely you already have ``lxml`` on the board; for other cases we don't need additional third-party libs.\n\nfunctions that designed to work with ``lxml`` marked with ``[*]``.\n\nfunctions\n=========\n\nmodify given DOM by replacing children text nodes containing pinyin with\nwrapper element:\n\n``colorize_DOM`` ``[*]``\n\nundo colorize:\n\n``uncolorize_DOM`` ``[*]``\n\ndetect and wrap pinyin with HTML in plain text string:\n\n``colorized_HTML_string_from_string``\n\ndo the same, but returns a wrapper -- DOM element:\n\n``colorized_HTML_element_from_string`` ``[*]``\n\nsearching for pinyin in string of text:\n\n``ranges_of_pinyin_in_string``\n\nfinding out what tone has some pinyin word:\n\n``determine_tone``\n\nremove tones (diacritics) from pinyin string:\n\n``lowercase_string_by_removing_pinyin_tones``\n\nconstants\n=========\n\n``PINYIN_LIST`` -- specially sorted list of all possible pinyin words.\n\n``PINYIN_LIST_BY_LEN`` -- same as ``PINYIN_LIST`` but grouped by len descending.\n\n``PINYIN_WRAPPER_CLASS`` -- default class used by ``[un]colorize_DOM``.\n\nclasses\n=======\n\n``Range`` -- 2-named-tuple with ``[0]`` location and ``[1]`` length.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ratijas/colorize_pinyin", "keywords": "find search chinese pinyin tones colorize", "license": "WTFPL", "maintainer": "", "maintainer_email": "", "name": "colorize-pinyin", "package_url": "https://pypi.org/project/colorize-pinyin/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/colorize-pinyin/", "project_urls": { "Homepage": "https://github.com/ratijas/colorize_pinyin" }, "release_url": "https://pypi.org/project/colorize-pinyin/2.1.1/", "requires_dist": null, "requires_python": "", "summary": "search for chinese pinyin and wrap it with HTML.", "version": "2.1.1" }, "last_serial": 1919891, "releases": { "2.1.1": [ { "comment_text": "", "digests": { "md5": "c64d0d4053438058692fd3572152143c", "sha256": "ac78d75f9b17e9ac1674f0dca6472fd063f1de865cebc0ac5f46fcc7638d3f32" }, "downloads": -1, "filename": "colorize_pinyin-2.1.1.macosx-10.8-x86_64.tar.gz", "has_sig": false, "md5_digest": "c64d0d4053438058692fd3572152143c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11477, "upload_time": "2016-01-24T05:39:33", "url": "https://files.pythonhosted.org/packages/8c/cf/1b359e73db3ba5f4034f7237c3c6679e7c11c5611c2536628cbf2ea66693/colorize_pinyin-2.1.1.macosx-10.8-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "c3e5d238ec21e483880e17cb125cfd66", "sha256": "c617e0483c5f2924637d5f565f54eb6431308543b511a26dd33308b870f606b1" }, "downloads": -1, "filename": "colorize_pinyin-2.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "c3e5d238ec21e483880e17cb125cfd66", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11223, "upload_time": "2016-01-24T05:39:18", "url": "https://files.pythonhosted.org/packages/c0/1a/3bb27caeefd021d1b03c714a25f2443c5892df9eec875b3a52330934c1b2/colorize_pinyin-2.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "089112991b0eb97eccf3cb43307a4122", "sha256": "927fc1e18e9ae072d03e9573e25765a7f79feda00b1c5b2b03c4adf7f76a4293" }, "downloads": -1, "filename": "colorize_pinyin-2.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "089112991b0eb97eccf3cb43307a4122", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11217, "upload_time": "2016-01-24T05:39:27", "url": "https://files.pythonhosted.org/packages/76/3e/9874fd764e982fec90d40dbf06cebdf449d62cc53fbdd6987f374a850066/colorize_pinyin-2.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bf3ced9b1a689ec05fa6018b59a1f6c4", "sha256": "d2aa9adae50ea9a2d59042710ee830b5020a17c05ae5c455786c30e284be8fb9" }, "downloads": -1, "filename": "colorize_pinyin-2.1.1.tar.gz", "has_sig": false, "md5_digest": "bf3ced9b1a689ec05fa6018b59a1f6c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7948, "upload_time": "2016-01-24T05:39:42", "url": "https://files.pythonhosted.org/packages/75/79/c0661c7a41bc7ffe7d1c3583a1e2b3e4887b127fe1e056d5e9e4a3ccabb4/colorize_pinyin-2.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c64d0d4053438058692fd3572152143c", "sha256": "ac78d75f9b17e9ac1674f0dca6472fd063f1de865cebc0ac5f46fcc7638d3f32" }, "downloads": -1, "filename": "colorize_pinyin-2.1.1.macosx-10.8-x86_64.tar.gz", "has_sig": false, "md5_digest": "c64d0d4053438058692fd3572152143c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11477, "upload_time": "2016-01-24T05:39:33", "url": "https://files.pythonhosted.org/packages/8c/cf/1b359e73db3ba5f4034f7237c3c6679e7c11c5611c2536628cbf2ea66693/colorize_pinyin-2.1.1.macosx-10.8-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "c3e5d238ec21e483880e17cb125cfd66", "sha256": "c617e0483c5f2924637d5f565f54eb6431308543b511a26dd33308b870f606b1" }, "downloads": -1, "filename": "colorize_pinyin-2.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "c3e5d238ec21e483880e17cb125cfd66", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11223, "upload_time": "2016-01-24T05:39:18", "url": "https://files.pythonhosted.org/packages/c0/1a/3bb27caeefd021d1b03c714a25f2443c5892df9eec875b3a52330934c1b2/colorize_pinyin-2.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "089112991b0eb97eccf3cb43307a4122", "sha256": "927fc1e18e9ae072d03e9573e25765a7f79feda00b1c5b2b03c4adf7f76a4293" }, "downloads": -1, "filename": "colorize_pinyin-2.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "089112991b0eb97eccf3cb43307a4122", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11217, "upload_time": "2016-01-24T05:39:27", "url": "https://files.pythonhosted.org/packages/76/3e/9874fd764e982fec90d40dbf06cebdf449d62cc53fbdd6987f374a850066/colorize_pinyin-2.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bf3ced9b1a689ec05fa6018b59a1f6c4", "sha256": "d2aa9adae50ea9a2d59042710ee830b5020a17c05ae5c455786c30e284be8fb9" }, "downloads": -1, "filename": "colorize_pinyin-2.1.1.tar.gz", "has_sig": false, "md5_digest": "bf3ced9b1a689ec05fa6018b59a1f6c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7948, "upload_time": "2016-01-24T05:39:42", "url": "https://files.pythonhosted.org/packages/75/79/c0661c7a41bc7ffe7d1c3583a1e2b3e4887b127fe1e056d5e9e4a3ccabb4/colorize_pinyin-2.1.1.tar.gz" } ] }