Skip to content

Heeby/pangu.py

 
 

Repository files navigation

pangu.py

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('新八的構造成分有95%是眼鏡、3%是水、2%是垃圾')
# output: u'新八的構造成分有 95% 是眼鏡、3% 是水、2% 是垃圾'

pangu.spacing_text("Mr.龍島主道:「Let's Party!各位高明博雅君子!」")
# output: u"Mr. 龍島主道:「Let's Party! 各位高明博雅君子!」"

spacing_text() is an alias of spacing().

About

Paranoid text spacing in Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%