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, and this page is available as Markdown at https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.MapDictionarySource.md.

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 by the presence of an entries property.

Example

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[]

The entries of this dictionary.

Repeated hanja keys append competing readings instead of replacing each other, and DictionaryEntry.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

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