Skip to main content

Crate hangul

Crate hangul 

Source
Expand description

Hangul string processing: syllable disassembly, choseong search, batchim/josa, and jamo assembly.

On crates.io the package is rusty_hangul. In Rust the crate is still imported as hangul.

use hangul::{assemble, Hangul};

let text = Hangul::new("안녕하세요");
assert_eq!(text.disassemble(), "ㅇㅏㄴㄴㅕㅇㅎㅏㅅㅔㅇㅛ");
assert_eq!(text.get_choseong(), "ㅇㄴㅎㅅㅇ");
assert_eq!(text.josa("을/를").unwrap(), "안녕하세요를");
assert_eq!(assemble("ㄱㅏㅂㅅ"), "값");

Structs§

ChoseongMatch
Range of a choseong / progressive search hit inside a Hangul value.
Hangul
Parsed Hangul text: NFC syllables, NFD jamo clusters, and other characters.
HangulLetter
One NFC or NFD Hangul syllable with choseong, jungseong, and optional jongseong.
HangulUnit
One parsed slot in a Hangul value: a Hangul syllable or a single other character.

Enums§

AssemblePolicy
How to resolve a jamo that could be a compound batchim or the next syllable.
JosaError
Failed josa lookup.

Functions§

assemble
Assemble compatibility jamo into syllables using AssemblePolicy::PreferNextSyllable.
assemble_with_policy
Assemble compatibility jamo into syllables with an explicit AssemblePolicy.