NativeSpellChecker

Common interface for native spell checkers across different operating systems.

Implementations:

  • Windows: Uses the Windows Spell Checking API (Windows 8+)

  • macOS: Will use NSSpellChecker (to be implemented)

  • Linux: Will use Hunspell or similar (to be implemented)

Inheritors

Properties

Link copied to clipboard
abstract val languageTag: String

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

Functions

Link copied to clipboard
abstract fun addToDictionary(word: String)

Adds a word to the user dictionary.

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

Checks the spelling of the provided text.

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

Gets spelling suggestions for a misspelled word.

Link copied to clipboard
abstract fun ignoreWord(word: String)

Ignores a word for this session.

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

Checks if a single word is spelled correctly.

Link copied to clipboard
abstract 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.