Closed Shimizusorrow closed 3 years ago
@Test void test() { HanyuPinyinOutputFormat fmt = new HanyuPinyinOutputFormat(); fmt.setToneType(HanyuPinyinToneType.WITHOUT_TONE); // fmt.setCaseType(HanyuPinyinCaseType.LOWERCASE); String[] pinyin_z = PinyinHelper.toHanyuPinyinStringArray('张'); String[] pinyin_l = PinyinHelper.toHanyuPinyinStringArray('李'); String[] z = PinyinHelper.toTongyongPinyinStringArray('张'); String[] l = PinyinHelper.toTongyongPinyinStringArray('李'); System.out.println(Stream.of(z).collect(Collectors.toList()).toString()); System.out.println(Stream.of(l).collect(Collectors.toList()).toString()); System.out.println(Stream.of(pinyin_z).collect(Collectors.toList()).toString()); System.out.println(Stream.of(pinyin_l).collect(Collectors.toList()).toString()); }
output: [jhang1] [li3] [zhang1] [li3]
[jhang1] [li3] [zhang1] [li3]
output:
[jhang1] [li3] [zhang1] [li3]