Skip to main content

A set of utility functions for processing Chinese text.

Project description

https://badge.fury.io/py/bisheng.png https://travis-ci.org/eliangcs/bisheng.png?branch=master https://coveralls.io/repos/eliangcs/bisheng/badge.png?branch=master

A set of utility functions for processing Chinese text. Current features include:

  • Add spaces between Chinese/Japanese/Korean characters and halfwidth characters

  • Convert traditional Chinese to simplified Chinese and the other way around

Installation

$ pip install bisheng

Usage

Add spaces between Chinese characters and halfwidth characters:

>>> import bisheng
>>> print bisheng.add_spaces(u'BiSheng由Python寫成,名字源自1000多年前的活字印刷術發明人-畢昇。')
BiSheng 由 Python 寫成,名字源自 1000 多年前的活字印刷術發明人 - 畢昇。

Specify the characters you want to exclude:

>>> print bisheng.add_spaces(u'中[括]弧')
中 [括] 孤

>>> print bisheng.add_spaces(u'中[括]弧', exclude='[]')
中[括]弧

Traditional/simplified Chinese convertion:

>>> print bisheng.to_simp(u'畢昇')
毕升

>>> print bisheng.to_trad(u'毕升')
畢升

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

bisheng-0.10.0.tar.gz (33.1 kB view details)

Uploaded Source

File details

Details for the file bisheng-0.10.0.tar.gz.

File metadata

  • Download URL: bisheng-0.10.0.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bisheng-0.10.0.tar.gz
Algorithm Hash digest
SHA256 d53cc62fac8b191fe19e0b88417a0ff325fe40f127baf6f21696d9f29ef07d66
MD5 ad5f152514068efb0c998fe2df425624
BLAKE2b-256 15aaaafb896086ed7249dc82a33597462339318fe35fceaea1b262a21b34b0d6

See more details on using hashes here.

Supported by

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