2 releases
0.1.1 | Jan 15, 2024 |
---|---|
0.1.0 | Jun 7, 2023 |
#1035 in Text processing
73 downloads per month
11KB
97 lines
pangu2
The fork of pangu-rs.
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.clj (Clojure)
- pangu.ex (Elixir)
- pangu.go (Go)
- pangu.java (Java)
- pangu.js (JavaScript, both Node and Browser)
- pangu.objective-c (Objective-C)
- pangu.php (PHP)
- pangu.py (Python)
- pangu.rb (Ruby)
- pangu.swift (Swift)
Usage
Add to Cargo.toml
:
[dependencies]
pangu2 = "0.1"
Example:
fn main() {
assert_eq!(
pangu2::spacing("新八的構造成分有95%是眼鏡、3%是水、2%是垃圾"),
"新八的構造成分有 95% 是眼鏡、3% 是水、2% 是垃圾"
);
}
License
Licensed under either of
- Apache License Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Dependencies
~2.8–4.5MB
~78K SLoC