Skip to main content

漢字處理工具。當前支持簡化字轉漢字。

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

貢獻

你可以按照以下步驟貢獻代碼:

  1. Fork 本倉庫。
  2. 提交 pull request。

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

pyhan-0.0.13.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyhan-0.0.13-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pyhan-0.0.13.tar.gz.

File metadata

  • Download URL: pyhan-0.0.13.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyhan-0.0.13.tar.gz
Algorithm Hash digest
SHA256 56fa0faa955e5b31e27d66088f02cc053bafe2e48389ba06f7db91197dab3643
MD5 e7b66a98f0ad1772708b8df254b49d19
BLAKE2b-256 6613a9ab4951831c6ae702b21fad1d3c107a5eb7f0681bb10a2d081e8240fa7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhan-0.0.13.tar.gz:

Publisher: release.yml on lizongying/pyhan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhan-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: pyhan-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyhan-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 04a27664d0345ebf19e6c75a8bfbe9c0f4aa0f90244a630079ccb1fa39d1b68c
MD5 f767da8a9e7181a689403f0a1826bc32
BLAKE2b-256 ff15db09ed6ca52808f3b8651a25adf9c6d43a1e941083f370fe53a31a7e3595

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhan-0.0.13-py3-none-any.whl:

Publisher: release.yml on lizongying/pyhan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page