pangu
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).
This is the Crystal copy version from bugtender/rangu.
-
Official supports:
- pangu.go (Go)
- pangu.java (Java)
- pangu.js (JavaScript)
- pangu.py (Python)
- pangu.space (Web API)
-
Community supports:
- pangu.clj (Clojure)
- pangu.dart (Dart)
- pangu.ex (Elixir)
- pangu.objective-c (Objective-C)
- pangu.php (PHP)
- pangu.rb (Ruby)
- pangu.rs (Rust)
- pangu.swift (Swift)
- pangu.cr (Crystal)
Installation
Add the dependency to your shard.yml
:
dependencies:
pangu:
github: isaced/pangu.cr
Run shards install
Usage
require "pangu"
Pangu.spacing("當你凝視著bug,bug也凝視著你")
=> "當你凝視著 bug,bug 也凝視著你"
Pangu.spacing("path/to/file.txt")
=> "與 PM 戰鬥的人,應當小心自己不要成為 PM"
Contributing
- Fork it (https://github.com/isaced/pangu.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request