Project

pangu

0.01
No commit activity in last 3 years
No release in over 3 years
Insert a white space between full-width characters (Chinese, Japanese, etc.) and half-width alphanumerics for good readability.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.9
~> 10.0
~> 3.2
 Project Readme

pangu.rb

Build Status Coverage Status

Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean), half-width English, digit and symbol characters.

Installation

gem install pangu

Usage

require "pangu"

Pangu.spacing("請問Jackie的鼻子有幾個?123個!")
=> "請問 Jackie 的鼻子有幾個?123 個!"
Pangu.spacing("主要成份:眼鏡95%、水3%、垃圾2%。")                                                                                                                                        
=> "主要成份:眼鏡 95%、水 3%、垃圾 2%。"
Pangu.spacing("新阿姆斯特朗炫風噴射阿姆斯特朗砲")
=> "新阿姆斯特朗炫風噴射阿姆斯特朗砲"

License

Copyright (c) 2015 Richard Lee. See LICENSE.txt for details.