文字/漢語發音/注音互轉。相似發聲字/單詞。
Project description
Python Chinese Pronounce
- 文字轉注音、漢語發音
- 注音、漢語發音轉文字
- 尋找相似、相同發聲字/單詞
Install
From PyPI
pip install py-chinese-pronounce
From Repo
pip install -U git+https://github.com/p208p2002/py-chinese-pronounce.git
Usage
from py_chinese_pronounce import Word2pronounce,Pronounce2Word
w2p = Word2pronounce()
p2w = Pronounce2Word()
Word2pronounce
僅支援單一文字轉換
文字轉注音
w2p.to_chewin("我") # ㄨㄛˇ
文字轉漢語發音
w2p.to_han("我") # wo3
其他轉換
- Word2pronounce._word2unicode(self, x)
- Word2pronounce._uni2word(self,uni)
- Word2pronounce._cns2word(self,cns)
- Word2pronounce._uni2cns(self, uni)
CNS: 中文標準交換碼
Pronounce2Word
僅支援單一文字查詢
注音找文字
p2w.chewin2word('ㄨㄛˇ')
# ['䰀', '婑', '捰', '㦱', '我', '䂺']
漢語發音找文字
p2w.han2word('wo3')
# ['䰀', '婑', '捰', '㦱', '我', '䂺']
文字找同發音
p2w.find_same("我")
# ['䰀', '婑', '捰', '㦱', '䂺']
文字找近似發音
p2w.find_similar("我")
# ['蠖', '臥', '䇶', '䂺', '䪝', '捾', '偓', '握', '捰', '卧', '雘', '㦱', '濣', '䠎', '楃', '沃', '渥', '䁊', '涴', '幄', '龌', '㓇', '矱', '斡', '㠛', '肟', '齷', '仴', '䰀', '婑', '喔', '腛', '䀑']
相似發聲單詞
p2w.find_similar_vocab("汽車")
# ['七尺', '棋車', '棋车', '气车', '氣車', '汽车', '騎車', '骑车']
相同發聲單詞
p2w.find_same_vocab("汽車")
# ['气车', '氣車', '汽车']
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 Distribution
Built Distribution
Close
Hashes for py-chinese-pronounce-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd6c55ee8c9fda5da5e348e5f0ccc1b2cfc049ebcdb5c587b3a3f173daa118f4 |
|
MD5 | 1f081bc7001d159a09be97c223e44d62 |
|
BLAKE2b-256 | 0dedaf30c772835e6f53de029f26c63ae350270b7ec2a71ece976cfee0de5d69 |
Close
Hashes for py_chinese_pronounce-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d72fd4bcb608a9504028f5d4dcc36c0a64dbe58c97072b0688881a887039e285 |
|
MD5 | 6be735acb5828390b67e8c0d522edf38 |
|
BLAKE2b-256 | ff9cfc7b83fce7396e1f78e7064df5beb65687f53fe9e36b7cba42c44e60b383 |