Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean), half-width English, digit and symbol characters.
This library is designed for both Clojure/ClojureSript, you need following minimal version:
- Clojure 1.7.0 ↑
- ClojureScript 1.7.0 ↑
(ns pangu-test.core
(:require [coldnew.pangu :as pangu]))
(defn -main []
(println (pangu/spacing "請問Jackie的鼻子有幾個?123個!"))) ; => "請問 Jackie 的鼻子有幾個?123 個!"
This library test with speclj, to test with Clojure, use following command:
$ lein spec
If you want to test in ClojureScript, use below
$ lein cljsbuild test
- pangu.js (JavaScript, both Node.js and Browser)
- pangu.go (Go)
- pangu.java (Java)
- pangu.py (Python)
- pangu.rb (Ruby)
- pangu.objective-c (Objective-C)
- pangu.php (PHP)
- pangu.ex (Elixir)
Copyright © 2016 Yen-Chin, Lee <coldnew.tw@gmail.com>
Distributed under the MIT License.