fix: resolve #3362 — suggest although as a replacement for the typo athough#3431
Open
chinhkrb113 wants to merge 2 commits into
Open
Conversation
…r the typo `athough` Fixes Automattic#3362 Signed-off-by: ChinhLee <76194645+chinhkrb113@users.noreply.github.com>
…r the typo `athough` Fixes Automattic#3362 Signed-off-by: ChinhLee <76194645+chinhkrb113@users.noreply.github.com>
hippietrail
reviewed
May 19, 2026
| for word in document.iter_words() { | ||
| let word_chars = document.get_span_content(&word.span); | ||
|
|
||
| if is_informal_laughter(word_chars) { |
Collaborator
There was a problem hiding this comment.
This doesn't seem related to spelling or "although" and I'm sure I saw it in your other PR? Cross-contamination?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The core issue is in the spell-checking logic. When "athough" is encountered, the spell checker should suggest "although" since it's only one character insertion away (edit distance 1). The spell checker may be deferring to a word-splitting approach that produces "a though" without also considering single-word corrections like "although". The spell check logic needs to either prioritize or include close single-word matches even when a valid split exists
Fixes #3362
Changes
harper-core/src/linting/spell_check.rsharper-core/src/linting/spell_check.rsWhy
harper-core/src/linting/spell_check.rs: The core issue is in the spell-checking logic. When "athough" is encountered, the spell checker should suggest "although" since it's only one character insertion away (edit distance 1). The spell checker may be deferring to a word-splitting approach that produces "a though" without also considering single-word corrections like "although". The spell check logic needs to either prioritize or include close single-word matches even when a valid split exists.