Skip to content

PinyinUtils for HanziToPinyin using pinyin4j library

Notifications You must be signed in to change notification settings

shellever/HanziToPinyin

Repository files navigation

HanziToPinyin

Three types of output format options can be customized in pinyin4j.

  • VCharType: output format of character 'ü', which has three options.
    • WITH_U_AND_COLON (default)
    • WITH_V
    • WITH_U_UNICODE
  • ToneType: output format of Chinese tones, which has three options.
    • WITH_TONE_NUMBER (default)
    • WITHOUT_TONE
    • WITH_TONE_MARK
  • CaseType: cases of letters in outputted string, which has two options.
    • LOWERCASE (default)
    • UPPERCASE

Some combinations of these three output formats are forbidden. For example, '吕'

LOWERCASE
Combination WITH_U_AND_COLON WITH_V WITH_U_UNICODE
WITH_TONE_NUMBER lu:3 lv3 lü3
WITHOUT_TONE lu: lv
WITH_TONE_MARK Exception Exception
UPPERCASE
Combination WITH_U_AND_COLON WITH_V WITH_U_UNICODE
WITH_TONE_NUMBER LU:3 LV3 LÜ3
WITHOUT_TONE LU: LV
WITH_TONE_MARK Exception Exception
Tone Tone Mark Number added to end of syllable
in place of tone mark
Example using
tone mark
Example using
number
First macron (¯) 1 ma1
Second acute accent (´) 2 ma2
Third caron (ˇ) 3 ma3
Fourth grave accent (`) 4 ma4

Links:

Combination of output format options

Unicode® character table

Pinyin

pinyin4j

About

PinyinUtils for HanziToPinyin using pinyin4j library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages