Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Lrischanging/pangu.java

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pangu.java

Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean), half-width English, digit and symbol characters.

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>ws.vinta</groupId>
  <artifactId>pangu</artifactId>
  <version>1.1.0</version>
</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("請問Jackie的鼻子有幾個?123個!");
        System.out.println(newText); // will be "請問 Jackie 的鼻子有幾個?123 個!"
    }
}

Run Tests

$ mvn test

About

Paranoid text spacing in Java

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Java 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.