mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add class
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.hutool.extra.pinyin;
|
||||
|
||||
import cn.hutool.extra.pinyin.engine.bopomofo4j.Bopomofo4jEngine;
|
||||
import cn.hutool.extra.pinyin.engine.pinyin4j.Pinyin4jEngine;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
@@ -19,6 +20,13 @@ public class PinyinUtilTest {
|
||||
Assert.assertEquals("ni hao h", pinyin);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getPinyinByBopomofo4jTest() {
|
||||
final Bopomofo4jEngine engine = new Bopomofo4jEngine();
|
||||
final String pinyin = engine.getPinyin("你好h", " ");
|
||||
Assert.assertEquals("ni haoh", pinyin);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getPinyinUpperCaseTest(){
|
||||
final String pinyin = PinyinUtil.getPinyin("你好怡", " ");
|
||||
@@ -37,4 +45,11 @@ public class PinyinUtilTest {
|
||||
final String result = engine.getFirstLetter("林海", "");
|
||||
Assert.assertEquals("lh", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getFirstLetterByBopomofo4jTest(){
|
||||
final Bopomofo4jEngine engine = new Bopomofo4jEngine();
|
||||
final String result = engine.getFirstLetter("林海", "");
|
||||
Assert.assertEquals("lh", result);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user