Skip to content

Commit

Permalink
rebuild cache every lookup?
Browse files Browse the repository at this point in the history
  • Loading branch information
flammie committed Jan 21, 2022
1 parent a8d7789 commit f876434
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ospell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ CorrectionQueue Speller::correct(char * line, int nbest,
// A placeholding map, only one weight per correction
std::map<std::string, Weight> corrections;
SymbolNumber first_input = (input.size() == 0) ? 0 : input[0];
if (false) { // if (cache[first_input].empty) {
if (cache[first_input].empty) {
build_cache(first_input); // XXX: cache corrupts limit!
}
if (input.size() <= 1) {
Expand Down Expand Up @@ -1008,6 +1008,7 @@ CorrectionQueue Speller::correct(char * line, int nbest,
}
}
}
cache[first_input].clear();
return correction_queue;
}

Expand Down

0 comments on commit f876434

Please sign in to comment.