Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A set of utility functions for processing Chinese text.

Project Description

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'毕升')
畢升
Release History

Release History

This version
History Node

0.10.0

History Node

0.9.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bisheng-0.10.0.tar.gz (33.1 kB) Copy SHA256 Checksum SHA256 Source Mar 29, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting