WindowsSpellChecker

High-level wrapper for the Windows Spell Checking API.

This class provides a Kotlin-friendly interface to the Windows native spell checker, which is available on Windows 8 and later.

Usage:

val spellChecker = WindowsSpellChecker.create("en-US")
if (spellChecker != null) {
val errors = spellChecker.checkText("Helllo world")
spellChecker.close()
}

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)

No-op on Windows: the basic ISpellChecker VTable does not expose a remove operation. Removal would require ISpellChecker2 (Windows 8.1+), which is not currently bound. Logs a warning so callers know the request was dropped.