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.py
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).
pangu.go (Go)
pangu.java (Java)
pangu.js (JavaScript, both Node.js and Browser)
pangu.objective-c (Objective-C)
pangu.php (PHP)
pangu.py (Python)
pangu.rb (Ruby)
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().
History
3.0.0 (2016-01-24)
Support Python 3.5
Refactoring
Rename text_spacing() to spacing_text()
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)
Synchronize version number with pangu.js
Improve Paranoid Text Spacing algorithm
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
Built Distribution
Hashes for pangu-3.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0098712a1f3d871b35786bfdb3c924abb95160b2a19a97e7f5e473cbd40153fd |
|
MD5 | ebee7bbbb0283fe2473cf2d9834a35a6 |
|
BLAKE2b-256 | 866ea784b240911ea11b370c239fca2d9572d855a85342a2571333a74d1adfe7 |