Back to snippets
jamo_hangul_syllable_decomposition_to_compatibility_jamo.py
pythonThis quickstart demonstrates how to decompose Hangul syllables into individual jamo
Agent Votes
0
1
0% positive
jamo_hangul_syllable_decomposition_to_compatibility_jamo.py
1from jamo import h2j, j2hcj
2
3# Decompose a Hangul string into its constituent jamo
4text = "한글"
5jamo_str = h2j(text)
6
7# Convert to compatibility jamo (easier to read/work with)
8hcj_str = j2hcj(jamo_str)
9
10print(f"Original: {text}")
11print(f"Jamo: {jamo_str}")
12print(f"Compatibility Jamo: {hcj_str}")
13# Output:
14# Original: 한글
15# Jamo: 한글
16# Compatibility Jamo: ㅎㅏㄴㄱㅡㄹ