Skip to content

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

feat: trail and error→trial and error

hippietrail2699846ae475
diff --git a/harper-core/src/linting/an_a.rs b/harper-core/src/linting/an_a.rs
index bc1bf213f..5c0d83c49 100644
--- a/harper-core/src/linting/an_a.rs
+++ b/harper-core/src/linting/an_a.rs
@@ -92,7 +92,7 @@ fn to_lower_word(word: &[char]) -> Cow<'_, [char]> {
/// Checks whether a provided word begins with a vowel _sound_.
///
-/// It was produced through trail and error.
+/// It was produced through trial and error.
/// Matches with 99.71% and 99.77% of vowels and non-vowels in the
/// Carnegie-Mellon University word -> pronunciation dataset.
fn starts_with_vowel(word: &[char]) -> bool {
diff --git a/harper-core/src/linting/phrase_corrections.rs b/harper-core/src/linting/phrase_corrections.rs
index 79782dfc3..e17bc9fba 100644
--- a/harper-core/src/linting/phrase_corrections.rs
+++ b/harper-core/src/linting/phrase_corrections.rs
@@ -923,6 +923,12 @@ pub fn lint_group() -> LintGroup {
"Use `without` instead of `w/o`",
"Expands the abbreviation `w/o` to the full word `without` for clarity."
),
+ "TrialAndError" => (
+ ["trail and error"],
+ ["trial and error"],
+ "You misspelled `trial`.",
+ "Corrects `trail` to `trial` in `trial and error`."
+ ),
});
group.set_all_rules_to(Some(true));
@@ -1755,4 +1761,13 @@ mod tests {
"Another possible cause is simply that the application does not have file creation permissions on the other machine.",
);
}
+
+ #[test]
+ fn correct_trail_and_error() {
+ assert_suggestion_result(
+ "It was produced through trail and error.",
+ lint_group(),
+ "It was produced through trial and error.",
+ );
+ }
}