diff --git a/divvunspell/src/speller/mod.rs b/divvunspell/src/speller/mod.rs index 5a93f93..d1638f4 100644 --- a/divvunspell/src/speller/mod.rs +++ b/divvunspell/src/speller/mod.rs @@ -5,6 +5,7 @@ use hashbrown::HashMap; use serde::{Deserialize, Serialize}; use smol_str::SmolStr; use unic_ucd_category::GeneralCategory; +use unic_segment::Graphemes; use self::worker::SpellerWorker; use crate::speller::suggestion::Suggestion; @@ -12,6 +13,7 @@ use crate::tokenizer::case_handling::CaseHandler; use crate::transducer::Transducer; use crate::types::{SymbolNumber, Weight}; + pub mod suggestion; mod worker; @@ -172,7 +174,8 @@ where let alphabet = self.mutator().alphabet(); let key_table = alphabet.key_table(); - word.chars() + log::trace!("to_input_vec: {}", word); + Graphemes::new(word) .map(|ch| { let s = ch.to_string(); key_table diff --git a/divvunspell/src/speller/worker.rs b/divvunspell/src/speller/worker.rs index cb9b90e..3086c88 100644 --- a/divvunspell/src/speller/worker.rs +++ b/divvunspell/src/speller/worker.rs @@ -399,7 +399,7 @@ where let input_sym = alphabet_translator[self.input[input_state as usize] as usize]; let next_lexicon_state = next_node.lexicon_state + 1; - log::trace!("lexicon consuming {}?", + log::trace!("lexicon consuming {}: {}", input_sym, self.speller.lexicon.alphabet().string_from_symbols(&[input_sym])); if !lexicon.has_transitions(next_lexicon_state, Some(input_sym)) {