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 presence of a format property ("format" in source).
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 for future use; passing it throws
GukhanmunError with code "unsupported-content-type".