Skip to content

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

matcher.rs works better

hippietrail195d6b1792d7
diff --git a/harper-core/src/linting/matcher.rs b/harper-core/src/linting/matcher.rs
index 990cc03cf..3769ca45c 100644
--- a/harper-core/src/linting/matcher.rs
+++ b/harper-core/src/linting/matcher.rs
@@ -141,28 +141,28 @@ impl Matcher {
triggers.extend(pt! {
"guinea","bissau" => "Guinea-Bissau",
"Guinea","bissau" => "Guinea-Bissau",
- "Guinea","Bissau" => "Guinea-Bissau",
+ // "Guinea","Bissau" => "Guinea-Bissau",
"ndjamena" => "N'Djamena",
"Ndjamena" => "N'Djamena",
"n'djamena" => "N'Djamena",
"N'djamena" => "N'Djamena",
"port","au","prince" => "Port-au-Prince",
"Port","au","prince" => "Port-au-Prince",
- "Port","Au","Prince" => "Port-au-Prince",
+ // "Port","Au","Prince" => "Port-au-Prince",
"porto","novo" => "Porto-Novo",
- "Porto","novo" => "Porto-Novo",
- "Porto","Novo" => "Porto-Novo",
- "st","georges" => "St. George's",
- // "st.","georges" => "St. George's",
- "st","george's" => "St. George's",
- // "st.","george's" => "St. George's",
- "St","georges" => "St. George's",
- // "St.","georges" => "St. George's",
- "St","george's" => "St. George's",
- // "St.","george's" => "St. George's",
- "St","Georges" => "St. George's",
- // "St.","Georges" => "St. George's",
- "St","George's" => "St. George's"
+ "Porto","novo" => "Porto-Novo"
+ // "Porto","Novo" => "Porto-Novo",
+ // "st","georges" => "St. George's",
+ // // "st.","georges" => "St. George's",
+ // "st","george's" => "St. George's",
+ // // "st.","george's" => "St. George's",
+ // "St","georges" => "St. George's",
+ // // "St.","georges" => "St. George's",
+ // "St","george's" => "St. George's",
+ // // "St.","george's" => "St. George's",
+ // "St","Georges" => "St. George's",
+ // // "St.","Georges" => "St. George's",
+ // "St","George's" => "St. George's"
});
// countries and capitals with accents and diacritics
@@ -264,7 +264,8 @@ impl Linter for Matcher {
lint_kind: LintKind::Miscellaneous,
suggestions: vec![Suggestion::ReplaceWith(trigger.replace_with.to_owned())],
message: format!(
- "Did you mean “{}”?",
+ // "Did you mean “{}”?",
+ "Did you mean “{}”? (matcher.rs)",
trigger.replace_with.iter().collect::<String>()
),
priority: 15,
diff --git a/harper-core/src/linting/phrase_corrections.rs b/harper-core/src/linting/phrase_corrections.rs
index 6398946ac..a52d7a1ef 100644
--- a/harper-core/src/linting/phrase_corrections.rs
+++ b/harper-core/src/linting/phrase_corrections.rs
@@ -30,7 +30,7 @@ pub fn lint_group() -> LintGroup {
add_exact_mappings!(group, {
// The name of the rule
"ChangeTack" => (
- // The exact phrase to look for.
+ // The exact phrase(s) to look for.
["change tact"],
// The corrections to provide.
["change tack"],
@@ -602,7 +602,25 @@ pub fn lint_group() -> LintGroup {
["day and age"],
"Use `day and age` for referring to the present time.",
"Corrects the eggcorn `day in age` to `day and age`, which properly means the current era or time period."
- )
+ ),
+ // "GuineaBissau" => (
+ // ["Guinea Bissau"],
+ // ["Guinea-Bissau"],
+ // "The official spelling is hyphenated.",
+ // "Checks for the correct official name of the African country."
+ // ),
+ // "PortAuPrince" => (
+ // ["Port au Prince"],
+ // ["Port-au-Prince"],
+ // "The official spelling is hyphenated.",
+ // "Checks for the correct official name of the capital of Haiti."
+ // ),
+ // "PortoNovo" => (
+ // ["Porto Novo"],
+ // ["Porto-Novo"],
+ // "The official spelling is hyphenated.",
+ // "Checks for the correct official name of the capital of Benin."
+ // ),
});
group.set_all_rules_to(Some(true));