gukhanmun
Umbrella library for hanja-to-hangul conversion. This crate wires together the
engine, format adapters, and dictionary backends from the workspace into a
single Builder/Converter facade.
Installation
[]
= "0.1"
All features are enabled by default. To trim the dependency tree, disable them selectively:
[]
= { = "0.1", = false, = ["html"] }
Available features: html, markdown, fst, cdb, stdict (implies
fst). The stdict feature embeds the South Korean Standard Dictionary and
adds roughly 3 MB to the binary.
Usage
Default preset (South Korean)
use Builder;
let converter = new.build?;
assert_eq!;
Custom dictionary
use ;
let mut dict = new;
dict.insert;
let converter = new
.no_bundled_stdict
.push_dictionary
.build?;
assert_eq!;
North Korean preset
use ;
let converter = with_preset.build?;
// No initial sound law: 來日 → 래일
assert_eq!;
HTML fragment
use Builder;
let converter = new.build?;
let output = converter.convert_html_fragment_to_string?;
assert!;
Presets
Preset::KoKr (the default) loads the bundled Standard Korean Language
Dictionary and applies the initial sound law. Preset::KoKp omits both,
following North Korean orthographic conventions where Sino-Korean words are
written without the initial sound law (래일, 류행, 녀자).
Relation to the other workspace crates
gukhanmun re-exports public items from gukhanmun-core, gukhanmun-html,
gukhanmun-markdown, gukhanmun-fst, gukhanmun-cdb, and gukhanmun-stdict
under feature gates. Code that needs only a subset of the pipeline can depend
on those crates directly. The full workspace is documented in DESIGN.md at
the repository root.
License
GPL-3.0-only. See LICENSE at the repository root.