Skip to content

Commit

Permalink
some debugging cant hurt
Browse files Browse the repository at this point in the history
  • Loading branch information
flammie committed May 30, 2024
1 parent 3cebb20 commit 10946b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion divvunspell/src/speller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ where
} else {
vec![]
};

log::debug!("is_correct_with_config: ‘{}’ ~ {:?}?; config: {:?}",
word, words, config);
for word in std::iter::once(word.into()).chain(words.into_iter()) {
let worker = SpellerWorker::new(self.clone(), self.to_input_vec(&word), config.clone());

Expand Down
4 changes: 3 additions & 1 deletion divvunspell/src/speller/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ 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 {}?",
// self.speller.lexicon.alphabet().string_from_symbols(&[input_sym]));

if !lexicon.has_transitions(next_lexicon_state, Some(input_sym)) {
// we have no regular transitions for this
Expand Down Expand Up @@ -486,7 +488,7 @@ where
// let max_weight = speller_max_weight(&self.config);
let pool = Pool::with_size_and_max(0, 0);
let mut nodes = speller_start_node(&pool, self.state_size() as usize);

log::trace!("beginning is_correct {:?}?", self.input);
while let Some(next_node) = nodes.pop() {
if next_node.input_state as usize == self.input.len()
&& self.speller.lexicon().is_final(next_node.lexicon_state)
Expand Down

0 comments on commit 10946b0

Please sign in to comment.