pub struct Engine {
pub word_regex: Regex,
pub config_file: PathBuf,
pub global_ignore_file: PathBuf,
pub config: Config,
pub local_ignored_words: HashSet<String>,
pub global_ignored_words: HashSet<String>,
/* private fields */
}Fields§
§word_regex: Regex§config_file: PathBuf§global_ignore_file: PathBuf§config: Config§local_ignored_words: HashSet<String>§global_ignored_words: HashSet<String>Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new(path: &Path) -> Result<Self, OwlError>
pub fn new(path: &Path) -> Result<Self, OwlError>
Instantiate owl engine for checking words with ignores.
Sourcepub fn get_misspelled(&self, path: &str) -> Result<Vec<WordBad>, OwlError>
pub fn get_misspelled(&self, path: &str) -> Result<Vec<WordBad>, OwlError>
Run spellcheck on file, returning WordBad per match.
Return values are not deduped yet.
pub fn get_misspelled_from_lines( &self, lines: &[String], filename: &str, ) -> Vec<WordBad>
pub fn add_global_ignore(&mut self, word: &str) -> Result<(), OwlError>
pub fn delete_global_ignore(&mut self, word: &str) -> Result<(), OwlError>
pub fn add_local_ignore(&mut self, word: &str) -> Result<(), OwlError>
pub fn delete_local_ignore(&mut self, word: &str) -> Result<(), OwlError>
Sourcepub fn get_ignore_status(&self, word: &str) -> Status
pub fn get_ignore_status(&self, word: &str) -> Status
Check if a word is ignored.
Sourcepub fn suggest(&self, word: &str, suggestions: &mut Vec<String>)
pub fn suggest(&self, word: &str, suggestions: &mut Vec<String>)
Make suggestions using underlying library.
TODO: incorporate ignores?
pub fn check(&self, word: &str) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
impl UnwindSafe for Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more