#변환 옵션
이들을 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 | undefinedNamed configuration preset. Defaults to "ko-kr".
@seePreset preset : "ko-kp", GukhanmunOptions.dictionaries?: readonly FileDictionarySource[] | undefinedOrdered 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 stdict).
Unlike the "ko-kr" Rust preset, JavaScript presets do not
automatically include a bundled dictionary. To use the Standard Korean
Language Dictionary, add @gukhanmun/stdict-fst or
@gukhanmun/stdict-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 | undefinedHanja-span segmentation algorithm. Defaults to "lattice".
@seeSegmentation segmentation : "lattice", // 基本: 最適, 動的 計劃法
// segmentation: "eager", // 貪慾, 더 빠르지만 덜 正確
});정확도보다 처리량이 더 중요할 때에만 "eager"를 선호합니다.
#수사 처리
numerals는 이공일륙 같은 한자 수사 문자를 렌더링하는 방식을 제어합니다.
한자식 수사는 위치를 담느냐 수량을 담느냐에 따라 수를 여러 방식으로 나타낼 수
있습니다:
| 값 | 이공일륙년 | 십일월 | 일천이백삼십사 |
|---|---|---|---|
"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 | undefinedHow 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 | undefinedHow 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 | undefinedHow 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 | undefinedHow 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 | undefinedWhether 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 | undefinedWhether 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" 프리셋)이나 북조선 철자 관행을 따르는 텍스트를 처리할
때는 이를 끕니다.
#동음이의 구별 창
서로 다른 한자어가 같은 한글 독음을 공유할 수 있습니다(예를 들어 연패(連霸)와
연패(連敗)는 둘 다 연패입니다). "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 | undefinedContext 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 | undefinedContext 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 | undefinedContext 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 | undefinedContext 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 | undefinedStrategy 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 | undefinedStrategy 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 | undefinedContext 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 | undefinedContext 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 | undefinedContext 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 | undefinedContext 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 | undefinedError 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 | undefinedError recovery policy for HTML scanning. Defaults to "strict".
Ignored for non-HTML input formats.
@seeRecovery recovery : "lenient" }); // 잘못된 斷片을 건너뜀 (HTML)단편이나 비표준 마크업을 담을 수 있는 외부 출처의 HTML을 처리할 때는
"lenient"를 사용합니다; 이는 GukhanmunError를 던지는 대신 문제가 되는
부분을 건너뜁니다.