Class TinyPinyinProvider
java.lang.Object
org.miaixz.bus.extra.pinyin.provider.tinypinyin.TinyPinyinProvider
- All Implemented Interfaces:
org.miaixz.bus.core.Provider,PinyinProvider
封装了TinyPinyin的引擎。
TinyPinyin(https://github.com/promeG/TinyPinyin)提供者未提交Maven中央库, 因此使用 https://github.com/biezhi/TinyPinyin打包的版本
引入:
<dependency>
<groupId>io.github.biezhi</groupId>
<artifactId>TinyPinyin</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescription构造TinyPinyinProvider(com.github.promeg.pinyinhelper.Pinyin.Config config) 构造 -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.extra.pinyin.PinyinProvider
getFirstLetter, getFirstLetter, type
-
Constructor Details
-
TinyPinyinProvider
public TinyPinyinProvider()构造 -
TinyPinyinProvider
public TinyPinyinProvider(com.github.promeg.pinyinhelper.Pinyin.Config config) 构造- Parameters:
config- 配置
-
-
Method Details
-
getPinyin
Description copied from interface:PinyinProvider如果c为汉字,则返回大写拼音;如果c不是汉字,则返回String.valueOf(c)- Specified by:
getPinyinin interfacePinyinProvider- Parameters:
c- 任意字符,汉字返回拼音,非汉字原样返回- Returns:
- 汉字返回拼音,非汉字原样返回
-
getPinyin
Description copied from interface:PinyinProvider获取字符串对应的完整拼音,非中文返回原字符- Specified by:
getPinyinin interfacePinyinProvider- Parameters:
text- 字符串separator- 拼音之间的分隔符- Returns:
- 拼音
-