Skip to content

Commit

Permalink
fix(dict): Prefer correcting alingment to alignment
Browse files Browse the repository at this point in the history
Fixes #1143
  • Loading branch information
epage committed Nov 5, 2024
1 parent 5998867 commit 5afabf7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/typos-dict/assets/words.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2452,8 +2452,8 @@ alimunium,aluminium
aling,aline,along,ailing,sling
alinged,alined
alinging,aligning
alingment,alinement
alingments,alinements
alingment,alignment
alingments,alignments
alings,alines,slings
alinment,alignment
alinments,alignments
Expand Down
4 changes: 2 additions & 2 deletions crates/typos-dict/src/word_codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225440,8 +225440,8 @@ pub static WORD_ALI_CHILDREN: dictgen::DictTable<&'static [&'static str]> = dict
&["aline", "along", "ailing", "sling"],
&["alined"],
&["aligning"],
&["alinement"],
&["alinements"],
&["alignment"],
&["alignments"],
&["alines", "slings"],
&["alignment"],
&["alignments"],
Expand Down
2 changes: 1 addition & 1 deletion crates/typos-dict/tests/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fn find_best_match<'c>(
#[allow(clippy::single_match)]
match (typo, correction) {
// Picking the worst option due to a letter swap being an edit distance of two
("alinging", "aligning") => {
("alinging", "aligning") | ("alingment", "alignment") | ("alingments", "alignments") => {
return None;
}
_ => {}
Expand Down

0 comments on commit 5afabf7

Please sign in to comment.