Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
fix(core): more adjustments to SplitWords (#3922)
Elijah Potter1adbb8188d31
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dictindex f0b9f0035..ab3ea3884 100644--- a/harper-core/dictionary.dict+++ b/harper-core/dictionary.dict@@ -18742,7 +18742,7 @@ compress/~VGdSNevcompress'scompressed/~JVtTUcompressible/J-compression/~Nge+compression/~NgeScompressor/~NSgecomprise/~VGdScompromise/~NgSVGd@@ -48538,7 +48538,7 @@ systemwide/Jsystole/NSgsystolic/JNt/NSdGnXBz-ta/~PN+ta/PNta-datab/~NSgVtabbed/JVtT@@ -54719,3 +54719,4 @@ viscomital/J # As above, alternative versionWordCamp/Ogworldbuild/V>Gplaythrough/gNS+cutscene/gNSdiff --git a/harper-core/src/linting/lint_group/mod.rs b/harper-core/src/linting/lint_group/mod.rsindex 8e716da96..4b7036fe9 100644--- a/harper-core/src/linting/lint_group/mod.rs+++ b/harper-core/src/linting/lint_group/mod.rs@@ -1214,6 +1214,15 @@ mod tests {);}+ #[test]+ fn fixes_extention_correctly() {+ assert_suggestion_result(+ "There is no extention quite like this one.",+ test_linter(),+ "There is no extention quite like this one.",+ );+ }+#[test]fn fixes_easir() {assert_suggestion_result(@@ -1223,6 +1232,15 @@ mod tests {);}+ #[test]+ fn fixes_breakfest() {+ assert_suggestion_result(+ "Ice cream for breakfest?",+ test_linter(),+ "Ice cream for breakfast?",+ );+ }+#[test]fn fixes_buget() {assert_suggestion_result(@@ -1232,6 +1250,11 @@ mod tests {);}+ #[test]+ fn allows_chest_compressions() {+ assert_no_lints("Please continue chest compressions.", test_linter());+ }+/// Tests that no linters' descriptions contain errors handled by other linters.////// This test verifies that the description of each linter (which is written in natural language)diff --git a/harper-core/src/linting/split_words.rs b/harper-core/src/linting/split_words.rsindex ade0b1794..1ee6caf39 100644--- a/harper-core/src/linting/split_words.rs+++ b/harper-core/src/linting/split_words.rs@@ -193,6 +193,7 @@ fn should_defer_to_spellcheck(|| tok.kind.is_pronoun()|| tok.kind.is_adjective()|| tok.kind.is_possessive_determiner()+ || tok.kind.is_preposition()})});diff --git a/harper-core/tests/text/linters/The Great Gatsby.snap.yml b/harper-core/tests/text/linters/The Great Gatsby.snap.ymlindex 93e42c3a0..672fc0dad 100644--- a/harper-core/tests/text/linters/The Great Gatsby.snap.yml+++ b/harper-core/tests/text/linters/The Great Gatsby.snap.yml@@ -759,9 +759,9 @@ Message: |664 | it, you perceive, after a moment, the eyes of Doctor T. J. Eckleburg. The eyes| ^~ Did you mean to spell `T.` this way?Suggest:- - Replace with: “Ta”- Replace with: “Ti”- Replace with: “To”+ - Replace with: “Th”@@ -793,9 +793,9 @@ Message: |665 | of Doctor T. J. Eckleburg are blue and gigantic—their retinas are one yard high.| ^~ Did you mean to spell `T.` this way?Suggest:- - Replace with: “Ta”- Replace with: “Ti”- Replace with: “To”+ - Replace with: “Th”@@ -5045,9 +5045,9 @@ Message: |3874 | while in silence. Then as Doctor T. J. Eckleburg’s faded eyes came into sight| ^~ Did you mean to spell `T.` this way?Suggest:- - Replace with: “Ta”- Replace with: “Ti”- Replace with: “To”+ - Replace with: “Th”@@ -5123,9 +5123,9 @@ Message: |3948 | behind. Over the ashheaps the giant eyes of Doctor T. J. Eckleburg kept their| ^~ Did you mean to spell `T.` this way?Suggest:- - Replace with: “Ta”- Replace with: “Ti”- Replace with: “To”+ - Replace with: “Th”@@ -6674,9 +6674,9 @@ Message: |5156 | of Doctor T. J. Eckleburg, which had just emerged, pale and enormous, from the| ^~ Did you mean to spell `T.` this way?Suggest:- - Replace with: “Ta”- Replace with: “Ti”- Replace with: “To”+ - Replace with: “Th”