HunspellWrapper

Wrapper around the Hunspell library providing a cleaner Kotlin API.

Handles:

  • Dictionary file discovery from standard system paths

  • User dictionary support (~/.local/share/hunspell/)

  • Proper encoding handling

  • Resource cleanup

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Adds a word to the user's personal dictionary. The word is persisted to disk and will be available in future sessions.

Link copied to clipboard
fun addWord(word: String)

Adds a word to the runtime dictionary. The word is remembered for this session only.

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun getSuggestions(word: String, maxSuggestions: Int = 10): List<String>

Gets spelling suggestions for a misspelled word.

Link copied to clipboard
fun ignoreWord(word: String)

Ignores a word for this session.

Link copied to clipboard

Checks if a word is spelled correctly.

Link copied to clipboard

Removes a word from the user's personal dictionary, both at runtime and from the persisted user-dictionary file. No-op if the word was not in the file.

Link copied to clipboard
fun removeWord(word: String)

Removes a word from the runtime dictionary.