Struct ispell::SpellLauncher
[−]
[src]
pub struct SpellLauncher { /* fields omitted */ }
Spell Launcher wizard (ah, ah).
Runs ispell
or one of its variant for you.
Examples
- Launches
ispell
withbritish
dictionary:
use ispell::SpellLauncher; let checker = SpellLauncher::new() .dictionary("british") .launch() .unwrap();Run
- Launches
aspell
with french (France) language:
use ispell::SpellLauncher; let checker = SpellLauncher::new() .aspell(true) .language("fr_FR") .launch() .unwrap();Run
Methods
impl SpellLauncher
[src]
fn new() -> SpellLauncher
Creates a new spell checker with default options
fn aspell(&mut self, b: bool) -> &mut SpellLauncher
If true, sets compatibility mode to aspell instead of ispell.
fn command<S: Into<String>>(&mut self, command: S) -> &mut SpellLauncher
Set the name of the command to run
By default, it is "ispell", or "aspell" if the aspell
flag has been set.
fn dictionary<S: Into<String>>(&mut self, dict: S) -> &mut SpellLauncher
Set the dictionary that should be used
Example
use ispell::SpellLauncher; let checker = SpellLauncher::new() .dictionary("american") .launch() .unwrap();Run
fn language<S: Into<String>>(&mut self, lang: S) -> &mut SpellLauncher
Set the language option for aspell.
Used only if the aspell
flag has been set, else use dictionary
. (Avoid mixing the two.)
Example
use ispell::SpellLauncher; let checker = SpellLauncher::new() .aspell(true) .language("en_GB") .launch() .unwrap();Run
fn launch(&self) -> Result<SpellChecker>
Launch ispell
(or aspell
) and return a SpellChecker