> 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: MapDictionarySource

A dictionary built from entries computed at runtime, such as per-document
reading overrides.

Use this instead of compiling a TSV file with `gukhanmun-mkdict` when the
entries do not exist on disk, for example in a browser, an edge runtime, or a
site generator that derives entries per document.

A source is distinguished from a [FileDictionarySource](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.FileDictionarySource.md) by the presence
of an `entries` property.

## Example

```ts
import { stdictFst } from "@gukhanmun/stdict-fst";
const g = await load({
  dictionaries: [
    {
      entries: [
        { hanja: "高橋", reading: "다카하시" },
        { hanja: "東京", reading: "도쿄", preference: 10 },
        { hanja: "年代", reading: "연대", suffixReading: "년대" },
      ],
    },
    await stdictFst(),
  ],
});
```

## Properties

### entries

> `readonly` **entries**: readonly [`DictionaryEntry`](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.DictionaryEntry.md)\[]

The entries of this dictionary.

Repeated `hanja` keys append competing readings instead of replacing each
other, and [DictionaryEntry.preference](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.DictionaryEntry.md#preference) decides which reading is the
context-free default.  Several readings for one key also let the engine
pick a reading from a following particle (`東京을` versus `東京를`).

An empty list contributes nothing, which is a convenient way to express
"this document has no overrides".

***

### role?

> `readonly` `optional` **role?**: [`SourceRole`](https://canary.gukhanmun.org/api/js/types/_gukhanmun_types.SourceRole.md)

Defaults to an authored override; set a role to opt into cooperation.
