| Crates.io | hangeul_jamo_rs |
| lib.rs | hangeul_jamo_rs |
| version | 0.1.0 |
| created_at | 2025-12-24 17:26:34.170042+00 |
| updated_at | 2025-12-24 17:26:34.170042+00 |
| description | A high-performance Korean Hangul syllable and jamo manipulation library. included Python bindings. |
| homepage | |
| repository | https://github.com/gembleman/hangeul_jamo_rs |
| max_upload_size | |
| id | 2003607 |
| size | 72,669 |
A high-performance Korean Hangul syllable and jamo manipulation library written in Rust with Python bindings.
[dependencies]
hangeul_jamo = "0.1"
pip install hangeul_jamo
use hangeul_jamo::hcj::{decompose_hcj, compose_hcj};
// HCJ decomposition/composition
assert_eq!(decompose_hcj("한글"), "ㅎㅏㄴㄱㅡㄹ");
assert_eq!(compose_hcj("ㅎㅏㄴㄱㅡㄹ"), "한글");
// U+11xx jamo
use hangeul_jamo::jamo::{decompose_jamo, compose_jamo};
let jamo = decompose_jamo("한글");
assert_eq!(compose_jamo(&jamo), "한글");
// Compound jamo
use hangeul_jamo::core::{decompose_compound, compose_compound};
assert_eq!(decompose_compound('ㄲ'), Some(vec!['ㄱ', 'ㄱ']));
assert_eq!(compose_compound(&['ㄱ', 'ㄱ']), Some('ㄲ'));
import hangeul_jamo as hj
# HCJ decomposition/composition
assert hj.decompose_hcj("한글") == "ㅎㅏㄴㄱㅡㄹ"
assert hj.compose_hcj("ㅎㅏㄴㄱㅡㄹ") == "한글"
# Character checks
assert hj.is_hangul_syllable('한') == True
assert hj.is_hcj('ㄱ') == True
assert hj.is_jamo_compound('ㄲ') == True
# Compound jamo
assert hj.decompose_compound('ㄲ') == ('ㄱ', 'ㄱ')
assert hj.compose_compound(['ㅗ', 'ㅏ']) == 'ㅘ'
decompose_hcj(text) - Decompose syllables into HCJ jamo (한 → ㅎㅏㄴ)compose_hcj(text) - Compose HCJ jamo into syllables (ㅎㅏㄴ → 한)decompose_jamo(text) - Decompose syllables into U+11xx jamocompose_jamo(text) - Compose U+11xx jamo into syllablesis_hangul_syllable(ch) - Check if character is Hangul syllable (U+AC00-U+D7A3)is_hcj(ch) - Check if character is HCJ (U+31xx)is_jamo(ch) - Check if character is U+11xx jamois_jamo_lead(ch) - Check if leading consonantis_jamo_vowel(ch) - Check if vowelis_jamo_tail(ch) - Check if trailing consonantis_jamo_compound(ch) - Check if compound jamo (ㄲ, ㅘ, etc.)decompose_compound(jamo) - Decompose compound jamo (ㄲ → [ㄱ, ㄱ])compose_compound(components) - Compose into compound ([ㄱ, ㄱ] → ㄲ)jamo_to_hcj(ch) - Convert U+11xx jamo to HCJ (ᄀ → ㄱ)hcj_to_jamo(ch, position) - Convert HCJ to U+11xx jamo (ㄱ → ᄀ)
position: "lead", "vowel", or "tail"