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님, 안녕하세요!
Checks whether syllable
is a Hangul syllable or not. Returns the evaluation as bool
syllable
: any character to check
Checks whether character
is a Hangul jamo character or not. Returns the evaluation as bool
character
: any character to check
Composes a Hangul syllable using leading_consonant
, vowel
, and trailing_consonant
. Returns the composed Hangul syllable.
leading_consonant
: Hangul leading consonant as known as chosengvowel
: Hangul vowel as known as jongseongtrailing_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