使用 pinyin-data 和 phrase-pinyin-data 中的拼音数据文件覆盖 pypinyin 中的自带拼音数据,实现只使用某个或某些拼音数据文件中的拼音数据的需求
Project description
pypinyin-dict
使用 pinyin-data 和 phrase-pinyin-data 中的拼音数据文件覆盖 pypinyin 中的自带拼音数据, 实现只使用某个或某些拼音数据文件中的拼音数据的需求。
安装
$ pip install pypinyin-dict
使用示例
>>> from pypinyin import pinyin
>>> pinyin('枯萎')
[['kū'], ['wēi']]
# 使用 phrase-pinyin-data 项目中 cc_cedict.txt 文件中的拼音数据优化结果
>>> from pypinyin_dict.phrase_pinyin_data import cc_cedict
>>> cc_cedict.load()
>>> pinyin('枯萎')
[['kū'], ['wěi']]
模块介绍
各个模块与数据文件关系如下(所有模块中都有一个 load()
函数用于导入对应的拼音数据,使用方法详见上方【使用示例】):
# pinyin-data/kTGHZ2013.txt:
>> from pypinyin_dict.pinyin_data import ktghz2013
# pinyin-data/kHanyuPinyin.txt
>> from pypinyin_dict.pinyin_data import khanyupinyin
# pinyin-data/kXHC1983.txt
>> from pypinyin_dict.pinyin_data import kxhc1983
# pinyin-data/kHanyuPinlu.txt
>> from pypinyin_dict.pinyin_data import khanyupinlu
# pinyin-data/kMandarin_8105.txt
>> from pypinyin_dict.pinyin_data import kmandarin_8105
# pinyin-data/pinyin.txt
>> from pypinyin_dict.pinyin_data import pinyin
# pinyin-data/zdic.txt
>> from pypinyin_dict.pinyin_data import zdic
# pinyin-data/cc_cedict.txt
>> from pypinyin_dict.pinyin_data import cc_cedict
# phrase-pinyin-data/pinyin.txt
>> from pypinyin_dict.phrase_pinyin_data import pinyin
# phrase-pinyin-data/zdic_cibs.txt
>> from pypinyin_dict.phrase_pinyin_data import zdic_cibs
# phrase-pinyin-data/zdic_cybs.txt
>> from pypinyin_dict.phrase_pinyin_data import zdic_cybs
# phrase-pinyin-data/cc_cedict.txt
>> from pypinyin_dict.phrase_pinyin_data import cc_cedict
# phrase-pinyin-data/large_pinyin.txt
>> from pypinyin_dict.phrase_pinyin_data import large_pinyin
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pypinyin-dict-0.1.0.tar.gz
(9.0 MB
view details)
Built Distribution
File details
Details for the file pypinyin-dict-0.1.0.tar.gz
.
File metadata
- Download URL: pypinyin-dict-0.1.0.tar.gz
- Upload date:
- Size: 9.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a471586aaa9406d4d804424dba5d24fedab967f953acb9a1dec98f42e097964 |
|
MD5 | 8bd1dcabf57ef7f00a78e20c3c81b4d1 |
|
BLAKE2b-256 | 92f1d2fe37c0185f0813bf991f831046afa2131751b48d7e06bbac02066b9603 |
File details
Details for the file pypinyin_dict-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pypinyin_dict-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 9.3 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e27515f7414f726eb7a2f0034872b25ea34f60ffbf468fafa40332dd93f31c1 |
|
MD5 | 0950bbb1363081326f1f032324eac770 |
|
BLAKE2b-256 | 90a0533a0f98de590c5a0409bd8fde5d14b1c58f348c6ffdd1a2630acc8bc542 |