Crate hangeul [] [src]

View on GitHub

Korean alphabet manipulation library for Rust.

It is lightweight, without any unicode libraries.

[dependencies]
hangeul = "0.1.2"

Usage

extern crate hangeul;

fn main() {
    let subjective = "피카츄";
    let sub_josa = match hangeul::ends_with_jongseong(subjective).unwrap() {
        true => "이",
        false => "가"
    };
    let sentence = format!("야생의 {}{} 나타났다!", subjective, sub_josa);
    println!("{}", sentence); // 야생의 피카츄가 나타났다!
    print_choseong(&sentence); // ㅇㅅㅇ ㅍㅋㅊㄱ ㄴㅌㄴㄷ!
}

fn print_choseong(s:&str) {
    for c in s.chars() {
        print!("{}", hangeul::get_choseong(c).unwrap_or(c));
    }
    print!("\n");
}

Why not 'Hangul'?

'Hangul' is from old romanization system - McCune–Reischauer system.

'Hangeul' is official in South Korea, since 2000

License

Distributed under MIT License

Reexports

pub use self::get_choseong as get_top;
pub use self::get_jungseong as get_middle;
pub use self::get_jongseong as get_bottom;
pub use self::has_jongseong as has_bottom;
pub use self::ends_with_jongseong as ends_with_bottom;
pub use self::is_jaeum as is_consonant;
pub use self::is_moeum as is_vowel;
pub use self::is_choseong as is_top;
pub use self::is_jongseong as is_bottom;

Enums

HangeulError

Functions

compose

Compose compatible jamos into a Hangeul syllable

decompose

Decompose a Hangeul syllable into compatible jamos

ends_with_jongseong

Check if the end syllable of the string has jongseong (bottom)

get_choseong

Get choseong (top) of the syllable as compatible jamo

get_jongseong

Get jongseong (bottom) of the syllable as compatible jamo

get_jungseong

Get jungseong (middle) of the syllable as compatible jamo

has_jongseong

Check if the syllable has jongseong (bottom)

is_choseong

Check if the char is compatible jamo which can be a choseong (top)

is_jaeum

Check if the char is compatible jaeum

is_jamo

Check if the char is compatible jamo

is_jongseong

Check if the char is compatible jamo which can be a jongseong (bottom)

is_moeum

Check if the char is compatible moeum

is_syllable

Check if the syllable is correct Hangeul syllable