#spacing #pangu #objective-c #clojure #elixir #go #java #browser #php #pangu2

pangu2

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)

3 unstable releases

Uses new Rust 2024

0.2.0 Apr 22, 2025
0.1.1 Jan 15, 2024
0.1.0 Jun 7, 2023

#549 in Text processing

Download history 61/week @ 2025-04-16 56/week @ 2025-04-23 4/week @ 2025-04-30

121 downloads per month

MIT/Apache

12KB
98 lines

pangu2

Build Status Crates Version Rust Docs

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).

Usage

Add to Cargo.toml:

[dependencies]
pangu2 = "0.2"

Example:

fn main() {
  assert_eq!(
    pangu2::spacing("新八的構造成分有95%是眼鏡、3%是水、2%是垃圾"),
    "新八的構造成分有 95% 是眼鏡、3% 是水、2% 是垃圾"
  );
}

License

Licensed under either of

at your option.

Dependencies

~2.6–3.5MB
~63K SLoC