> For AI agents: the complete documentation index is available at https://canary.gukhanmun.org/llms.txt, the full documentation bundle is available at https://canary.gukhanmun.org/llms-full.txt.

# Interface: GukhanmunOptions

Full set of options passed to [GukhanmunFactory.load](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_napi.GukhanmunFactory.md#load) (or the
top-level `load` function) to configure a [Gukhanmun](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_napi.Gukhanmun.md) instance.

All fields are optional.  When a `preset` is specified it supplies
defaults; individual fields override those defaults.  When no preset is
given, `"ko-kr"` is implicitly used.

## Properties

### annotationGranularity?

> `readonly` `optional` **annotationGranularity?**: [`AnnotationGranularity`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.AnnotationGranularity.md)

Where to attach glosses, independent of `rendering`. Defaults to `"word"`.

***

### collapseRedundantParens?

> `readonly` `optional` **collapseRedundantParens?**: `boolean`

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.

***

### dictionaries?

> `readonly` `optional` **dictionaries?**: readonly [`DictionarySource`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.DictionarySource.md)\[]

Dictionary sources in stable registration order. Roles and `sourcePolicy`
determine precedence; `"ordered"` restores first-match ordering. 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. For NIKL loanword examples, load
`@gukhanmun/loanwords-fst` or `@gukhanmun/loanwords-cdb`. Put user
dictionaries first for stable override precedence. Cooperative reference
and loanword sources use the selected source policy.

Entries computed at runtime need no package and no `gukhanmun-mkdict` run:
pass [MapDictionarySource](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_napi.MapDictionarySource.md) (`{ entries: [...] }`) at the position
where those overrides should take precedence.

#### See

[DictionarySource](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.DictionarySource.md)

***

### directives?

> `readonly` `optional` **directives?**: [`Directives`](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_napi.Directives.md)

Per-hanja rendering directives that override dictionary marks.

#### See

[Directives](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_napi.Directives.md)

***

### firstOccurrenceWindow?

> `readonly` `optional` **firstOccurrenceWindow?**: [`ContextWindow`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.ContextWindow.md)

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.

#### See

[ContextWindow](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.ContextWindow.md)

***

### hanjaVariantSet?

> `readonly` `optional` **hanjaVariantSet?**: [`HanjaVariantSet`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.HanjaVariantSet.md)

The hanja variant set. Defaults to `"as-dictionary"`.

***

### homophoneDetection?

> `readonly` `optional` **homophoneDetection?**: [`HomophoneDetection`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.HomophoneDetection.md)

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](#homophonewindow).  Use
`"dictionary-wide"` to also gloss readings shared by other dictionary
entries.

#### See

[HomophoneDetection](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.HomophoneDetection.md)

***

### homophoneWindow?

> `readonly` `optional` **homophoneWindow?**: [`ContextWindow`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.ContextWindow.md)

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

#### See

[ContextWindow](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.ContextWindow.md)

***

### html?

> `readonly` `optional` **html?**: [`HtmlOptions`](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_napi.HtmlOptions.md)

HTML-specific preservation rules.  Ignored for non-HTML input formats.

#### See

[HtmlOptions](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_napi.HtmlOptions.md)

***

### ignoreDictionaryRequiredHanja?

> `readonly` `optional` **ignoreDictionaryRequiredHanja?**: `boolean`

Omit hanja glosses required only by a dictionary in `"hangul-only"` mode.
Defaults to `false`. Homophone glosses and explicit annotations remain.

***

### initialSoundLaw?

> `readonly` `optional` **initialSoundLaw?**: `boolean`

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.

***

### numerals?

> `readonly` `optional` **numerals?**: [`NumeralStrategy`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.NumeralStrategy.md)

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

#### See

[NumeralStrategy](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.NumeralStrategy.md)

***

### originalGloss?

> `readonly` `optional` **originalGloss?**: [`OriginalGloss`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.OriginalGloss.md)

How glosses are rendered when `rendering` is `"original"`.  Ignored for
all other render modes.  Defaults to `"parens"`.

#### See

[OriginalGloss](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.OriginalGloss.md)

***

### preset?

> `readonly` `optional` **preset?**: [`Preset`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.Preset.md)

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

#### See

[Preset](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.Preset.md)

***

### punctuation?

> `readonly` `optional` **punctuation?**: [`PunctuationPreset`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.PunctuationPreset.md) | [`CustomPunctuationProfile`](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_napi.CustomPunctuationProfile.md)

Independent output punctuation policy. Defaults to preserve.

***

### recovery?

> `readonly` `optional` **recovery?**: [`Recovery`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.Recovery.md)

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

#### See

[Recovery](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.Recovery.md)

***

### referenceOnly?

> `readonly` `optional` **referenceOnly?**: `boolean`

Excludes independent loanword choices while retaining reference-authorized
realizations. Defaults to false; ignored by the `"ordered"` policy.

***

### rendering?

> `readonly` `optional` **rendering?**: [`RenderMode`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.RenderMode.md)

How annotations are rendered into output text or markup.  Defaults to
`"hangul-only"`.

#### See

[RenderMode](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.RenderMode.md)

***

### segmentation?

> `readonly` `optional` **segmentation?**: [`Segmentation`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.Segmentation.md)

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

#### See

[Segmentation](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.Segmentation.md)

***

### sourcePolicy?

> `readonly` `optional` **sourcePolicy?**: [`SourcePolicy`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_napi.SourcePolicy.md)

Source cooperation policy. Defaults to `"reference-authorized"`.
