使用opencc4j转换
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>opencc4j</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>heaven</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>nlp-common</artifactId>
<version>0.0.5</version>
</dependency>
<dependency>
<groupId>com.huaban</groupId>
<artifactId>jieba-analysis</artifactId>
<version>1.0.2</version>
</dependency>
public static void main(String[] args) {
String simple = ZhConverterUtil.toSimple("繁體中文轉換為簡體中文");
String traditional = ZhConverterUtil.toTraditional("简体中文转换繁体");
System.out.println(simple);
System.out.println(traditional);
}