Skip to content

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

feat: fixed issues with sentence terminators in lists and added new matchers and words

Elijah Potter1e642e504b9d
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict
index 63b4e8464..49966e473 100644
--- a/harper-core/dictionary.dict
+++ b/harper-core/dictionary.dict
@@ -11689,7 +11689,8 @@ alligator/MS
alliterate/DSXGNV
alliteration/M
alliterative/Y
-allocate/ADSGNY
+allocate/ADSGNYC
+allocator/C
allocation/AM
allocations
allot/LS
@@ -30078,6 +30079,7 @@ legacy/SM
legal/SMY
legalese/M
legalism/MS
+legalist/S
legalistic
legalistically
legality/SM
@@ -35549,7 +35551,7 @@ parricide/MS
parring
parrot/GMDS
parry/GDSM
-parse/DRSG
+parse/DRSGT
parsec/MS
parsimonious/Y
parsimony/M
@@ -44113,7 +44115,7 @@ submerse/GNDS
submersible/MS
submersion/M
submicroscopic
-submission/MS
+submission/MSA
submissive/PY
submissiveness/M
submit/AS
@@ -49610,3 +49612,13 @@ LADAR
TODO
struct
WASM
+hackathon/S
+pseudocode/MG
+Zettelkasten
+OAuth
+MacOS
+SVG/s
+URI/s
+suprachiasmatic
+cannabinoids
+eudaimonia
diff --git a/harper-core/src/linting/matcher.rs b/harper-core/src/linting/matcher.rs
index 6f7b6f68a..03760f48f 100644
--- a/harper-core/src/linting/matcher.rs
+++ b/harper-core/src/linting/matcher.rs
@@ -99,6 +99,9 @@ impl Matcher {
// This match list needs to be automatically expanded instead of explicitly
// defined like it is now.
let mut triggers = pt! {
+ "hashtable" => "hash table",
+ "hashmap" => "hash map",
+ "CCP" => "Chinese Communist Party",
"dep" => "dependency",
"deps" => "dependencies",
"off","the","cuff" => "off-the-cuff",
diff --git a/harper-core/src/parsers/markdown.rs b/harper-core/src/parsers/markdown.rs
index 46d1b6401..cfc16aa3b 100644
--- a/harper-core/src/parsers/markdown.rs
+++ b/harper-core/src/parsers/markdown.rs
@@ -41,7 +41,7 @@ impl Parser for Markdown {
pulldown_cmark::Event::End(pulldown_cmark::TagEnd::Paragraph)
| pulldown_cmark::Event::End(pulldown_cmark::TagEnd::Item) => tokens.push(Token {
span: Span::new_with_len(traversed_chars, 1),
- kind: TokenKind::Newline(1)
+ kind: TokenKind::Newline(2)
}),
pulldown_cmark::Event::End(_) => {
stack.pop();
diff --git a/harper-core/src/parsers/mod.rs b/harper-core/src/parsers/mod.rs
index fa37b2c16..b19f2ce16 100644
--- a/harper-core/src/parsers/mod.rs
+++ b/harper-core/src/parsers/mod.rs
@@ -88,7 +88,7 @@ mod tests {
Word,
Space(1),
Word,
- Newline(1)
+ Newline(2)
]
);
}
@@ -102,11 +102,11 @@ mod tests {
Space(1),
Word,
Punctuation(Punctuation::Comma),
- Newline(1),
+ Newline(2),
Word,
Space(1),
Word,
- Newline(1)
+ Newline(2)
]
);
}
diff --git a/harper-core/src/spell/hunspell/mod.rs b/harper-core/src/spell/hunspell/mod.rs
index 3da32836b..27e954a8a 100644
--- a/harper-core/src/spell/hunspell/mod.rs
+++ b/harper-core/src/spell/hunspell/mod.rs
@@ -86,6 +86,11 @@ mod tests {
assert!(build_expanded().contains(&split("giants")));
}
+ #[test]
+ fn expanded_contains_deallocate() {
+ assert!(build_expanded().contains(&split("deallocate")));
+ }
+
fn split(text: &str) -> DictWord {
text.chars().collect()
}
diff --git a/harper-ls/README.md b/harper-ls/README.md
index 7eb54cea6..c3b1ce471 100644
--- a/harper-ls/README.md
+++ b/harper-ls/README.md
@@ -67,7 +67,7 @@ lspconfig.harper_ls.setup {
an_a = true,
sentence_capitalization = true,
unclosed_quotes = true,
- wrong_quotes = true,
+ wrong_quotes = false,
long_sentences = true,
repeated_words = true,
spaces = true,