From c66e404dc1968a110e03b9bee471eaba21fece1e Mon Sep 17 00:00:00 2001 From: Elijah Potter Date: Mon, 30 Jun 2025 09:28:52 -0600 Subject: [PATCH] fix(core): ensure `hes` is corrected properly --- harper-core/dictionary.dict | 2 +- harper-core/src/linting/spell_check.rs | 18 ++++++++++++++++++ .../text/linters/Computer science.snap.yml | 4 ++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict index 1ec08355..42b3081b 100644 --- a/harper-core/dictionary.dict +++ b/harper-core/dictionary.dict @@ -27163,7 +27163,7 @@ gyrofrequency/NgS gyroscope/NgS gyroscopic/J gyve/NVgGdS -h/~NVJnSXZGvz # removed `>` 'her' is not comparative of 'h' +h/~NVJnXZGvz # removed `>` 'her' is not comparative of 'h' h'm/ ha/~ haberdasher/NSg diff --git a/harper-core/src/linting/spell_check.rs b/harper-core/src/linting/spell_check.rs index 3625f408..a963ed11 100644 --- a/harper-core/src/linting/spell_check.rs +++ b/harper-core/src/linting/spell_check.rs @@ -387,4 +387,22 @@ mod tests { 0, ); } + + #[test] + fn corrects_hes() { + assert_suggestion_result( + "hes", + SpellCheck::new(FstDictionary::curated(), Dialect::British), + "he's", + ); + } + + #[test] + fn corrects_shes() { + assert_suggestion_result( + "shes", + SpellCheck::new(FstDictionary::curated(), Dialect::British), + "she's", + ); + } } diff --git a/harper-core/tests/text/linters/Computer science.snap.yml b/harper-core/tests/text/linters/Computer science.snap.yml index bb1c97b4..30cd1a4f 100644 --- a/harper-core/tests/text/linters/Computer science.snap.yml +++ b/harper-core/tests/text/linters/Computer science.snap.yml @@ -773,8 +773,8 @@ Message: | 216 | that they are theory, abstraction (modeling), and design. Amnon H. Eden | ^~ Did you mean to spell `H.` this way? Suggest: - - Replace with: “Hi” - - Replace with: “Ha” + - Replace with: “Ht” + - Replace with: “H” - Replace with: “He”