All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.hutool.extra.pinyin.engine.bopomofo4j.Bopomofo4jEngine Maven / Gradle / Ivy

There is a newer version: 5.8.33
Show newest version
package cn.hutool.extra.pinyin.engine.bopomofo4j;

import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinEngine;
import com.rnkrsoft.bopomofo4j.Bopomofo4j;
import com.rnkrsoft.bopomofo4j.ToneType;

/**
 * 封装了Bopomofo4j的引擎。
 *
 * 

* Bopomofo4j封装,项目:https://gitee.com/rnkrsoft/Bopomofo4j。 *

* *

* 引入: *

 * <dependency>
 *     <groupId>com.rnkrsoft.bopomofo4j</groupId>
 *     <artifactId>bopomofo4j</artifactId>
 *     <version>1.0.0</version>
 * </dependency>
 * 
* * @author looly * @since 5.4.5 */ public class Bopomofo4jEngine implements PinyinEngine { public Bopomofo4jEngine(){ Bopomofo4j.local(); } @Override public String getPinyin(char c) { return Bopomofo4j.pinyin(String.valueOf(c), ToneType.WITHOUT_TONE, false, false, StrUtil.EMPTY); } @Override public String getPinyin(String str, String separator) { return Bopomofo4j.pinyin(str, ToneType.WITHOUT_TONE, false, false, separator); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy