Skip to content

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

feat: (deux) ex machine → ex machina (#4675)

Andrew Dunbarcf4e973f6664
diff --git a/harper-core/default_config.json b/harper-core/default_config.json
index 3cd36f09a..f0b10eb1a 100644
--- a/harper-core/default_config.json
+++ b/harper-core/default_config.json
@@ -2672,6 +2672,13 @@
"label": "Exited Excited Context"
}
},
+ {
+ "Bool": {
+ "name": "ExMachina",
+ "state": true,
+ "label": "Ex Machina"
+ }
+ },
{
"Bool": {
"name": "FetalPosition",
diff --git a/harper-core/src/linting/weir_rules/ExMachina/WithDeus.weir b/harper-core/src/linting/weir_rules/ExMachina/WithDeus.weir
new file mode 100644
index 000000000..cb7b97b76
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ExMachina/WithDeus.weir
@@ -0,0 +1,8 @@
+expr main <(deus ex machine), machine>
+
+let message "This phrase is Latin and the spelling is `machina`."
+let description "Corrects the Latin phrase `deus ex machina`."
+let kind "Spelling"
+let becomes "machina"
+
+test "That deus ex machine stuff seems like enormous cope to me" "That deus ex machina stuff seems like enormous cope to me"
diff --git a/harper-core/src/linting/weir_rules/ExMachina/WithoutDeus.weir b/harper-core/src/linting/weir_rules/ExMachina/WithoutDeus.weir
new file mode 100644
index 000000000..aa2b7b714
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ExMachina/WithoutDeus.weir
@@ -0,0 +1,13 @@
+expr main <(ex machine), machine>
+
+let message "Did you mean the Latin phrase `ex machina`?"
+let description "Checks if the user intended the Latin phrase `ex machina`."
+let kind "Spelling"
+let becomes "machina"
+
+test "While I really enjoyed Ex Machine, its not of the \"2001: A Space Odyssey\" level." "While I really enjoyed Ex Machina, its not of the \"2001: A Space Odyssey\" level."
+
+# examples of where it's not a spelling mistake
+
+# The result is that every Cray EX machine needs a hand-written config file
+# Ex Machine Learning Engineer at ACI Limited