Skip to content

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

feat: look-a-like→lookalike/look-alike (#4074)

Andrew Dunbarad5973c28cd6
diff --git a/harper-core/default_config.json b/harper-core/default_config.json
index 67d5442b6..5fedd66b1 100644
--- a/harper-core/default_config.json
+++ b/harper-core/default_config.json
@@ -2602,6 +2602,13 @@
"label": "Let Alone"
}
},
+ {
+ "Bool": {
+ "name": "Lookalike",
+ "state": true,
+ "label": "Lookalike"
+ }
+ },
{
"Bool": {
"name": "LooksLikes",
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict
index d8dc43cbf..38b32f02f 100644
--- a/harper-core/dictionary.dict
+++ b/harper-core/dictionary.dict
@@ -32928,6 +32928,7 @@ loofahs/N9Vh
look/~Vd>GSNgZ
look up/V/
lookalike/NgS
+look-alike/NgS
looker/NgS
lookout/~NgS
lookup/~NSV
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rs
index 0f872c09e..131834bdc 100644
--- a/harper-core/src/linting/phrase_set_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs
@@ -892,6 +892,15 @@ pub fn lint_group() -> LintGroup {
"Corrects `level of details` to `level of detail` or `levels of detail`.",
LintKind::Usage
),
+ "Lookalike" => (
+ &[
+ (&["look-a-like"], &["lookalike", "look-alike"]),
+ (&["look-a-likes"], &["lookalikes", "look-alikes"])
+ ],
+ "Use `look alike` or `look-alike` instead of `look-a-like`.",
+ "Corrects `look-a-like` to `look alike` or `look-alike`.",
+ LintKind::Spelling
+ ),
"MakeItSeem" => (
&[
(&["make it seems"], &["make it seem"]),
diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rs
index 59acc4110..a652d01c2 100644
--- a/harper-core/src/linting/phrase_set_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs
@@ -2967,6 +2967,34 @@ fn corrects_levels_of_details_real_world() {
);
}
+// Lookalike
+
+#[test]
+fn corrects_look_a_like() {
+ assert_good_and_bad_suggestions(
+ "Define the look-a-like of the cursor/mouse pointer:",
+ test_linter(),
+ &[
+ "Define the lookalike of the cursor/mouse pointer:",
+ "Define the look-alike of the cursor/mouse pointer:",
+ ],
+ &[],
+ );
+}
+
+#[test]
+fn corrects_look_a_likes() {
+ assert_good_and_bad_suggestions(
+ "Attempt at using AWS facial recognition to find look-a-likes in the Rijksmuseum's art collection.",
+ test_linter(),
+ &[
+ "Attempt at using AWS facial recognition to find lookalikes in the Rijksmuseum's art collection.",
+ "Attempt at using AWS facial recognition to find look-alikes in the Rijksmuseum's art collection.",
+ ],
+ &[],
+ );
+}
+
// MakeItSeem
#[test]