Python quick start
Install Gukhanmun before running these examples.
Converter(...) creates a reusable converter backed by Rust. Configure it
once, then pass each document to convert().
Convert a document
Plain text is the default format. Use InputFormat.MARKDOWN for CommonMark,
or MarkdownOptions(gfm=True) for GitHub Flavored Markdown:
Options take enum members, not strings. If a value arrives as a string,
convert it first, for example Preset("ko-kr"). Passing preset="ko-kr"
directly to Converter() raises TypeError.
Presets do not load official dictionaries. With no explicit sources, conversion uses the built-in character fallback. Supply runtime entries or compiled FST/CDB data when word readings are needed, or install and add the official dictionaries.
Reuse a converter
Dictionary resources are loaded during construction, so configure one
converter and reuse it across documents. Its settings are immutable: inspect
the resolved configuration through converter.options, and create a new
converter to change it. A converter can be shared across threads, as shown in
Parallel documents.
Choose the next task
Handle errors
The API reference explains GukhanmunError, its
ErrorCode, and the root-first chain of causes. Wrong argument types raise
TypeError; lone Unicode surrogates in input raise UnicodeEncodeError.