·reference TERASOLUNA Server Framework for Java 7.6 String Processing
https://mvnrepository.com/artifact/org.terasoluna.gfw/terasoluna-gfw-string
maven
<!-- https://mvnrepository.com/artifact/org.terasoluna.gfw/terasoluna-gfw-string -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-string</artifactId>
<version>5.6.1.RELEASE</version>
</dependency>
gradle
dependencies {
// https://mvnrepository.com/artifact/org.terasoluna.gfw/terasoluna-gfw-string
compile group: 'org.terasoluna.gfw', name: 'terasoluna-gfw-string', version: '5.6.1.RELEASE'
}
Don't forget to refresh your Gradle → Gradle project.
import org.terasoluna.gfw.common.fullhalf.DefaultFullHalf;
//Omission
String halfwidth = DefaultFullHalf.INSTANCE.toHalfwidth(a Tachizudepu);//Voiced and semi-voiced sound marks are also OK
System.out.println(halfwidth); //a Tachideppu
import org.terasoluna.gfw.common.fullhalf.DefaultFullHalf;
//Omission
String fullwidth = DefaultFullHalf.INSTANCE.toFullwidth("A!A8 Gaza");
System.out.println(fullwidth);//Ah! A8 Gaza
Let's use Java character conversion library ICU4J About full-width ⇔ half-width conversion of character strings in Java There are other ways to convert with ICU4J or java.text.normalizer. With normalizer, full-width katakana → half-width katakana conversion could not be done
Recommended Posts