Skip to content

vanms1989/pangu.py

 
 

Repository files navigation

pangu

image

image

image

image

image

image

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'新阿姆斯特朗炫風噴射阿姆斯特朗砲'

About

Paranoid text spacing in Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%