EditorSpellChecker

A platform-agnostic spell checker interface used by the editor.

Inheritors

Types

Link copied to clipboard

Desired evaluation scope for suggestions.

Functions

Link copied to clipboard
open suspend fun checkSentence(sentence: String, sentenceRange: TextEditorRange): List<Correction>

Check a sentence for spelling errors that may span multiple words.

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

Fast correctness check for a single lexical token (word).

Link copied to clipboard
abstract suspend fun suggestions(input: String, scope: EditorSpellChecker.Scope = Scope.Word, closestOnly: Boolean = true): List<Suggestion>

Suggestions for the given input. If scope == Word, input is a single token. If scope == Sentence, implementations may return suggestions that include whitespace (e.g., "in the"). Implementations that can't do sentence-level can ignore it or approximate.