Spacing texts using Python! Insert a white space between full-width characters (Chinese, Japanese, etc.) and half-width alphanumerics. For good readability.
Project description
pangu
Spacing texts using Python! Insert a white space between full-width characters (Chinese, Japanese, etc.) and half-width alphanumerics. For good readability.
JavaScript version: pangu.js
Installation
$ pip install pangu
Usage
>>> import pangu
>>> pangu.spacing(u'請問Jackie的鼻子有幾個?123個!')
u'請問 Jackie 的鼻子有幾個?123 個!'
>>> pangu.spacing(u'主要成份:眼鏡95%、水3%、垃圾2%。')
u'主要成份:眼鏡 95%、水 3%、垃圾 2%。'
>>> pangu.spacing(u'新阿姆斯特朗炫風噴射阿姆斯特朗砲')
u'新阿姆斯特朗炫風噴射阿姆斯特朗砲'
History
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-1.0.0.tar.gz
(3.6 kB
view hashes)