A library to compose and decompose Hangul syllables using Hangul jamo characters
- Python 3+
pip install hangul-jamo
>>> import hangul_jamo >>> print(hangul_jamo.decompose('Jonghwan님, 안녕하세요!')) Jonghwanㄴㅣㅁ, ㅇㅏㄴㄴㅕㅇㅎㅏㅅㅔㅇㅛ! >>> print(hangul_jamo.compose('Jonghwanㄴㅣㅁ, ㅇㅏㄴㄴㅕㅇㅎㅏㅅㅔㅇㅛ!')) Jonghwan님, 안녕하세요!
syllable is a Hangul syllable or not. Returns the evaluation as
syllable: any character to check
character is a Hangul jamo character or not. Returns the evaluation as
character: any character to check
hangul_jamo.compose_jamo_characters(leading_consonant, vowel, trailing_consonant=None)
Composes a Hangul syllable using
trailing_consonant. Returns the composed Hangul syllable.
leading_consonant: Hangul leading consonant as known as choseng
vowel: Hangul vowel as known as jongseong
trailing_consonant: Hangul trailing consonant as known as jungseong (optional)
Decomposes given Hangul
syllable into Hangul jamo characters. Returns the decomposed Hangul jamo characters as 3-tuple
(leading consonant, vowel, trailing consonant). Returned trailing consonant can be None.
syllable: Hangul syllable to decompose
Composes Hangul jamo characters within
text into Hangul syllables. Characters other than Hangul jamo are ignored. Returns the composed text.
text: text containing Hangul jamo characters
Decomposes Hangul syllables within
text into Hangul jamo characters. Characters other than Hangul syllable are ignored. Returns the decomposed text.
text: text containing Hangul syllables