Skip to content

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

feat: life time, trade off→lifetime, tradeoff (#4526)

Andrew Dunbar710faea914de
diff --git a/harper-core/default_config.json b/harper-core/default_config.json
index 6bca613ea..bd64bd8e9 100644
--- a/harper-core/default_config.json
+++ b/harper-core/default_config.json
@@ -551,6 +551,13 @@
"label": "Laptop"
}
},
+ {
+ "Bool": {
+ "name": "Lifetime",
+ "state": true,
+ "label": "Lifetime"
+ }
+ },
{
"Bool": {
"name": "Meanwhile",
@@ -782,6 +789,13 @@
"label": "Thereupon"
}
},
+ {
+ "Bool": {
+ "name": "Tradeoff",
+ "state": true,
+ "label": "Tradeoff"
+ }
+ },
{
"Bool": {
"name": "Underclock",
diff --git a/harper-core/src/linting/closed_compounds.rs b/harper-core/src/linting/closed_compounds.rs
index ed58a7571..c2d9528ed 100644
--- a/harper-core/src/linting/closed_compounds.rs
+++ b/harper-core/src/linting/closed_compounds.rs
@@ -45,6 +45,7 @@ pub fn lint_group() -> LintGroup {
"Keystroke" => (&["key stoke", "key stroke"][..], "keystroke"),
"Keystrokes" => (&["key stokes", "key strokes"][..], "keystrokes"),
"Laptop" => (&["lap top"][..], "laptop"),
+ "Lifetime" => (&["life time"][..], "lifetime"),
"Middleware" => (&["middle ware"][..], "middleware"),
"Meanwhile" => (&["mean while"][..], "meanwhile"),
"Misunderstand" => (&["miss understand"][..], "misunderstand"),
@@ -77,6 +78,7 @@ pub fn lint_group() -> LintGroup {
"There" => (&["the re"][..], "there"),
"Therefore" => (&["there fore"][..], "therefore"),
"Thereupon" => (&["there upon"][..], "thereupon"),
+ "Tradeoff" => (&["trade off"][..], "tradeoff"),
"Underclock" => (&["under clock"][..], "underclock"),
"Upset" => (&["up set"][..], "upset"),
"Upward" => (&["up ward"][..], "upward"),
@@ -378,4 +380,22 @@ mod tests {
"This new vulnerability has a somewhat straightforward path to exploitation and prints funds out of thin air.",
)
}
+
+ #[test]
+ fn lifetime() {
+ assert_suggestion_result(
+ "In a life time it's gone up by more than 10 fold.",
+ lint_group(),
+ "In a lifetime it's gone up by more than 10 fold.",
+ );
+ }
+
+ #[test]
+ fn tradeoff() {
+ assert_suggestion_result(
+ "But the trade off was that specific details about the invention, how it worked and how it's made were entered openly for anyone to look up.",
+ lint_group(),
+ "But the tradeoff was that specific details about the invention, how it worked and how it's made were entered openly for anyone to look up.",
+ );
+ }
}