Skip to content

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

fix(core): problems found using fuzzing

Elijah Potter1fdd601958e5
diff --git a/harper-cli/src/main.rs b/harper-cli/src/main.rs
index 72332eb5b..2d34b9f10 100644
--- a/harper-cli/src/main.rs
+++ b/harper-cli/src/main.rs
@@ -2,6 +2,7 @@
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
+use std::process;
use anyhow::format_err;
use ariadne::{Color, Label, Report, ReportKind, Source};
@@ -98,7 +99,7 @@ fn main() -> anyhow::Result<()> {
let report = report_builder.finish();
report.print((&filename, Source::from(source)))?;
- Ok(())
+ process::exit(1)
}
Args::Parse { file } => {
let (doc, _) = load_file(&file, markdown_options)?;
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict
index fa5e79d0b..2d523e632 100644
--- a/harper-core/dictionary.dict
+++ b/harper-core/dictionary.dict
@@ -8806,7 +8806,7 @@ Schneider/2M
Schoenberg/2M
Schopenhauer/2M
Schrieffer/M
-Schrodinger/2M
+Schrödinger/2M
Schroeder/2M
Schubert/2M
Schultz/2M
@@ -10724,7 +10724,7 @@ Cloudflare/M
TLS/12
Everdeen/M
pseudorandom/5P
-counterintuitively/
+counterintuitive/Y
Leto/2M
Ouranos/M
Hecatoncheires/1M
@@ -19205,7 +19205,7 @@ cwt/1
cyan/15M
cyanide/14M
cyanobacteria/1
-cyberbully/14SM
+cyberbully/14SMG
cybercafe/1S
cybernetic/5S
cyber/5
@@ -35130,7 +35130,7 @@ overstay/41DSG
overstep/41S
overstepped/4
overstepping/4
-overstimulate/4DSG
+overstimulate/4DSGX
overstock/41GSD
overstretch/41GDS
overstrict/5
@@ -43714,8 +43714,8 @@ stifling/541Y
stigma/1SM
stigmata/1
stigmatic/51
-stigmatization/1M
-stigmatize/4GDS
+stigmatization/1CM
+stigmatize/4GDSC
stile/14SM
stiletto/14SM
still's
@@ -49964,3 +49964,26 @@ N4/2M
N5/2M
Lenovo/2M
ThinkPad/2SM
+interconnectedness/1
+transformative/5
+Spotify/2M
+Waymo/2M
+gameplay/1
+chatbot/SM
+Siri/2M
+Alexa/2M
+gamify/4D
+perceptron/SM
+telemedicine/SM
+rainforest/SM
+reskilling/4
+overhyped/45
+preloaded/54
+NLP/M
+overstimulation/1
+VR/2M
+NPC/SM
+hydropower/1
+IPCC/2M
+AlphaFold/2M
+DeepMind/2M
diff --git a/harper-core/src/linting/phrase_corrections.rs b/harper-core/src/linting/phrase_corrections.rs
index f52ebc35a..830a95442 100644
--- a/harper-core/src/linting/phrase_corrections.rs
+++ b/harper-core/src/linting/phrase_corrections.rs
@@ -25,7 +25,7 @@ pub fn lint_group() -> LintGroup {
add_similar_mappings!(group, {
"TurnItOff" => ("turn it off", 1),
"HumanLife" => ("human life", 1),
- "ThatChallenged" => ("that challenged", 2),
+ "ThatChallenged" => ("that challenged", 1),
"NoLonger" => ("no longer", 1),
"NeedHelp" => ("need help", 1),
"OfCourse" => ("of course", 1),
@@ -228,6 +228,18 @@ pub fn lint_group() -> LintGroup {
["band together"],
"Did you mean 'band together'?",
"Detects and corrects the common error of using `ban together` instead of the idiom `band together`, which means to unite or join forces."
+ ),
+ "WaveFunction" => (
+ "wavefunction",
+ ["wave function"],
+ "Did you mean 'wave function'?",
+ "Identifies the mistake of merging 'wave' and 'function' into one word. In quantum mechanics, a 'wave function' (written as two words) describes the mathematical function that represents the quantum state of a particle or system. Correct usage is crucial for clear and accurate scientific communication."
+ ),
+ "InThe" => (
+ "int he",
+ ["in the"],
+ "Did you mean 'in the'?",
+ "Detects and corrects a spacing error where 'in the' is mistakenly written as 'int he'. Proper spacing is essential for readability and grammatical correctness in common phrases."
)
});