2 unstable releases
0.9.0 | Mar 3, 2019 |
---|---|
0.8.0 | Jan 2, 2019 |
#460 in Internationalization (i18n)
8,390 downloads per month
Used in 35 crates
(3 directly)
14KB
91 lines
UNIC — Unicode Character Database — Hangul Syllable Composition & Decomposition
This UCD component provides algorithms described in Unicode® Standard - 3.12 Conjoining Jamo Behavior, used for detecting, composing and decomposing Hangul syllables.
lib.rs
:
UNIC - UCD - Hangul Syllable Composition & Decomposition
This UCD component provides algorithms described in Unicode® Standard - 3.12 Conjoining Jamo Behavior, used for detecting, composing and decomposing Hangul syllables.
Examples
let sample_hangul = '갓';
assert!(is_syllable(sample_hangul));
let mut decomposed = vec![];
{
let mut collect_decomposed = |chr| {
decomposed.push(chr);
};
decompose_syllable(sample_hangul, &mut collect_decomposed);
}
assert_eq!(decomposed, ['ᄀ', 'ᅡ', 'ᆺ']);
let composed_lv = compose_syllable(decomposed[0], decomposed[1]).unwrap();
let composed = compose_syllable(composed_lv, decomposed[2]).unwrap();
assert_eq!(composed, sample_hangul);