SymSpellKtFdic

The bridge between SymSpellKt and the Fdic binary dictionary format. It adds loadFdicFile extensions on DictionaryHolder so you can populate a spell checker's dictionary directly from a .fdic file — smaller and faster to load than plain text.

val settings = SpellCheckSettings()
val dictionary = InMemoryDictionaryHolder(settings, Murmur3HashFunction())

// From a file path…
dictionary.loadFdicFile("en.fdic".toPath())

// …or from bytes you've already loaded (e.g. a bundled resource).
dictionary.loadFdicFile(fdicBytes)

val symSpell = SymSpell(settings, DamerauLevenshteinDistance(), dictionary)

Both overloads are suspend. Produce .fdic files from plain-text frequency dictionaries with the FdicCli tool.

Packages

Link copied to clipboard
common

The DictionaryHolder.loadFdicFile extensions (okio Path and ByteArray).