변환 옵션

이들을 GukhanmunOptions 객체의 속성으로 load()에 넘깁니다.

프리셋

preset은 미리 구성된 기본값 집합을 선택합니다:

사전두음법칙동음이의 창
"ko-kr" (기본)내장 없음, stdict를 명시적으로 불러옴true"per-block"
"ko-kp"없음false"off"
const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.preset?: Preset | undefined

Named configuration preset. Defaults to "ko-kr".

@seePreset
preset
: "ko-kp",
GukhanmunOptions.dictionaries?: readonly FileDictionarySource[] | undefined

Ordered list of dictionary sources. Sources are queried in order; earlier entries take precedence. When omitted (or empty), only the fallback Unihan character map is used (no bundled dictionaries).

JavaScript presets do not automatically include bundled dictionary data. To use the Standard Korean Language Dictionary, add @gukhanmun/stdict-fst or @gukhanmun/stdict-cdb explicitly. To use Open Korean Dictionary categories, add @gukhanmun/opendict-fst or @gukhanmun/opendict-cdb explicitly.

@seeDictionarySource
dictionaries
: [] });

Rust 크레이트와 달리, JavaScript 패키지는 내장 사전을 결코 자동으로 포함하지 않습니다; 항상 dictionaries를 통해 넘깁니다.

분할 전략

segmentation은 Gukhanmun이 한자 연속 안에서 단어 경계를 찾는 방식을 제어합니다:

  • "lattice" (기본): 매 위치의 모든 사전 일치를 평가하여 동적 계획법으로 전역적으로 최적인 분할을 선택합니다. 특히 합성어와 모호한 경계에서 가장 정확합니다.
  • "eager": 왼쪽에서 오른쪽으로 가장 긴 일치를 취하는 탐욕 방식. 더 빠르지만 합성어를 잘못 분할할 수 있습니다.
const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.segmentation?: Segmentation | undefined

Hanja-span segmentation algorithm. Defaults to "lattice".

@seeSegmentation
segmentation
: "lattice", // 基本: 最適, 動的 計劃法
// segmentation: "eager", // 貪慾, 더 빠르지만 덜 正確 });

정확도보다 처리량이 더 중요할 때에만 "eager"를 선호합니다.

수사 처리

numerals는 2016 같은 한자 수사 문자를 렌더링하는 방식을 제어합니다. 한자식 수사는 위치를 담느냐 수량을 담느냐에 따라 수를 여러 방식으로 나타낼 수 있습니다:

2016년11월1234
"hangul-phonetic" (기본)이공일륙년십일월일천이백삼십사
"positional-arabic"2016년(부적용)(부적용)
"additive-arabic"(부적용)11월1234
"smart"2016년11월1234
const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.numerals?: NumeralStrategy | undefined

How runs of hanja numerals are converted. Defaults to "hangul-phonetic".

@seeNumeralStrategy
numerals
: "hangul-phonetic" }); // 이공일륙 (基本)
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.numerals?: NumeralStrategy | undefined

How runs of hanja numerals are converted. Defaults to "hangul-phonetic".

@seeNumeralStrategy
numerals
: "positional-arabic"}); // 2016
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.numerals?: NumeralStrategy | undefined

How runs of hanja numerals are converted. Defaults to "hangul-phonetic".

@seeNumeralStrategy
numerals
: "additive-arabic" }); // 11 (月), 1234
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.numerals?: NumeralStrategy | undefined

How runs of hanja numerals are converted. Defaults to "hangul-phonetic".

@seeNumeralStrategy
numerals
: "smart" }); // 文脈마다 最適을 選擇

"smart"는 연도 같은 네 자리 연속에는 위치 기수법을, 분명한 수량에는 가산 기수법을 고르되 百濟十長生처럼 단어처럼 보이는 애매한 열은 음독 폴백으로 둡니다.

두음법칙

두음법칙은 단어 첫머리의 특정 초성을 바꾸는 남한의 음운 규칙입니다. 이 규칙은 어떤 사전에서도 찾지 못한 문자의 fallback 독음에 적용됩니다; 사전 항목은 이미 그 올바른 독음을 담고 있습니다.

입력initialSoundLaw: true (ko-kr)initialSoundLaw: false (ko-kp)
내일내일래일
이유이유리유
여자여자녀자
const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.initialSoundLaw?: boolean | undefined

Whether to apply the Korean initial sound law (頭音法則) to fallback phonetic readings. Defaults to true for "ko-kr" and false for "ko-kp".

Note: dictionary entries are assumed to encode the correct reading already; this flag only affects the character-by-character fallback path.

initialSoundLaw
: true }); // ko-kr의 基本
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.initialSoundLaw?: boolean | undefined

Whether to apply the Korean initial sound law (頭音法則) to fallback phonetic readings. Defaults to true for "ko-kr" and false for "ko-kp".

Note: dictionary entries are assumed to encode the correct reading already; this flag only affects the character-by-character fallback path.

initialSoundLaw
: false }); // ko-kp의 基本

북조선 정서법("ko-kp" 프리셋)이나 북조선 철자 관행을 따르는 텍스트를 처리할 때는 이를 끕니다.

괄호 독음 주석

한 단어가 명시적인 괄호 독음 주석을 한자가 앞에(庫間(곳간)) 또는 한글이 앞에(곳간(庫間)) 달고 있으면, Gukhanmun은 기본적으로 중복된 괄호를 제거하고 그 단어를 두 문자 체계로 보여 줍니다(곳간(庫間)). 대안 독음을 고정하는 괄호는 그 자리의 사전 독음을 덮어쓰므로, 數字가 보통 숫자로 읽히더라도 數字(수자)수자(數字)가 됩니다.

const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.collapseRedundantParens?: boolean | undefined

Whether to collapse redundant parenthetical reading annotations. Defaults to true.

When enabled, an explicit gloss such as 庫間(곳간) or 곳간(庫間) is recognised, the redundant parenthetical is removed, and the annotation is shown in both scripts in every render mode. A parenthetical that pins an alternative reading (for example 數字(수자)) overrides the dictionary reading for that occurrence. A parenthetical that is a definition rather than a reading (for example 庫間(물건을 간직하여 두는 곳)) is left untouched.

collapseRedundantParens
: true }); // 基本
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.collapseRedundantParens?: boolean | undefined

Whether to collapse redundant parenthetical reading annotations. Defaults to true.

When enabled, an explicit gloss such as 庫間(곳간) or 곳간(庫間) is recognised, the redundant parenthetical is removed, and the annotation is shown in both scripts in every render mode. A parenthetical that pins an alternative reading (for example 數字(수자)) overrides the dictionary reading for that occurrence. A parenthetical that is a definition rather than a reading (for example 庫間(물건을 간직하여 두는 곳)) is left untouched.

collapseRedundantParens
: false }); // 그대로 둠

독음 주석은 두 규칙으로 뜻풀이와 구별됩니다. 단어의 독음과 정확히 일치하는 괄호는 늘 합쳐집니다(庫間(곳간) 같은 사이시옷 독음을 포괄합니다). 그렇지 않으면, 대안 독음은 한자 한 글자마다 한글 한 음절이 대응하고 각 음절이 그 글자의 유효한 한국 한자음일 때에만 받아들여집니다(數字(수자)처럼). 뜻풀이 庫間(물건을 간직하여 두는 곳)이나 외래어 음역 蔣介石(장제스)는 두 규칙 어디에도 해당하지 않아 건드리지 않습니다.

동음이의 구별 창

서로 다른 한자어가 같은 한글 독음을 공유할 수 있습니다(예를 들어 연패(連霸)와 연패(連敗)는 둘 다 연패입니다). "hangul-only" 렌더링 모드에서, Gukhanmun은 독자가 그것들을 구별할 수 있도록 그런 단어의 한자를 괄호 안에 유지할 수 있습니다. homophoneWindow는 한 독음이 모호하다고 간주되는 범위를 설정합니다:

동작
"off"구별 추적 안 함
"per-block" (ko-kr의 기본)단락·리스트·헤딩 경계에서 재설정
"per-section"헤딩 경계에서만 재설정
"per-document"입력 전체에 걸쳐 추적
const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.homophoneWindow?: ContextWindow | undefined

Context window for homophone disambiguation. The HomophoneMarker middleware sets homophone = true on annotations whose hangul reading collides within this window. Defaults to "per-block".

@seeContextWindow
homophoneWindow
: "off" });
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.homophoneWindow?: ContextWindow | undefined

Context window for homophone disambiguation. The HomophoneMarker middleware sets homophone = true on annotations whose hangul reading collides within this window. Defaults to "per-block".

@seeContextWindow
homophoneWindow
: "per-block" }); // ko-kr의 基本
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.homophoneWindow?: ContextWindow | undefined

Context window for homophone disambiguation. The HomophoneMarker middleware sets homophone = true on annotations whose hangul reading collides within this window. Defaults to "per-block".

@seeContextWindow
homophoneWindow
: "per-section" });
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.homophoneWindow?: ContextWindow | undefined

Context window for homophone disambiguation. The HomophoneMarker middleware sets homophone = true on annotations whose hangul reading collides within this window. Defaults to "per-block".

@seeContextWindow
homophoneWindow
: "per-document" });

더 넓은 창은 독음이 여러 섹션에 걸쳐 반복되는, 한자 밀도가 높은 텍스트에 적합합니다.

동음이의 탐지 전략

homophoneDetection은 창 안에서 어떤 독음을 모호한 것으로 셀지를 선택합니다:

동작
"context-local" (기본)창 안에 뜻이 다른 동음이의어가 실제로 나타날 때에만 그 단어를 병기합니다.
"dictionary-wide"사전 안 어디서든 다른 한자 형태와 공유되는 독음도 병기합니다.
const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.homophoneDetection?: HomophoneDetection | undefined

Strategy that decides which readings count as homophones needing a hanja gloss. Defaults to "context-local", which glosses a reading only when a different-meaning homophone appears within homophoneWindow . Use "dictionary-wide" to also gloss readings shared by other dictionary entries.

@seeHomophoneDetection
homophoneDetection
: "context-local" }); // 基本
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.homophoneDetection?: HomophoneDetection | undefined

Strategy that decides which readings count as homophones needing a hanja gloss. Defaults to "context-local", which glosses a reading only when a different-meaning homophone appears within homophoneWindow . Use "dictionary-wide" to also gloss readings shared by other dictionary entries.

@seeHomophoneDetection
homophoneDetection
: "dictionary-wide" });

"context-local"은 한글 전용 출력을 깔끔하게 유지합니다: 단어는 주변 텍스트가 그것을 진짜로 모호하게 만들 때에만 병기됩니다. "dictionary-wide"는 더 넓지만, 《표준국어대사전》 같은 큰 참조 사전으로는 거의 모든 흔한 독음에 어떤 동음이의어가 있으므로 대부분의 한자어를 병기하게 됩니다. 문맥과 무관하게 특정 단어를 항상 병기하려면, 대신 requireHanja 지시를 사용합니다(〈사용자 지시〉 참조).

인식된 단어만 구별된다

동음이의 구별은 사전이 단위로 인식하는 단어에 대해 동작합니다. 자체 사전 항목이 없는 한자 연속은 하나의 단어로 다뤄지지 않으며, 그 fallback(비사전) 문자는 결코 병기되지 않습니다; 그 안에 있는, 인식되는 한 글자 항목(예컨대 )은 여전히 따로 처리됩니다. 예를 들어, 《표준국어대사전》이 불러와진 상태에서 自由子游는 둘 다 자유로 읽히는 항목이므로 自由와 子游자유(自由)와 자유(子游)로 렌더링됩니다; 그러나 紫楡는 자체 항목이 없으므로, 기본 context-local 전략에서 自由와 紫楡는 병기 없이 자유와 자유로 렌더링되는데, 이는 엔진이 自由와 충돌할 두 번째 자유 단위를 결코 보지 못하기 때문입니다. 전체 용어를 구별하려면, 그것을 사용자 정의 사전에 추가하여 엔진이 그것을 하나의 단위로 다루게 합니다.

최초 출현 해제 창

켜져 있으면, 최초 출현 해제는 창 안에서 한자의 첫 출현 이후 그 한자의 병기를 멈춥니다. 이는 각 문자를 한 번 소개한 뒤 자유롭게 사용하는 문서에 유용합니다; 후속 출현은 괄호 한자 없이 순수 한글로 남습니다.

동작
"off" (기본)결코 해제 안 함; 모든 출현을 병기
"per-block"같은 단락/블록 안에서 해제
"per-section"같은 섹션 안에서 해제
"per-document"문서 전체에 걸쳐 해제
const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.firstOccurrenceWindow?: ContextWindow | undefined

Context window for first-occurrence filtering. The FirstOccurrenceFilter middleware clears requireHanja / requireHangul on repeated occurrences of the same word within this window, so the gloss appears only the first time. Defaults to "off" (filter disabled) in both presets.

@seeContextWindow
firstOccurrenceWindow
: "off" }); // 基本
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.firstOccurrenceWindow?: ContextWindow | undefined

Context window for first-occurrence filtering. The FirstOccurrenceFilter middleware clears requireHanja / requireHangul on repeated occurrences of the same word within this window, so the gloss appears only the first time. Defaults to "off" (filter disabled) in both presets.

@seeContextWindow
firstOccurrenceWindow
: "per-block" });
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.firstOccurrenceWindow?: ContextWindow | undefined

Context window for first-occurrence filtering. The FirstOccurrenceFilter middleware clears requireHanja / requireHangul on repeated occurrences of the same word within this window, so the gloss appears only the first time. Defaults to "off" (filter disabled) in both presets.

@seeContextWindow
firstOccurrenceWindow
: "per-section" });
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.firstOccurrenceWindow?: ContextWindow | undefined

Context window for first-occurrence filtering. The FirstOccurrenceFilter middleware clears requireHanja / requireHangul on repeated occurrences of the same word within this window, so the gloss appears only the first time. Defaults to "off" (filter disabled) in both presets.

@seeContextWindow
firstOccurrenceWindow
: "per-document" });

오류 복구

recovery는 HTML 파서가 해석할 수 없는 마크업을 만났을 때 무슨 일이 일어날지 제어합니다. 평문 텍스트나 Markdown 입력에는 영향이 없습니다.

const 
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.recovery?: Recovery | undefined

Error recovery policy for HTML scanning. Defaults to "strict". Ignored for non-HTML input formats.

@seeRecovery
recovery
: "strict" }); // 基本: 誤謬 時 던짐
const
const g: Gukhanmun
g
= await
function load(options?: GukhanmunOptions): Promise<Gukhanmun>

Creates a Gukhanmun converter with the given options.

Initialises the WASM module on the first call (subsequent calls reuse the cached module). Dictionaries supplied via GukhanmunOptions.dictionaries are fetched and passed to the Rust engine as FileDictionarySource 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
({
GukhanmunOptions.recovery?: Recovery | undefined

Error recovery policy for HTML scanning. Defaults to "strict". Ignored for non-HTML input formats.

@seeRecovery
recovery
: "lenient" }); // 잘못된 斷片을 건너뜀 (HTML)

단편이나 비표준 마크업을 담을 수 있는 외부 출처의 HTML을 처리할 때는 "lenient"를 사용합니다; 이는 GukhanmunError를 던지는 대신 문제가 되는 부분을 건너뜁니다.