For AI agents: the complete documentation index is available at https://canary.gukhanmun.org/ko-Kore/llms.txt, the full documentation bundle is available at https://canary.gukhanmun.org/ko-Kore/llms-full.txt, and this page is available as Markdown at https://canary.gukhanmun.org/ko-Kore/guide/javascript/directives.md.
  • 韓國語 (國漢文)
  • 指示

    directives 옵션을 使用하면 特定 漢字 文字에 對해 倂記 標識를 덮어쓸 수 있습니다.

    指示 인터페이스(interface)

    interface Directives {
      
    Directives.requireHanja?: string[] | undefined
    requireHanja
    ?: string[]; // 出力에 漢字를 恒常 表示
    Directives.requireHangul?: string[] | undefined
    requireHangul
    ?: string[]; // 한글 讀音을 恒常 表示("original" 모드用)
    Directives.skipAnnotation?: string[] | undefined
    skipAnnotation
    ?: string[]; // 倂記를 全的으로 抑制
    }

    各 配列은 標識를 덮어쓰려는 漢字 文字列을 담습니다:

    import { 
    function load(options?: GukhanmunLoadOptions): Promise<Gukhanmun>

    Creates a Gukhanmun converter with the given options.

    Initialises the WASM module on the first call (subsequent calls reuse the cached module). Compiled dictionaries supplied via GukhanmunOptions.dictionaries are fetched, while MapDictionarySource entry lists are serialised and built in memory as Rust MapDictionary values.

    Note: unlike the Rust ko-kr preset, the JavaScript preset never includes a bundled dictionary. Pass dictionaries: [await stdictFst()] to include the Standard Korean Language Dictionary.

    @paramoptions - Conversion options. All fields are optional; defaults match the ko-kr preset.@returnsA Gukhanmun instance.@throws{@linkGukhanmunError } on invalid options or dictionary load failure.
    load
    } from "@gukhanmun/wasm";
    import {
    function stdictFst(): Promise<FileDictionarySource>

    Loads the bundled Standard Korean Language Dictionary as a

    FileDictionarySource ready to pass to load({ dictionaries: [...] }).

    @returnsA FileDictionarySource with format: "fst" and role: "reference".
    stdictFst
    } from "@gukhanmun/stdict-fst";
    const
    const g: Gukhanmun
    g
    = await
    function load(options?: GukhanmunLoadOptions): Promise<Gukhanmun>

    Creates a Gukhanmun converter with the given options.

    Initialises the WASM module on the first call (subsequent calls reuse the cached module). Compiled dictionaries supplied via GukhanmunOptions.dictionaries are fetched, while MapDictionarySource entry lists are serialised and built in memory as Rust MapDictionary values.

    Note: unlike the Rust ko-kr preset, the JavaScript preset never includes a bundled dictionary. Pass dictionaries: [await stdictFst()] to include the Standard Korean Language Dictionary.

    @paramoptions - Conversion options. All fields are optional; defaults match the ko-kr preset.@returnsA Gukhanmun instance.@throws{@linkGukhanmunError } on invalid options or dictionary load failure.
    load
    ({
    dictionaries?: readonly (DictionarySource | LoadedDictionary)[] | undefined
    dictionaries
    : [await
    function stdictFst(): Promise<FileDictionarySource>

    Loads the bundled Standard Korean Language Dictionary as a

    FileDictionarySource ready to pass to load({ dictionaries: [...] }).

    @returnsA FileDictionarySource with format: "fst" and role: "reference".
    stdictFst
    ()],
    directives?: Directives | undefined

    Per-hanja rendering directives that override dictionary marks.

    @seeDirectives
    directives
    : {
    Directives.requireHanja?: readonly string[] | undefined

    Hanja forms that must always be shown with their original hanja alongside the hangul reading, as if requireHanja were set in the dictionary.

    requireHanja
    : ["漢", "字"],
    Directives.requireHangul?: readonly string[] | undefined

    Hanja forms that must always be shown with a hangul gloss alongside the original hanja (relevant for rendering: "original").

    requireHangul
    : ["東"],
    Directives.skipAnnotation?: readonly string[] | undefined

    Hanja forms whose annotation should be suppressed entirely; the renderer emits only the primary plain text form (hangul or hanja depending on rendering).

    skipAnnotation
    : ["中"],
    }, });

    렌더링 모드와의 結合

    指示는 活性 렌더링 모드와 相互作用합니다:

    • requireHanja는 "hangul-only" 모드에서 가장 잘 드러나며, 漢字가 한글 讀音 곁에 나타나도록 強制합니다.
    • requireHangul은 "original" 모드에서 特定 文字의 한글 倂記를 強制하는 데 有用합니다.
    • skipAnnotation은 모드와 無關하게 一切의 倂記를 抑制합니다.