漢字處理工具。當前支持簡化字轉漢字。
Project description
漢字
漢字處理工具。當前支持簡化字轉漢字。
安裝
pip install pyhan
示例
from pyhan import to_traditional
if __name__ == '__main__':
res = to_traditional('萝卜去哪了,可以在茶几卜上几卦')
# output: 蘿蔔去哪了,可以在茶几卜上幾卦
print(res)
完善
如果你需要增加规则,可以编辑 st2.csv 文件, 例如:
卜,蔔,-1|0|萝
卜,卜
會匹配第三列及以後,這裡是-1|0|萝,-1代表索引開始,0代表索引結束,萝代表匹配的目標詞,如果匹配成功,返回第二列
如果沒有第三列,返回第二列
測試
make test
貢獻
你可以按照以下步驟貢獻代碼:
- Fork 本倉庫。
- 提交 pull request。
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
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 pyhan-0.0.14.tar.gz.
File metadata
- Download URL: pyhan-0.0.14.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44a8dee4c99cab1537f83efd70c0fb6274c68e362b09f56f637ab5b07296a61c
|
|
| MD5 |
bface603ebcc029dafd482f4155cbb30
|
|
| BLAKE2b-256 |
12f96e6485162fefee16089b4222b24fac7d45dc6ef0b580dc4acac10ab73bd2
|
Provenance
The following attestation bundles were made for pyhan-0.0.14.tar.gz:
Publisher:
release.yml on lizongying/pyhan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhan-0.0.14.tar.gz -
Subject digest:
44a8dee4c99cab1537f83efd70c0fb6274c68e362b09f56f637ab5b07296a61c - Sigstore transparency entry: 171014949
- Sigstore integration time:
-
Permalink:
lizongying/pyhan@1a23d40066c23ec1cc08d27f74cab104fd548bb8 -
Branch / Tag:
refs/tags/v0.0.14 - Owner: https://github.com/lizongying
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1a23d40066c23ec1cc08d27f74cab104fd548bb8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhan-0.0.14-py3-none-any.whl.
File metadata
- Download URL: pyhan-0.0.14-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30636c13c5bb09f51943ed9b5926349c8ce3a9ab76f5d5a83cc85a46e2089994
|
|
| MD5 |
a23192aa17a3c92a7a109bb8f01b3b27
|
|
| BLAKE2b-256 |
3ba549d7867d3469f853f32191ccd79e8046d25c8a56696dbe0c747fc17ae300
|
Provenance
The following attestation bundles were made for pyhan-0.0.14-py3-none-any.whl:
Publisher:
release.yml on lizongying/pyhan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhan-0.0.14-py3-none-any.whl -
Subject digest:
30636c13c5bb09f51943ed9b5926349c8ce3a9ab76f5d5a83cc85a46e2089994 - Sigstore transparency entry: 171014953
- Sigstore integration time:
-
Permalink:
lizongying/pyhan@1a23d40066c23ec1cc08d27f74cab104fd548bb8 -
Branch / Tag:
refs/tags/v0.0.14 - Owner: https://github.com/lizongying
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1a23d40066c23ec1cc08d27f74cab104fd548bb8 -
Trigger Event:
push
-
Statement type: