Skip to content

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

feat: reimplement "operative system(s)"

hippietrail1389e80b2e82
diff --git a/harper-core/src/linting/lint_group.rs b/harper-core/src/linting/lint_group.rs
index 19f921e18..ef0c815cd 100644
--- a/harper-core/src/linting/lint_group.rs
+++ b/harper-core/src/linting/lint_group.rs
@@ -47,8 +47,8 @@ use super::phrase_corrections::StateOfTheArt;
use super::phrase_corrections::WantBe;
use super::phrase_corrections::{
AndTheLike, BadRap, BatedBreath, BeckAndCall, ChangeTack, EnMasse, HumanLife, HungerPang,
- LetAlone, LoAndBehold, NeedHelp, NoLonger, OfCourse, SneakingSuspicion, SpecialAttention,
- SupposedTo, ThanOthers, ThatChallenged, TurnItOff,
+ LetAlone, LoAndBehold, NeedHelp, NoLonger, OfCourse, OperativeSystem, OperativeSystems,
+ SneakingSuspicion, SpecialAttention, SupposedTo, ThanOthers, ThatChallenged, TurnItOff,
};
use super::pique_interest::PiqueInterest;
use super::plural_conjugate::PluralConjugate;
@@ -335,7 +335,9 @@ create_lint_group_config!(
SpecialAttention => true,
Everywhere => true,
ThanOthers => true,
- SupposedTo => true
+ SupposedTo => true,
+ OperativeSystem => true,
+ OperativeSystems => true
);
impl<T: Dictionary + Default> Default for LintGroup<T> {
diff --git a/harper-core/src/linting/mod.rs b/harper-core/src/linting/mod.rs
index 25b3aeef7..098ccd0f1 100644
--- a/harper-core/src/linting/mod.rs
+++ b/harper-core/src/linting/mod.rs
@@ -113,8 +113,8 @@ pub use phrase_corrections::StateOfTheArt;
pub use phrase_corrections::WantBe;
pub use phrase_corrections::{
AndTheLike, BadRap, BatedBreath, BeckAndCall, ChangeTack, EnMasse, HumanLife, HungerPang,
- LetAlone, LoAndBehold, NeedHelp, NoLonger, OfCourse, SneakingSuspicion, SpecialAttention,
- SupposedTo, ThanOthers, ThatChallenged, TurnItOff,
+ LetAlone, LoAndBehold, NeedHelp, NoLonger, OfCourse, OperativeSystem, OperativeSystems,
+ SneakingSuspicion, SpecialAttention, SupposedTo, ThanOthers, ThatChallenged, TurnItOff,
};
pub use pique_interest::PiqueInterest;
pub use plural_conjugate::PluralConjugate;
diff --git a/harper-core/src/linting/phrase_corrections.rs b/harper-core/src/linting/phrase_corrections.rs
index 83e125fd4..e5398b4b3 100644
--- a/harper-core/src/linting/phrase_corrections.rs
+++ b/harper-core/src/linting/phrase_corrections.rs
@@ -139,13 +139,29 @@ create_linter_map_phrase!(MutePoint, ExactPhrase::from_phrase("mute point"),
"Did you mean `moot point`?",
"Ensures `moot point` is used instead of `mute point`, as `moot` means debatable or irrelevant.");
+create_linter_map_phrase!(
+ OperativeSystem,
+ ExactPhrase::from_phrase("operative system"),
+ "operating system",
+ "Did you mean `operating system`?",
+ "Ensures `operating system` is used correctly instead of `operative system`."
+);
+create_linter_map_phrase!(
+ OperativeSystems,
+ ExactPhrase::from_phrase("operative systems"),
+ "operating systems",
+ "Did you mean `operating systems`?",
+ "Ensures `operating systems` is used correctly instead of `operative systems`."
+);
+
#[cfg(test)]
mod tests {
use crate::linting::tests::{assert_lint_count, assert_suggestion_result};
use super::{
BadRap, BatedBreath, ChangeTack, EnMasse, HungerPang, LetAlone, LoAndBehold, OfCourse,
- SneakingSuspicion, SpecialAttention, SupposedTo, ThanOthers, TurnItOff,
+ OperativeSystem, OperativeSystems, SneakingSuspicion, SpecialAttention, SupposedTo,
+ ThanOthers, TurnItOff,
};
#[test]
@@ -262,4 +278,21 @@ mod tests {
0,
);
}
+
+ #[test]
+ fn operative_system() {
+ assert_suggestion_result(
+ "COS is a operative system made with the COSMOS Kernel and written in C#, COS its literally the same than MS-DOS but written in C# and open-source.",
+ OperativeSystem::default(),
+ "COS is a operating system made with the COSMOS Kernel and written in C#, COS its literally the same than MS-DOS but written in C# and open-source.",
+ );
+ }
+ #[test]
+ fn operative_systems() {
+ assert_suggestion_result(
+ "My dotfiles for my operative systems and other configurations.",
+ OperativeSystems::default(),
+ "My dotfiles for my operating systems and other configurations.",
+ );
+ }
}