belerweb / pinyin4j

A copy of http://sourceforge.net/projects/pinyin4j, then deploy it to maven central repository.
1.24k stars 308 forks source link

单个字转换的时候 为什么出现三个相同的...拼音 #37

Open Shimizusorrow opened 3 years ago

Shimizusorrow commented 3 years ago
 /**
     * 将中文转换为拼音
     */
    @Test
    void test() throws BadHanyuPinyinOutputFormatCombination {
      HanyuPinyinOutputFormat format=new HanyuPinyinOutputFormat();
      format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
//      format.setCaseType(HanyuPinyinCaseType.UPPERCASE);
//      format.setVCharType(HanyuPinyinVCharType.WITH_V);
        String[] strings = PinyinHelper.toHanyuPinyinStringArray('华', format);
        System.out.println(String.join("",strings));

    }

output:

huahuahua
zhangethan commented 3 years ago

三个读音有不同的声调, 但是你没要声调。