Skip to content

Commit

Permalink
this one trick to avoid doubling edge penalties
Browse files Browse the repository at this point in the history
  • Loading branch information
flammie committed Nov 11, 2024
1 parent aeac1f4 commit 18dcf7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions divvunspell/src/speller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ where
for sugg in suggestions.into_iter() {
let penalty_start =
if !sugg.value().starts_with(word.chars().next().unwrap()) {
reweight.start_penalty
reweight.start_penalty - reweight.mid_penalty
} else {
0.0
};
let penalty_end =
if !sugg.value().ends_with(word.chars().rev().next().unwrap()) {
reweight.end_penalty
reweight.end_penalty - reweight.mid_penalty
} else {
0.0
};
Expand Down

0 comments on commit 18dcf7f

Please sign in to comment.