Skip to content

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

feat(#422): add same than -> same as matcher trigger

Grant Lemonsc68f92587bcf
diff --git a/harper-core/src/linting/matcher.rs b/harper-core/src/linting/matcher.rs
index 369a05bea..5da2077bf 100644
--- a/harper-core/src/linting/matcher.rs
+++ b/harper-core/src/linting/matcher.rs
@@ -186,7 +186,11 @@ impl Matcher {
"to", "towards" => "towards",
"though", "process" => "thought process",
"the", "this" => "that this",
- "take", "a", "decision" => "make a decision"
+ "take", "a", "decision" => "make a decision",
+ "same", "than" => "same as",
+ "Same", "than" => "same as",
+ "same", "then" => "same as",
+ "Same", "then" => "same as"
};
triggers.push(Rule {
@@ -280,4 +284,12 @@ mod tests {
let lints = matcher.lint(&document);
assert_eq!(lints.len(), 1);
}
+
+ #[test]
+ fn same_than() {
+ let document = Document::new_plain_english_curated("Same than the others.");
+ let mut matcher = Matcher::new();
+ let lints = matcher.lint(&document);
+ assert_eq!(lints.len(), 1);
+ }
}