g2p_zh_en
=========
Introduction
------------
g2p_zh_en is an open-source project that provides a mixed Grapheme-to-Phoneme (G2P) conversion between Chinese and English based on Bigcidian's translation table. It aims to convert text between Chinese and English phonemes, allowing for pronunciation and speech-related applications.
Features
--------
* G2P conversion from Chinese to English
* G2P conversion from English to Chinese
* Handling of special characters, such as numbers and currencies
Installation
------------
.
=
Make sure your environment meets the following requirements:
* Python 3.x
* Other dependencies (listed in requirements.txt)
.
=
Install the required dependencies by running the following command:
pip install -r requirements.txt
. Install g2p_zh_en using pip:
==============================
pip install g2p_zh_en
Usage
-----
Import the G2P class from g2p_zh_en and create an instance:
.. code-block:: python
from g2p_zh_en.g2p_zh_en import G2P
g2p = G2P()
text = "我有100美元,i'm so rich."
output = g2p.g2p(text)
print(output)
['w', 'uɔ3', 'y', 'əu3', 'y', 'ii4', 'b', 'ai3', 'm', 'ei3', 'yu', 'an2', ',', ' ', 'ai', 'm', ' ', 's', 'əu', ' ', 'r', 'i', 'ch', ' ', '.']
text = "i have 100 dollar,我是不是很富有?"
output = g2p.g2p(text, language='en-us')
print(output)
['ai', ' ', 'h', 'æ', 'v', ' ', 'w', 'ʌ', 'n', ' ', 'h', 'ʌ', 'n', 'd', 'r', 'ə', 'd', ' ', 'd', 'a', 'l', 'ər', ' ', ',', ' ', 'w', 'uɔ3', 'sh', 'iii4', 'b', 'uu2', 'sh', 'iii4', 'h', 'ən3', 'f', 'uu4', 'y', 'əu3', ' ', '?']
Please note that the output represents the phonetic representation of the input text.
In Progress
-----------
The following features are currently being developed:
* [x] G2P conversion with Chinese as the primary language.
* [x] G2P conversion with English as the primary language.
* [ ] Handling various special characters, such as numbers and currencies.
Contribution
If you would like to contribute to this project, you can:
Submit bug reports or feature requests on the project's issue page.
Fork the project, create your own branch, and submit a pull request.
Improve documentation and code comments.
Thank you for your support and contributions!
License
-------
This project is licensed under the GNU General Public License.
=======
History
=======
0.1.0 (2023-07-14)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/skysbird/g2p-zh-en",
"name": "g2p_zh_en",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "g2p_zh_en",
"author": "gp-zh-en",
"author_email": "skysbird@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/83/3e/a28441b7ed78157527591d768d447078a94a3dff70fe09827b0cae4a187f/g2p_zh_en-0.1.1.tar.gz",
"platform": null,
"description": "\ng2p_zh_en\n=========\n\nIntroduction\n------------\n\ng2p_zh_en is an open-source project that provides a mixed Grapheme-to-Phoneme (G2P) conversion between Chinese and English based on Bigcidian's translation table. It aims to convert text between Chinese and English phonemes, allowing for pronunciation and speech-related applications.\n\nFeatures\n--------\n\n\n* G2P conversion from Chinese to English\n* G2P conversion from English to Chinese\n* Handling of special characters, such as numbers and currencies\n\nInstallation\n------------\n\n.\n=\n\n Make sure your environment meets the following requirements:\n\n\n* Python 3.x\n* Other dependencies (listed in requirements.txt)\n\n.\n=\n\n Install the required dependencies by running the following command:\n\npip install -r requirements.txt\n\n. Install g2p_zh_en using pip:\n==============================\n\npip install g2p_zh_en\n\nUsage\n-----\n\nImport the G2P class from g2p_zh_en and create an instance:\n\n.. code-block:: python\n\n from g2p_zh_en.g2p_zh_en import G2P\n\n g2p = G2P()\n text = \"\u6211\u6709100\u7f8e\u5143,i'm so rich.\"\n output = g2p.g2p(text)\n print(output)\n ['w', 'u\u02543', 'y', '\u0259u3', 'y', 'ii4', 'b', 'ai3', 'm', 'ei3', 'yu', 'an2', ',', ' ', 'ai', 'm', ' ', 's', '\u0259u', ' ', 'r', 'i', 'ch', ' ', '.']\n text = \"i have 100 dollar,\u6211\u662f\u4e0d\u662f\u5f88\u5bcc\u6709\uff1f\"\n output = g2p.g2p(text, language='en-us')\n print(output)\n ['ai', ' ', 'h', '\u00e6', 'v', ' ', 'w', '\u028c', 'n', ' ', 'h', '\u028c', 'n', 'd', 'r', '\u0259', 'd', ' ', 'd', 'a', 'l', '\u0259r', ' ', ',', ' ', 'w', 'u\u02543', 'sh', 'iii4', 'b', 'uu2', 'sh', 'iii4', 'h', '\u0259n3', 'f', 'uu4', 'y', '\u0259u3', ' ', '\uff1f']\n\nPlease note that the output represents the phonetic representation of the input text.\n\nIn Progress\n-----------\n\nThe following features are currently being developed:\n\n\n* [x] G2P conversion with Chinese as the primary language.\n* [x] G2P conversion with English as the primary language.\n* [ ] Handling various special characters, such as numbers and currencies.\n Contribution\n\nIf you would like to contribute to this project, you can:\n\nSubmit bug reports or feature requests on the project's issue page.\nFork the project, create your own branch, and submit a pull request.\nImprove documentation and code comments.\nThank you for your support and contributions!\n\nLicense\n-------\n\nThis project is licensed under the GNU General Public License.\n\n\n=======\nHistory\n=======\n\n0.1.0 (2023-07-14)\n------------------\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": "GNU General Public License v3",
"summary": "g2p-zh-en",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/skysbird/g2p-zh-en"
},
"split_keywords": [
"g2p_zh_en"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "833ea28441b7ed78157527591d768d447078a94a3dff70fe09827b0cae4a187f",
"md5": "21aac17b2125c468a936d409298cbad3",
"sha256": "b24b6f8b674c75db6bf9a1dfef9a7320a7e7adc62d096dc2ba3b4cce6e1ac18b"
},
"downloads": -1,
"filename": "g2p_zh_en-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "21aac17b2125c468a936d409298cbad3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3127005,
"upload_time": "2023-07-16T15:25:21",
"upload_time_iso_8601": "2023-07-16T15:25:21.814274Z",
"url": "https://files.pythonhosted.org/packages/83/3e/a28441b7ed78157527591d768d447078a94a3dff70fe09827b0cae4a187f/g2p_zh_en-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-16 15:25:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "skysbird",
"github_project": "g2p-zh-en",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "g2p_zh_en"
}