#text #unicode #hangul

unic-ucd-hangul

UNIC — Unicode Character Database — Hangul Syllable Composition & Decomposition

2 unstable releases

0.9.0 Mar 3, 2019
0.8.0 Jan 2, 2019

#6 in #hangul

Download history 1000/week @ 2021-10-08 891/week @ 2021-10-15 519/week @ 2021-10-22 594/week @ 2021-10-29 602/week @ 2021-11-05 395/week @ 2021-11-12 433/week @ 2021-11-19 653/week @ 2021-11-26 636/week @ 2021-12-03 489/week @ 2021-12-10 251/week @ 2021-12-17 186/week @ 2021-12-24 257/week @ 2021-12-31 419/week @ 2022-01-07 703/week @ 2022-01-14 658/week @ 2022-01-21

2,077 downloads per month
Used in 20 crates (3 directly)

MIT/Apache

12KB
91 lines

UNIC — Unicode Character Database — Hangul Syllable Composition & Decomposition

Crates.io Documentation

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

# use unic_ucd_hangul::{is_syllable, compose_syllable, decompose_syllable};

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

Dependencies