Struct fast_symspell::SymSpell[][src]

pub struct SymSpell<T: StringStrategy> { /* fields omitted */ }

Implementations

Load multiple dictionary entries from a file of word/frequency count pairs.

Arguments
  • corpus - The path+filename of the file.
  • term_index - The column position of the word.
  • count_index - The column position of the frequency count.
  • separator - Separator between word and frequency

Load single dictionary entry from word/frequency count pair.

Arguments
  • line - word/frequency pair.
  • term_index - The column position of the word.
  • count_index - The column position of the frequency count.
  • separator - Separator between word and frequency

Load multiple bigram entries from a file of bigram/frequency count pairs.

Arguments
  • corpus - The path+filename of the file.
  • term_index - The column position of the word.
  • count_index - The column position of the frequency count.
  • separator - Separator between word and frequency

Load single dictionary entry from bigram/frequency count pair.

Arguments
  • line - bigram/frequency pair.
  • term_index - The column position of the word.
  • count_index - The column position of the frequency count.
  • separator - Separator between word and frequency

Find frequency of a word in the dictionary

Find suggested spellings for a given input word, using the maximum edit distance specified during construction of the SymSpell dictionary.

Arguments
  • input - The word being spell checked.
  • verbosity - The value controlling the quantity/closeness of the retuned suggestions.
  • max_edit_distance - The maximum edit distance between input and suggested words.
Examples
use symspell::{SymSpell, AsciiStringStrategy, Verbosity};

let mut symspell: SymSpell<AsciiStringStrategy> = SymSpell::default();
symspell.load_dictionary("data/frequency_dictionary_en_82_765.txt", 0, 1, " ");
symspell.lookup("whatver", Verbosity::Top, 2);

Find suggested spellings for a given input sentence, using the maximum edit distance specified during construction of the SymSpell dictionary.

Arguments
  • input - The sentence being spell checked.
  • max_edit_distance - The maximum edit distance between input and suggested words.
Examples
use symspell::{SymSpell, AsciiStringStrategy};

let mut symspell: SymSpell<AsciiStringStrategy> = SymSpell::default();
symspell.load_dictionary("data/frequency_dictionary_en_82_765.txt", 0, 1, " ");
symspell.lookup_compound("whereis th elove", 2);

Divides a string into words by inserting missing spaces at the appropriate positions

Arguments
  • input - The word being segmented.
  • max_edit_distance - The maximum edit distance between input and suggested words.
Examples
use symspell::{SymSpell, UnicodeStringStrategy, Verbosity};

let mut symspell: SymSpell<UnicodeStringStrategy> = SymSpell::default();
symspell.load_dictionary("data/frequency_dictionary_en_82_765.txt", 0, 1, " ");
symspell.word_segmentation("itwas", 2);

pub fn create_dictionary_entry(&mut self, key: String, count: i64) -> bool

create dictionary entry with a word and its count

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.