Skip to main content

Module spellcheck

Module spellcheck 

Source
Expand description

Spellcheck analysis for Lex documents.

This module provides the core spellchecking logic, decoupled from dictionary loading. Consumers provide a DictionaryProvider implementation to handle dictionary source (filesystem, embedded, etc.).

§Architecture

The spellcheck system is split into two parts:

  • Core logic (this module): Traverses documents, extracts words, checks spelling
  • Dictionary provider (consumer-provided): Loads and caches dictionaries

This design allows the same checking logic to work in:

  • Native LSP (filesystem-based dictionaries)
  • WASM (embedded dictionaries)
  • Tests (mock dictionaries)

Structs§

SpellcheckResult
Result of checking a document for spelling errors.

Traits§

WordChecker
A word checker that can verify spelling and suggest corrections.

Functions§

check_document
Check a document for spelling errors using the provided word checker.
suggest_corrections
Get spelling suggestions for a word.