Struct ranagrams::util::Translator [−][src]
A Translator
converts between alphabetic and numeric representations of
words. For anagram calculation words are treated as pure numeric sequences.
The translator converts back and forth and also keeps track of character
frequences in order to produce a dense trie representation of a word list.
Fields
normalizer: fn(_: &str) -> String
Methods
impl Translator
[src]
impl Translator
pub fn new<'a, I: Iterator<Item = &'a str>>(
normalizer: fn(_: &str) -> String,
i: I
) -> Translator
[src]
pub fn new<'a, I: Iterator<Item = &'a str>>(
normalizer: fn(_: &str) -> String,
i: I
) -> Translator
pub fn alphabet_size(&self) -> usize
[src]
pub fn alphabet_size(&self) -> usize
pub fn count(&self, word: &str) -> Option<CharCount>
[src]
pub fn count(&self, word: &str) -> Option<CharCount>
pub fn snrt(&self, i: &usize) -> Option<&char>
[src]
pub fn snrt(&self, i: &usize) -> Option<&char>
pub fn etalsnart(&self, ints: &[usize]) -> Option<String>
[src]
pub fn etalsnart(&self, ints: &[usize]) -> Option<String>
pub fn translate(&self, word: &str) -> Option<Vec<usize>>
[src]
pub fn translate(&self, word: &str) -> Option<Vec<usize>>
pub fn unfamiliar_character(&self, word: &str) -> (String, String)
[src]
pub fn unfamiliar_character(&self, word: &str) -> (String, String)
for construction of an error message when translate fails
Auto Trait Implementations
impl Send for Translator
impl Send for Translator
impl Sync for Translator
impl Sync for Translator