Skip to content

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

Merge branch 'master' into worse-worst-525

Elijah Potterbf121da82427
diff --cc harper-core/src/linting/phrase_corrections.rs
index b0a68eaec,4e4b30a47..020c3d398
--- a/harper-core/src/linting/phrase_corrections.rs
+++ b/harper-core/src/linting/phrase_corrections.rs
@@@ -615,48 -615,12 +615,54 @@@ pub fn lint_group() -> LintGroup
"Use `nerve-racking` for something that causes anxiety or tension.",
"Corrects common misspellings and missing hyphen in `nerve-racking`."
),
+ "ALotWorst" => (
+ ["a lot worst", "alot worst"],
+ ["a lot worse"],
+ "Use `worse` for comparing. (`Worst` is for the extreme case)",
+ "Corrects `a lot worst` to `a lot worse` for proper comparative usage."
+ ),
+ "FarWorse" => (
+ ["far worst"],
+ ["far worse"],
+ "Use `worse` for comparing. (`Worst` is for the extreme case)",
+ "Corrects `far worst` to `far worse` for proper comparative usage."
+ ),
+ "MuchWorse" => (
+ ["much worst"],
+ ["much worse"],
+ "Use `worse` for comparing. (`Worst` is for the extreme case)",
+ "Corrects `much worst` to `much worse` for proper comparative usage."
+ ),
+ "TurnForTheWorse" => (
+ ["turn for the worst"],
+ ["turn for the worse"],
+ "Use `turn for the worse` for a negative change in circumstances. Avoid the incorrect `turn for the worst`.",
+ "Corrects the nonstandard `turn for the worst` to the idiomatic `turn for the worse`, used to describe a situation that has deteriorated."
+ ),
+ "WorseAndWorse" => (
+ ["worst and worst", "worse and worst", "worst and worse"],
+ ["worse and worse"],
+ "Use `worse` for comparing. (`Worst` is for the extreme case)",
+ "Corrects `worst and worst` to `worse and worse` for proper comparative usage."
+ ),
+ "WorseThan" => (
+ ["worst than"],
+ ["worse than"],
+ "Use `worse` for comparing. (`Worst` is for the extreme case)",
+ "Corrects `worst than` to `worse than` for proper comparative usage."
+ ),
+ "WorstEver" => (
+ ["worse ever"],
+ ["worst ever"],
+ "Use `worst` for the extreme case. (`Worse` is for comparing)",
+ "Corrects `worse ever` to `worst ever` for proper comparative usage."
+ ),
+ "Monumentous" => (
+ ["monumentous"],
+ ["momentous", "monumental"],
+ "Retain `monumentous` for jocular effect. Otherwise `momentous` indicates great signifcance while `monumental` indicates imposing size.",
+ "Advises using `momentous` or `monumental` instead of `monumentous` for serious usage."
+ ),
});
group.set_all_rules_to(Some(true));
@@@ -894,96 -858,17 +900,124 @@@ mod tests
);
}
+ #[test]
+ fn detect_a_lot_worse_atomic() {
+ assert_suggestion_result("a lot worst", lint_group(), "a lot worse");
+ }
++
+ #[test]
+ fn detect_a_lot_worse_real_world() {
+ assert_suggestion_result(
+ "On a debug build, it's even a lot worst.",
+ lint_group(),
+ "On a debug build, it's even a lot worse.",
+ );
+ }
++
+ #[test]
+ fn detect_far_worse_atomic() {
+ assert_suggestion_result("far worst", lint_group(), "far worse");
+ }
++
+ #[test]
+ fn detect_far_worse_real_world() {
+ assert_suggestion_result(
+ "I mainly use Firefox (personal preference) and have noticed it has far worst performance than Chrome",
+ lint_group(),
+ "I mainly use Firefox (personal preference) and have noticed it has far worse performance than Chrome",
+ );
+ }
++
+ #[test]
+ fn detect_much_worse_atomic() {
+ assert_suggestion_result("much worst", lint_group(), "much worse");
+ }
++
+ #[test]
+ fn detect_much_worse_real_world() {
+ assert_suggestion_result(
+ "the generated image quality is much worst (actually nearly broken)",
+ lint_group(),
+ "the generated image quality is much worse (actually nearly broken)",
+ );
+ }
++
+ #[test]
+ fn detect_turn_for_the_worse_atomic() {
+ assert_suggestion_result("turn for the worst", lint_group(), "turn for the worse");
+ }
++
+ #[test]
+ fn detect_turn_for_the_worse_real_world() {
+ assert_suggestion_result(
+ "Very surprised to see this repo take such a turn for the worst.",
+ lint_group(),
+ "Very surprised to see this repo take such a turn for the worse.",
+ );
+ }
++
+ #[test]
+ fn detect_worst_and_worst_atomic() {
+ assert_suggestion_result("worst and worst", lint_group(), "worse and worse");
+ }
++
+ #[test]
+ fn detect_worst_and_worst_real_world() {
+ assert_suggestion_result(
+ "This control-L trick does not work for me. The padding is getting worst and worst.",
+ lint_group(),
+ "This control-L trick does not work for me. The padding is getting worse and worse.",
+ );
+ }
++
+ #[test]
+ fn detect_worse_and_worst_real_world() {
+ assert_suggestion_result(
+ "This progressively got worse and worst to the point that the machine (LEAD 1010) stopped moving alltogether.",
+ lint_group(),
+ "This progressively got worse and worse to the point that the machine (LEAD 1010) stopped moving alltogether.",
+ );
+ }
++
+ #[test]
+ fn detect_worse_than_atomic() {
+ assert_suggestion_result("worst than", lint_group(), "worse than");
+ }
++
+ #[test]
+ fn detect_worse_than_real_world() {
+ assert_suggestion_result(
+ "Project real image - inversion quality is worst than in StyleGAN2",
+ lint_group(),
+ "Project real image - inversion quality is worse than in StyleGAN2",
+ );
+ }
++
+ #[test]
+ fn detect_worst_ever_atomic() {
+ assert_suggestion_result("worse ever", lint_group(), "worst ever");
+ }
++
+ #[test]
+ fn detect_worst_ever_real_world() {
+ assert_suggestion_result(
+ "The Bcl package family is one of the worse ever published by Microsoft.",
+ lint_group(),
+ "The Bcl package family is one of the worst ever published by Microsoft.",
+ );
+ }
++
+ #[test]
+ fn detect_monumentous_atomic() {
+ assert_suggestion_result("monumentous", lint_group(), "momentous");
+ }
+
+ #[test]
+ fn detect_monumentous_real_world() {
+ assert_suggestion_result(
+ "I think that would be a monumentous step in the right direction, and would DEFINATLY turn heads in not just the music industry, but every ...",
+ lint_group(),
+ "I think that would be a momentous step in the right direction, and would DEFINATLY turn heads in not just the music industry, but every ...",
+ );
+ }
}