LinuxSpellChecker

Linux implementation of NativeSpellChecker using Hunspell.

Hunspell is the most widely used spell checker on Linux systems. It's used by LibreOffice, Firefox, Chrome, and many other applications.

Dictionary files are searched in standard locations:

  • /usr/share/hunspell/

  • /usr/share/myspell/

  • ~/.local/share/hunspell/

User dictionaries are stored in ~/.local/share/hunspell/{lang}_user.dic

Reference: https://github.com/hunspell/hunspell

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val languageTag: String

The language tag this spell checker was created for (e.g., "en-US").

Functions

Link copied to clipboard
open override fun addToDictionary(word: String)

Adds a word to the user dictionary.

Link copied to clipboard
open override fun checkText(text: String): List<SpellingError>

Checks the spelling of the provided text.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun getSuggestions(word: String): List<String>

Gets spelling suggestions for a misspelled word.

Link copied to clipboard
open override fun ignoreWord(word: String)

Ignores a word for this session.

Link copied to clipboard
open override fun isWordCorrect(word: String): Boolean

Checks if a single word is spelled correctly.

Link copied to clipboard
open override fun removeFromDictionary(word: String)

Removes a word previously added via addToDictionary. Best-effort: platforms whose native API does not expose a remove operation should log a warning and no-op.