hanja

Crates.iohanja
lib.rshanja
version0.1.1
sourcesrc
created_at2017-09-22 06:22:42.96676
updated_at2017-09-22 06:40:44.338412
descriptionKorean-Hanja(Chinese character for Korean language) dictionary
homepage
repositoryhttps://github.com/bekker/hanja-rs
max_upload_size
id32617
size6,655,211
Jang Ryeol (bekker)

documentation

https://docs.rs/hanja

README

hanja-rs

Build Status

Korean-Hanja(Chinese character for Korean language) dictionary for Rust.

You can lookup Hanja for a given Hangeul syllable, like most of Korean IMEs do.

All Hanja entries are sorted by the use frequency of each.

Only syllables supported, not words(Hanjaeo).

Hashmap is precompiled fast using phf, taking only a few seconds.

Hanja dictionary and frequency data credited to libhangul and its contributors.

[dependencies]
hanja = "0.1.1"

Usage

extern crate hanja;

fn main() {
    for &(hanja, desc) in hanja::get('화').unwrap().iter().take(10) {
        println!("{}: {}", hanja, desc);
    }

    let korea_in_hangeul = "대한민국";
    let korea_in_hanja = korea_in_hangeul.chars()
            .map(|c| hanja::get(c).unwrap()[0].0)
            .collect::<String>();
    println!("{}", korea_in_hanja); // 大韓民國
}
火: 불 화
花: 꽃 화
化: 될 화
話: 말할 화, 이야기 화
和: 화할 화
畵: 그림 화
華: 꽃 화, 빛날 화
貨: 재화 화, 재물 화
禍: 재화 화
禾: 벼 화
大韓民國

Documentation

Docs.rs

License

Distributed under MIT License

Commit count: 6

cargo fmt