Interface: FileDictionarySource
Specifies a dictionary loaded from a binary file or URL.
The data field accepts:
- A
BufferSource(ArrayBufferorArrayBufferView) — supported in all environments. - A
URL— resolved viafetchin browsers; vianode:fs/promisesin 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
readonlydata: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
readonlyformat:"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 (withfrom_bytes) in WASM builds that include thecdbfeature.
The "tsv" format is reserved and never accepted. Pass entries in memory
through MapDictionarySource instead of compiling a table.
role?
readonlyoptionalrole?: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.