Crates.io | hanja |
lib.rs | hanja |
version | 0.1.1 |
source | src |
created_at | 2017-09-22 06:22:42.96676 |
updated_at | 2017-09-22 06:40:44.338412 |
description | Korean-Hanja(Chinese character for Korean language) dictionary |
homepage | |
repository | https://github.com/bekker/hanja-rs |
max_upload_size | |
id | 32617 |
size | 6,655,211 |
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"
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); // 大韓民國
}
火: 불 화
花: 꽃 화
化: 될 화
話: 말할 화, 이야기 화
和: 화할 화
畵: 그림 화
華: 꽃 화, 빛날 화
貨: 재화 화, 재물 화
禍: 재화 화
禾: 벼 화
大韓民國
Distributed under MIT License