Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix: fix indefinite article for "utter(ly)" (#1247)

Michael Schmidtdc835a6d2965
diff --git a/harper-core/src/linting/an_a.rs b/harper-core/src/linting/an_a.rs
index 5c0d83c49..eaf01c297 100644
--- a/harper-core/src/linting/an_a.rs
+++ b/harper-core/src/linting/an_a.rs
@@ -141,6 +141,10 @@ fn starts_with_vowel(word: &[char]) -> bool {
return true;
}
+ if matches!(word, ['u', 't', 't', ..]) {
+ return true;
+ }
+
if matches!(
word,
['u', 't' | 'r' | 'n', ..] | ['e', 'u', 'r', ..] | ['u', 'w', ..] | ['u', 's', 'e', ..]
diff --git a/harper-core/tests/text/linters/The Great Gatsby.snap.yml b/harper-core/tests/text/linters/The Great Gatsby.snap.yml
index a8195959c..5a87b360a 100644
--- a/harper-core/tests/text/linters/The Great Gatsby.snap.yml
+++ b/harper-core/tests/text/linters/The Great Gatsby.snap.yml
@@ -710,16 +710,6 @@ Message: |
-Lint: Miscellaneous (31 priority)
-Message: |
- 515 | hour old and Tom was God knows where. I woke up out of the ether with an utterly
- | ^~ Incorrect indefinite article.
- 516 | abandoned feeling, and asked the nurse right away if it was a boy or a girl. She
-Suggest:
- - Replace with: “a”
-
-
-
Lint: Spelling (63 priority)
Message: |
529 | the whole evening had been a trick of some sort to exact a contributary emotion