Skip to main content

Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).

Project description

pangu

http://img.shields.io/travis/vinta/pangu.py/master.svg?style=flat-square http://img.shields.io/coveralls/vinta/pangu.py/master.svg?style=flat-square http://img.shields.io/pypi/v/pangu.svg?style=flat-square https://pypip.in/py_versions/pangu/badge.svg?style=flat-square https://img.shields.io/badge/made%20with-%e2%9d%a4-ff69b4.svg?style=flat-square

Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).

Installation

$ pip install pangu

Usage

>>> import pangu

>>> pangu.spacing(u'所以,請問Jackey的鼻子有幾個?3.14個')
u'所以, 請問 Jackey 的鼻子有幾個? 3.14 個'

>>> pangu.spacing(u'新八的構造成分有95%是眼鏡、3%是水、2%是垃圾')
u'新八的構造成分有 95% 是眼鏡、3% 是水、2% 是垃圾'

>>> pangu.spacing(u'新阿姆斯特朗炫風噴射阿姆斯特朗砲')
u'新阿姆斯特朗炫風噴射阿姆斯特朗砲'

History

2.5.6.3 (2015-05-18)

  • Add an alias to spacing(): text_spacing()

  • Fix unicode issue in Python 2.x

2.5.6.2 (2015-05-17)

  • Fix setup.py

2.5.6 (2015-05-17)

1.0.0 (2014-02-12)

  • Hello World

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

pangu-2.5.6.3.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

pangu-2.5.6.3-py2.py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 2 Python 3

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