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)
- pangu.py (Python)
- pangu.space (Web API)
To install the package, pangu
, for using in your Go programs:
$ go get -u github.com/vinta/pangu
To install the command-line tool, pangu-axe
:
$ go get -u github.com/vinta/pangu/pangu-axe
package main
import (
"fmt"
"github.com/vinta/pangu"
)
func main() {
s := pangu.SpacingText("當你凝視著bug,bug也凝視著你")
fmt.Println(s)
// Output:
// 當你凝視著 bug,bug 也凝視著你
}
$ pangu-axe text "與PM戰鬥的人,應當小心自己不要成為PM"
與 PM 戰鬥的人,應當小心自己不要成為 PM
$ pangu-axe file 銀河便車指南.txt
$ pangu-axe file 宇宙盡頭的餐廳.txt -o 宇宙盡頭的餐廳(好讀版).txt
$ pangu-axe file 生命、宇宙及萬事萬物.txt 再見,謝謝你的魚.txt 基本無害.txt
Have a question? Ask it on the GitHub issues!