cantonese-romanisation


Namecantonese-romanisation JSON
Version 1.0.5 PyPI version JSON
download
home_page
SummaryLibrary for mapping Chinese character to Hong Kong Government Cantonese Romanisation, Pingyam (Yale or LSHK)
upload_time2023-09-13 03:01:49
maintainer
docs_urlNone
authorChun Law (chunalw)
requires_python
license
keywords pinyin cantonese pingyam hong kong government cantonese romanisation romanisation romanization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
Cantonese Romanisation
=========

It is a python version for the npm package [cantonese-romanisation](https://www.npmjs.com/package/cantonese-romanisation).

Cantonese romanization based on [Hong Kong Government Romanisation](https://zh.wikipedia.org/zh-hk/%E9%A6%99%E6%B8%AF%E6%94%BF%E5%BA%9C%E7%B2%B5%E8%AA%9E%E6%8B%BC%E9%9F%B3), which is widely adapted for assigning of names to HKID, streets and places. 

The pacakage also provides features of  [pinyin](https://zh.wikipedia.org/zh-tw/%E6%B1%89%E8%AF%AD%E6%8B%BC%E9%9F%B3) supporting the standards of [LSHK](https://lshk.org/) and [Yale](https://zh.wikipedia.org/wiki/%E8%80%B6%E9%AD%AF%E6%8B%BC%E9%9F%B3#%E7%B2%A4%E8%AF%AD%E8%80%B6%E9%B2%81%E6%8B%BC%E9%9F%B3).

Demo is available [here](https://cantonese-romanisation.chunlaw.io/).

## Install
```bash
pip install cantonese-romanisation
```

## Usage

__getRoman__
```python
from cantoroman import Cantonese

cantonese = Cantonese()
print( cantonese.getRoman("梁國雄") )
"""
[['leung'], ['gwok', 'kwok'], ['hung']]
"""

print( cantonese.getLshk("梁國雄") )
"""
[['loeng4'], ['gwok3'], ['hung4']]
[['leung4'], ['gwok3'], ['hung4']]
"""

print( cantonese.getYale("梁國雄") )
"""
[['loeng4'], ['gwok3'], ['hung4']]
[['leung4'], ['gwok3'], ['hung4']]
"""

print( cantonese.pingyam("leung kwok hung", 'roman') )
"""
[['俍', '倞', '啢', '啢', '喨', '悢', '惊', '椋', '湸', '綡', '緉', '緉', '蜋', '裲', '踉', '踉', '輬', '駺', '魎', '両', '亮', '倆', '兩', '梁', '樑', '涼', '粱', '糧', '良', '諒', '輛', '量', '娘'], ['嘓', '囗', '墎', '壙', '夼', '崞', '彉', '彉', '彏', '慖', '懭', '桄', '槨', '漍', '爌', '玃', '矌', '矍', '穬', '簂', '籗', '絖', '纊', '聝', '膕', '貜', '躩', '躩', '钁', '霩', '霩', '鞹', '馘', '廓', '國', '幗', '蟈', '郭', '擴', '漷'], ['仜', '倥', '倥', '倥', '哅', '嗊', '妅', '忷', '恟', '悾', '愩', '洚', '涳', '渱', '澒', '灴', '焢', '玒', '硿', '箜', '篊', '羾', '舼', '芎', '蕻', '蕻', '谼', '谾', '闀', '霟', '鞚', '魟', '齁', '烘', '兇', '凶', '匈', '哄', '孔', '崆', '恐', '控', '汞', '洪', '洶', '熊', '空', '紅', '胸', '葒', '虹', '訌', '雄', '鬨', '鴻', '黌', '吽']]
"""

print( cantonese.pingyam("loeng4 gwok3 hung4", 'lshk') )
"""
[['俍', '椋', '綡', '蜋', '踉', '輬', '駺', '梁', '樑', '涼', '粱', '糧', '良', '諒', '量', '莨'], ['嘓', '囗', '墎', '崞', '彉', '彏', '慖', '槨', '漍', '玃', '矍', '簂', '聝', '膕', '貜', '躩', '钁', '霩', '馘', '攫', '摑', '廓', '國', '幗', '蟈', '郭', '擴', '漷'], ['仜', '妅', '洚', '渱', '玒', '篊', '羾', '舼', '蕻', '谼', '霟', '魟', '烘', '洪', '熊', '紅', '葒', '虹', '訌', '雄', '鴻', '黌']]
"""

print( cantonese.pingyam("leung4 gwok3 hung4", 'yale') )
"""
[['俍', '椋', '綡', '蜋', '踉', '輬', '駺', '梁', '樑', '涼', '粱', '糧', '良', '諒', '量', '莨'], ['嘓', '囗', '墎', '崞', '彉', '彏', '慖', '槨', '漍', '玃', '矍', '簂', '聝', '膕', '貜', '躩', '钁', '霩', '馘', '攫', '摑', '廓', '國', '幗', '蟈', '郭', '擴', '漷'], ['仜', '妅', '洚', '渱', '玒', '篊', '羾', '舼', '蕻', '谼', '霟', '魟', '烘', '洪', '熊', '紅', '葒', '虹', '訌', '雄', '鴻', '黌']]
"""
```

## Dictionary

If you would like to update the dictionary, you may checkout the [dictionary](https://github.com/chunlaw/cantonese-romanisation/blob/main/dictionary/source.tsv).

## Contribute
Project owner [chunlaw](https://github.com/chunlaw) is the initiator of the whole project. Everyone is welcome to contribute.

## License

MIT license

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cantonese-romanisation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pinyin,cantonese,pingyam,hong kong government cantonese romanisation,romanisation,romanization",
    "author": "Chun Law (chunalw)",
    "author_email": "<chunlaw@rocketmail.com.com>",
    "download_url": "https://files.pythonhosted.org/packages/3a/73/8dfb0f34656612c308cbeecbc2d4712dc164395ca06533bb79b96069c021/cantonese-romanisation-1.0.5.tar.gz",
    "platform": null,
    "description": "\nCantonese Romanisation\n=========\n\nIt is a python version for the npm package [cantonese-romanisation](https://www.npmjs.com/package/cantonese-romanisation).\n\nCantonese romanization based on [Hong Kong Government Romanisation](https://zh.wikipedia.org/zh-hk/%E9%A6%99%E6%B8%AF%E6%94%BF%E5%BA%9C%E7%B2%B5%E8%AA%9E%E6%8B%BC%E9%9F%B3), which is widely adapted for assigning of names to HKID, streets and places. \n\nThe pacakage also provides features of  [pinyin](https://zh.wikipedia.org/zh-tw/%E6%B1%89%E8%AF%AD%E6%8B%BC%E9%9F%B3) supporting the standards of [LSHK](https://lshk.org/) and [Yale](https://zh.wikipedia.org/wiki/%E8%80%B6%E9%AD%AF%E6%8B%BC%E9%9F%B3#%E7%B2%A4%E8%AF%AD%E8%80%B6%E9%B2%81%E6%8B%BC%E9%9F%B3).\n\nDemo is available [here](https://cantonese-romanisation.chunlaw.io/).\n\n## Install\n```bash\npip install cantonese-romanisation\n```\n\n## Usage\n\n__getRoman__\n```python\nfrom cantoroman import Cantonese\n\ncantonese = Cantonese()\nprint( cantonese.getRoman(\"\u6881\u570b\u96c4\") )\n\"\"\"\n[['leung'], ['gwok', 'kwok'], ['hung']]\n\"\"\"\n\nprint( cantonese.getLshk(\"\u6881\u570b\u96c4\") )\n\"\"\"\n[['loeng4'], ['gwok3'], ['hung4']]\n[['leung4'], ['gwok3'], ['hung4']]\n\"\"\"\n\nprint( cantonese.getYale(\"\u6881\u570b\u96c4\") )\n\"\"\"\n[['loeng4'], ['gwok3'], ['hung4']]\n[['leung4'], ['gwok3'], ['hung4']]\n\"\"\"\n\nprint( cantonese.pingyam(\"leung kwok hung\", 'roman') )\n\"\"\"\n[['\u4fcd', '\u501e', '\u5562', '\u5562', '\u55a8', '\u60a2', '\u60ca', '\u690b', '\u6e78', '\u7da1', '\u7dc9', '\u7dc9', '\u870b', '\u88f2', '\u8e09', '\u8e09', '\u8f2c', '\u99fa', '\u9b4e', '\u4e21', '\u4eae', '\u5006', '\u5169', '\u6881', '\u6a11', '\u6dbc', '\u7cb1', '\u7ce7', '\u826f', '\u8ad2', '\u8f1b', '\u91cf', '\u5a18'], ['\u5613', '\u56d7', '\u588e', '\u58d9', '\u593c', '\u5d1e', '\u5f49', '\u5f49', '\u5f4f', '\u6156', '\u61ed', '\u6844', '\u69e8', '\u6f0d', '\u720c', '\u7383', '\u77cc', '\u77cd', '\u7a6c', '\u7c02', '\u7c57', '\u7d56', '\u7e8a', '\u805d', '\u8195', '\u8c9c', '\u8ea9', '\u8ea9', '\u9481', '\u9729', '\u9729', '\u97b9', '\u9998', '\u5ed3', '\u570b', '\u5e57', '\u87c8', '\u90ed', '\u64f4', '\u6f37'], ['\u4edc', '\u5025', '\u5025', '\u5025', '\u54c5', '\u55ca', '\u5985', '\u5ff7', '\u605f', '\u60be', '\u6129', '\u6d1a', '\u6db3', '\u6e31', '\u6f92', '\u7074', '\u7122', '\u7392', '\u787f', '\u7b9c', '\u7bca', '\u7fbe', '\u823c', '\u828e', '\u857b', '\u857b', '\u8c3c', '\u8c3e', '\u95c0', '\u971f', '\u979a', '\u9b5f', '\u9f41', '\u70d8', '\u5147', '\u51f6', '\u5308', '\u54c4', '\u5b54', '\u5d06', '\u6050', '\u63a7', '\u6c5e', '\u6d2a', '\u6d36', '\u718a', '\u7a7a', '\u7d05', '\u80f8', '\u8452', '\u8679', '\u8a0c', '\u96c4', '\u9b28', '\u9d3b', '\u9ecc', '\u543d']]\n\"\"\"\n\nprint( cantonese.pingyam(\"loeng4 gwok3 hung4\", 'lshk') )\n\"\"\"\n[['\u4fcd', '\u690b', '\u7da1', '\u870b', '\u8e09', '\u8f2c', '\u99fa', '\u6881', '\u6a11', '\u6dbc', '\u7cb1', '\u7ce7', '\u826f', '\u8ad2', '\u91cf', '\u83a8'], ['\u5613', '\u56d7', '\u588e', '\u5d1e', '\u5f49', '\u5f4f', '\u6156', '\u69e8', '\u6f0d', '\u7383', '\u77cd', '\u7c02', '\u805d', '\u8195', '\u8c9c', '\u8ea9', '\u9481', '\u9729', '\u9998', '\u652b', '\u6451', '\u5ed3', '\u570b', '\u5e57', '\u87c8', '\u90ed', '\u64f4', '\u6f37'], ['\u4edc', '\u5985', '\u6d1a', '\u6e31', '\u7392', '\u7bca', '\u7fbe', '\u823c', '\u857b', '\u8c3c', '\u971f', '\u9b5f', '\u70d8', '\u6d2a', '\u718a', '\u7d05', '\u8452', '\u8679', '\u8a0c', '\u96c4', '\u9d3b', '\u9ecc']]\n\"\"\"\n\nprint( cantonese.pingyam(\"leung4 gwok3 hung4\", 'yale') )\n\"\"\"\n[['\u4fcd', '\u690b', '\u7da1', '\u870b', '\u8e09', '\u8f2c', '\u99fa', '\u6881', '\u6a11', '\u6dbc', '\u7cb1', '\u7ce7', '\u826f', '\u8ad2', '\u91cf', '\u83a8'], ['\u5613', '\u56d7', '\u588e', '\u5d1e', '\u5f49', '\u5f4f', '\u6156', '\u69e8', '\u6f0d', '\u7383', '\u77cd', '\u7c02', '\u805d', '\u8195', '\u8c9c', '\u8ea9', '\u9481', '\u9729', '\u9998', '\u652b', '\u6451', '\u5ed3', '\u570b', '\u5e57', '\u87c8', '\u90ed', '\u64f4', '\u6f37'], ['\u4edc', '\u5985', '\u6d1a', '\u6e31', '\u7392', '\u7bca', '\u7fbe', '\u823c', '\u857b', '\u8c3c', '\u971f', '\u9b5f', '\u70d8', '\u6d2a', '\u718a', '\u7d05', '\u8452', '\u8679', '\u8a0c', '\u96c4', '\u9d3b', '\u9ecc']]\n\"\"\"\n```\n\n## Dictionary\n\nIf you would like to update the dictionary, you may checkout the [dictionary](https://github.com/chunlaw/cantonese-romanisation/blob/main/dictionary/source.tsv).\n\n## Contribute\nProject owner [chunlaw](https://github.com/chunlaw) is the initiator of the whole project. Everyone is welcome to contribute.\n\n## License\n\nMIT license\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Library for mapping Chinese character to Hong Kong Government Cantonese Romanisation, Pingyam (Yale or LSHK)",
    "version": "1.0.5",
    "project_urls": null,
    "split_keywords": [
        "pinyin",
        "cantonese",
        "pingyam",
        "hong kong government cantonese romanisation",
        "romanisation",
        "romanization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82630dc83af4ea740696759cbcb8085d544accfcbc6fb99586670d11bae6834b",
                "md5": "f09e40142c681671258ce69842d9b7f2",
                "sha256": "c2e56c85d66f0b942f57991af518940acf44137e04847c6f7608e4e25259e5c6"
            },
            "downloads": -1,
            "filename": "cantonese_romanisation-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f09e40142c681671258ce69842d9b7f2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 400894,
            "upload_time": "2023-09-13T03:01:48",
            "upload_time_iso_8601": "2023-09-13T03:01:48.081969Z",
            "url": "https://files.pythonhosted.org/packages/82/63/0dc83af4ea740696759cbcb8085d544accfcbc6fb99586670d11bae6834b/cantonese_romanisation-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a738dfb0f34656612c308cbeecbc2d4712dc164395ca06533bb79b96069c021",
                "md5": "d6de750b6fdecddc6c7b9e378e27316c",
                "sha256": "eb7435663ba454827bbe7c4f8629a3dd3b817073eccc800e4fa7be5a5d120f54"
            },
            "downloads": -1,
            "filename": "cantonese-romanisation-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "d6de750b6fdecddc6c7b9e378e27316c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 390794,
            "upload_time": "2023-09-13T03:01:49",
            "upload_time_iso_8601": "2023-09-13T03:01:49.983674Z",
            "url": "https://files.pythonhosted.org/packages/3a/73/8dfb0f34656612c308cbeecbc2d4712dc164395ca06533bb79b96069c021/cantonese-romanisation-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-13 03:01:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "cantonese-romanisation"
}
        
Elapsed time: 0.12424s