使用 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']]
>>> pinyin('扔', heteronym=True)
[['rēng', 'rèng']]
# 使用 pinyin-data 项目中 kXHC1983.txt 文件中的拼音数据优化结果
>>> from pypinyin_dict.pinyin_data import kxhc1983
>>> kxhc1983.load()
>>> pinyin('扔', heteronym=True)
[['rēng']]
模块介绍
各个模块与数据文件关系如下(所有模块中都有一个 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/di.txt
>> from pypinyin_dict.phrase_pinyin_data import di
# 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.3.0.tar.gz
(9.2 MB
view details)
Built Distribution
File details
Details for the file pypinyin-dict-0.3.0.tar.gz
.
File metadata
- Download URL: pypinyin-dict-0.3.0.tar.gz
- Upload date:
- Size: 9.2 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 | e37ea1c5741fada2a7a763fc81c4b1418c30d7dbd628fc5ebe63d437ba4ffdc0 |
|
MD5 | cf2ae838e5c6bff37c6644664b3b84e2 |
|
BLAKE2b-256 | 2f454f4b1bb23c9afafdd5e75de21bdfd62ddb074461ce911d9b724059887b27 |
File details
Details for the file pypinyin_dict-0.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pypinyin_dict-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 9.5 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 | 95285e0cc5f8538301b374aa381ac01cc5de15e2a6f690e69a3fdf973c782481 |
|
MD5 | bef166e938d6f9d21a754a72e72802ba |
|
BLAKE2b-256 | 4dae067d2b3251a711eb2c47a9871215ee316022b51bc4ba6ef004c86661709e |