[][src]Crate unic_ucd_hangul

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);

Constants

PKG_DESCRIPTION

UNIC component description.

PKG_NAME

UNIC component name.

PKG_VERSION

UNIC component version.

UNICODE_VERSION

The Unicode version of data

Functions

compose_syllable

Compose a pair of Hangul Jamo

decompose_syllable

Decompose a precomposed Hangul syllable

is_syllable

Whether the character is a (precomposed) Hangul Syllable