Skip to content

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

feat(core): add more phrases

Elijah Potter17971486bcca
diff --git a/harper-core/src/linting/phrase_corrections.rs b/harper-core/src/linting/phrase_corrections.rs
index 47cc57cab..384eaded0 100644
--- a/harper-core/src/linting/phrase_corrections.rs
+++ b/harper-core/src/linting/phrase_corrections.rs
@@ -75,11 +75,27 @@ create_linter_for_phrase!(NeedHelp, "need help", 1);
create_linter_for_phrase!(Decision, "make a decision", 1);
create_linter_for_phrase!(OfCourse, "of course", 1);
+create_linter_for_phrase!(AndAlike, "and alike", 1);
+create_linter_for_phrase!(BadRap, "bad rap", 1);
+create_linter_for_phrase!(BatedBreath, "bated breath", 1);
+create_linter_for_phrase!(BeckAndCall, "beck and call", 1);
+create_linter_for_phrase!(ChangeTack, "change tack", 1);
+create_linter_for_phrase!(HungerPang, "hunger pang", 3);
+create_linter_for_phrase!(EnMasse, "en masse", 1);
+create_linter_for_phrase!(LetAlone, "let alone", 1);
+create_linter_for_phrase!(LoAndBehold, "lo and behold", 2);
+create_linter_for_phrase!(MootPoint, "moot point", 3);
+create_linter_for_phrase!(SneakingSuspicion, "sneaking suspicion", 3);
+create_linter_for_phrase!(SupposeTo, "suppose to", 1);
+
#[cfg(test)]
mod tests {
use crate::linting::tests::{assert_lint_count, assert_suggestion_result};
- use super::{Decision, OfCourse, TurnItOff};
+ use super::{
+ BadRap, BatedBreath, ChangeTack, Decision, EnMasse, HungerPang, LetAlone, LoAndBehold,
+ MootPoint, OfCourse, SneakingSuspicion, SupposeTo, TurnItOff,
+ };
#[test]
fn issue_574() {
@@ -132,4 +148,58 @@ mod tests {
"Yes, of course we should do that.",
);
}
+
+ #[test]
+ fn bad_rep() {
+ assert_suggestion_result("bad rep", BadRap::default(), "bad rap");
+ }
+
+ #[test]
+ fn baited_breath() {
+ assert_suggestion_result("baited breath", BatedBreath::default(), "bated breath");
+ }
+
+ #[test]
+ fn change_tact() {
+ assert_suggestion_result("change tact", ChangeTack::default(), "change tack");
+ }
+
+ #[test]
+ fn hunger_pain() {
+ assert_suggestion_result("hunger pain", HungerPang::default(), "hunger pang");
+ }
+
+ #[test]
+ fn in_mass() {
+ assert_suggestion_result("in mass", EnMasse::default(), "en masse");
+ }
+
+ #[test]
+ fn let_along() {
+ assert_suggestion_result("let along", LetAlone::default(), "let alone");
+ }
+
+ #[test]
+ fn long_and_behold() {
+ assert_suggestion_result("long and behold", LoAndBehold::default(), "lo and behold");
+ }
+
+ #[test]
+ fn mute_point() {
+ assert_suggestion_result("mute point", MootPoint::default(), "moot point");
+ }
+
+ #[test]
+ fn sneaky_suspicion() {
+ assert_suggestion_result(
+ "sneaky suspicion",
+ SneakingSuspicion::default(),
+ "sneaking suspicion",
+ );
+ }
+
+ #[test]
+ fn supposed_to() {
+ assert_suggestion_result("supposed to", SupposeTo::default(), "suppose to");
+ }
}