G2P mix
Project description
g2p-mix
- Cantonese: pycantonese
- English: g2p_en
- Mandarin: pypinyin or g2pW
Usage
$ pip install g2p-mix
$ python
Mandarin
>>> from g2p_mix import G2pMix
>>> G2pMix().g2p("你这个idea, 不太make sense。", sandhi=True, return_seg=True)
[
Token(word='你', lang='ZH', pos='r', phones=[['n', 'i3']]),
Token(word='这个', lang='ZH', pos='r', phones=[['zh', 'e4'], ['g', 'e5']]),
Token(word='idea', lang='EN', pos=None, phones=['AY0', 'D', 'IY1', 'AH0']),
Token(word=',', lang='SYM', pos='x', phones=[',']),
Token(word='不太', lang='ZH', pos='d', phones=[['b', 'u2'], ['t', 'ai4']]),
Token(word='make', lang='EN', pos=None, phones=['M', 'EY1', 'K']),
Token(word='sense', lang='EN', pos=None, phones=['S', 'EH1', 'N', 'S']),
Token(word='。', lang='SYM', pos='x', phones=['。']),
]
Cantonese
>>> G2pMix(jyut=True).g2p("你这个idea, 不太make sense。", return_seg=True)
[
Token(word='你', lang='ZH', pos='PRON', phones=[['n', 'ei5']])
Token(word='這個', lang='ZH', pos='PRON', phones=[['z', 'e3'], ['g', 'o3']])
Token(word='idea', lang='EN', pos=None, phones=['AY0', 'D', 'IY1', 'AH0'])
Token(word=',', lang='SYM', pos='x', phones=[','])
Token(word='不', lang='ZH', pos='ADV', phones=[['b', 'at1']])
Token(word='太', lang='ZH', pos='ADV', phones=[['t', 'aai3']])
Token(word='make', lang='EN', pos=None, phones=['M', 'EY1', 'K'])
Token(word='sense', lang='EN', pos=None, phones=['S', 'EH1', 'N', 'S'])
Token(word='。', lang='SYM', pos='x', phones=['。'])
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file g2p_mix-0.6.5-py3-none-any.whl.
File metadata
- Download URL: g2p_mix-0.6.5-py3-none-any.whl
- Upload date:
- Size: 5.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6f63df927410afbecb71da80db44ebef225b3217df180e9d0de4ddd945c9f1b
|
|
| MD5 |
e0607f867ea1ae4cb8a31cad19006437
|
|
| BLAKE2b-256 |
4295eece6ce36eb9ae9d8522e4b9c083178fde86ae7631d5a5edbf072a6148e2
|