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_napi.FileDictionarySource.md.

Interface: FileDictionarySource

Specifies a dictionary loaded from a binary file or URL.

The data field accepts:

  • A BufferSource (ArrayBuffer or ArrayBufferView) — supported in all environments.
  • A URL — resolved via fetch in browsers; via node:fs/promises in Node.js, Deno 2.0+, and Bun.
  • A string — treated as a filesystem path; supported in Node.js, Deno 2.0+, and Bun only. Throws in browser environments.

At runtime, a FileDictionarySource is distinguished from other values by the absence of an entries property ("entries" in source selects a MapDictionarySource).

Properties

data

readonly data: string | URL | ArrayBuffer | ArrayBufferView<ArrayBufferLike>

The binary dictionary data or a reference to where it can be loaded.

Pass a BufferSource for data already in memory, a URL for a remote or local URL (resolved via fetch or readFile), or a path string for filesystem paths (Node.js / Deno 2.0+ / Bun only).


format

readonly format: "fst" | "cdb"

The on-disk format of the dictionary file.

  • "fst" — Gukhanmun FST file (*.gukfst); preferred for small WebAssembly bundles. Supported in all runtimes.
  • "cdb" — Gukhanmun CDB-trie file (*.gukcdb); preferred when code auditability or trivial mmap support matters. Requires a filesystem or in-memory bytes; supported in Node-API and (with from_bytes) in WASM builds that include the cdb feature.

The "tsv" format is reserved and never accepted. Pass entries in memory through MapDictionarySource instead of compiling a table.


role?

readonly optional role?: SourceRole

Explicit source role, overriding the binary's evidence metadata. If neither supplies a role, the file is treated as an authored override. File names never determine roles. Official dictionary helpers supply their source role.