1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#[derive(Clone, Debug)] /// Config for FuzzyTrie /// /// It is used to provide different /// Levenshtein configs depending on the length pub struct Config { /// Default config for searches that /// do not match other cases pub default: LevenshteinConfig, /// Pairs of (`config`, `len`) /// `len` is the max length of key that `config` will be applied to. /// /// If the explanation is chaotic /// then see the `choose_dfa_builder` method on `FuzzyTrie` /// for additional information pub other: Vec<(LevenshteinConfig, usize)>, } /// Config for Levenstein automata #[derive(Copy, Clone, Debug)] pub struct LevenshteinConfig { /// Max distance pub distance: u8, /// Indicates whether it Damerau–Levenshtein or not pub damerau: bool, }