Skip to main content

WordChecker

Trait WordChecker 

Source
pub trait WordChecker: Send + Sync {
    // Required methods
    fn check(&self, word: &str) -> bool;
    fn suggest(&self, word: &str, limit: usize) -> Vec<String>;
}
Expand description

A word checker that can verify spelling and suggest corrections.

This trait abstracts the dictionary implementation, allowing different backends (spellbook, hunspell, embedded, mock, etc.).

Required Methods§

Source

fn check(&self, word: &str) -> bool

Check if a word is spelled correctly.

Source

fn suggest(&self, word: &str, limit: usize) -> Vec<String>

Get spelling suggestions for a misspelled word. Returns up to limit suggestions.

Implementors§