Skip to content

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

fix: AnA linter with the word "once"

Elijah Potter07a4b3778ac5
diff --git a/harper-core/src/linting/an_a.rs b/harper-core/src/linting/an_a.rs
index 71ff42a96..f5b39736a 100644
--- a/harper-core/src/linting/an_a.rs
+++ b/harper-core/src/linting/an_a.rs
@@ -80,7 +80,10 @@ fn starts_with_vowel(word: &[char]) -> bool {
if matches!(
word,
- [] | ['u', 'k', ..] | ['e', 'u', 'p', 'h', ..] | ['e', 'u', 'g' | 'l' | 'c', ..]
+ [] | ['u', 'k', ..]
+ | ['e', 'u', 'p', 'h', ..]
+ | ['e', 'u', 'g' | 'l' | 'c', ..]
+ | ['o', 'n', 'c', 'e']
) {
return false;
}
@@ -166,4 +169,9 @@ mod tests {
fn detects_llm_as_vowel() {
assert_lint_count("Here is a LLM document.", AnA, 1);
}
+
+ #[test]
+ fn once_over() {
+ assert_lint_count("give this a once-over.", AnA, 0);
+ }
}