public class Bopomofo4jEngine extends Object implements PinyinEngine
Bopomofo4j封装,项目:https://gitee.com/rnkrsoft/Bopomofo4j。
引入:
<dependency>
<groupId>com.rnkrsoft.bopomofo4j</groupId>
<artifactId>bopomofo4j</artifactId>
<version>1.0.0</version>
</dependency>
| Constructor and Description |
|---|
Bopomofo4jEngine()
构造
|
| Modifier and Type | Method and Description |
|---|---|
String |
getPinyin(char c)
如果c为汉字,则返回大写拼音;如果c不是汉字,则返回String.valueOf(c)
|
String |
getPinyin(String str,
String separator)
获取字符串对应的完整拼音,非中文返回原字符
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFirstLetter, getFirstLetterpublic String getPinyin(char c)
PinyinEnginegetPinyin in interface PinyinEnginec - 任意字符,汉字返回拼音,非汉字原样返回public String getPinyin(String str, String separator)
PinyinEnginegetPinyin in interface PinyinEnginestr - 字符串separator - 拼音之间的分隔符Copyright © 2025. All rights reserved.