Skip to content

Commit

Permalink
Prioritized longer words in spellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Jan 23, 2024
1 parent c106baf commit 2bbab4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion harper-core/src/linting/spell_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ impl Linter for SpellCheck {
continue;
}

let possibilities = suggest_correct_spelling(word_chars, 3, 3, &self.dictionary);
let mut possibilities = suggest_correct_spelling(word_chars, 10, 3, &self.dictionary);

// People more likely to misspell words by omission, so show the longest words first.
possibilities.sort_by_key(|p| usize::MAX - p.len());

let suggestions = possibilities
.into_iter()
Expand Down

0 comments on commit 2bbab4c

Please sign in to comment.