diff --git a/asklyphe-frontend/src/spellcheck.rs b/asklyphe-frontend/src/spellcheck.rs index aa5b58d..5f481c3 100644 --- a/asklyphe-frontend/src/spellcheck.rs +++ b/asklyphe-frontend/src/spellcheck.rs @@ -94,6 +94,7 @@ pub fn check(query: &String) -> Option { if closest_match.1 <= MAX_DISTANCE { cache.insert(qword.to_owned(), Some(*closest_match.0)); + distances.push(SpellCheckResult{orig: qword.to_owned(), correction: *closest_match.0}); } else { // even though there is no close enough match, cache it anyway so that it doesn't have to be looked up every time cache.insert(qword.to_owned(), None);