Pangu.java
Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean), half-width English, digit and symbol characters.
- pangu.go (Go)
- pangu.java (Java)
- pangu.js (JavaScript)
- pangu.py (Python)
- pangu.space (Web API)
Download
Download the latest JAR or grab via Maven:
<dependency>
<groupId>ws.vintagroupId>
<artifactId>panguartifactId>
<version>1.1.0version>
dependency>
<groupId>ws.vintagroupId>
<artifactId>panguartifactId>
<version>1.1.0version>
dependency>
or Gradle:
compile 'ws.vinta:pangu:1.1.0'
Usage
import ws.vinta.pangu.Pangu;
public class Main {
public static void main(String[] args) {
Pangu pangu = new Pangu();
String newText = pangu.spacingText("Qing Wen JackieDe Bi Zi You Ji Ge ?123Ge !");
System.out.println(newText); // will be "Qing Wen Jackie De Bi Zi You Ji Ge ?123 Ge !"
}
}
public class Main {
public static void main(String[] args) {
Pangu pangu = new Pangu();
String newText = pangu.spacingText("Qing Wen JackieDe Bi Zi You Ji Ge ?123Ge !");
System.out.println(newText); // will be "Qing Wen Jackie De Bi Zi You Ji Ge ?123 Ge !"
}
}
Run Tests
$ mvn test