Skip to content

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

chore: false positives bit, dream, half

hippietrailcc5f3aa20ea2
diff --git a/harper-core/src/linting/adjective_of_a.rs b/harper-core/src/linting/adjective_of_a.rs
index 0fd29e276..6227dfd73 100644
--- a/harper-core/src/linting/adjective_of_a.rs
+++ b/harper-core/src/linting/adjective_of_a.rs
@@ -16,9 +16,12 @@ const FALSE_POSITIVES: &[&str] = &[
// The word is used more as a noun in this context.
// (using .kind.is_likely_homograph() here is too strict)
"back",
+ "bit",
"bottom",
"chance",
+ "dream",
"front",
+ "half",
"head",
"kind",
"left",
@@ -343,22 +346,14 @@ mod tests {
#[test]
fn dont_flag_sound() {
// Can be an adjective in e.g. "sound advice"
- assert_lint_count(
- "the sound of an approaching Krampus",
- AdjectiveOfA,
- 0,
- );
+ assert_lint_count("the sound of an approaching Krampus", AdjectiveOfA, 0);
}
#[test]
fn dont_flag_rid() {
// I removed the `5` flag from `rid` in `dictionary.dict`
// because dictionaries say the sense is archaic.
- assert_lint_count(
- "I need to get rid of a problem",
- AdjectiveOfA,
- 0,
- );
+ assert_lint_count("I need to get rid of a problem", AdjectiveOfA, 0);
}
#[test]
@@ -390,4 +385,22 @@ mod tests {
0,
);
}
+
+ #[test]
+ fn dont_flag_half() {
+ // Can be an adjective in e.g. "half man, half machine"
+ assert_lint_count("And now I only have half of a CyberTruck", AdjectiveOfA, 0);
+ }
+
+ #[test]
+ fn dont_flag_bit() {
+ // Technically also an adj as in "that guy's bit - he'll turn into a zombie"
+ assert_lint_count("we ran into a bit of an issue", AdjectiveOfA, 0);
+ }
+
+ #[test]
+ fn dont_flag_dream() {
+ // Can be an adjective in e.g. "we built our dream house"
+ assert_lint_count("When the dream of a united Europe began", AdjectiveOfA, 0);
+ }
}