diff --git a/demo.md b/demo.md index 640a42875..3fbdd5e7c 100644 --- a/demo.md +++ b/demo.md @@ -2,6 +2,10 @@ Harper is a language checker for artists. it can detect improper capitalization and misspelled words. There are some cases, where the the standard grammar checkers don't cut it. -That's where Harper comes in handy. +That s where Harper comes in handy. -kid regards, Elijah +Harper works everywhere, even offline. Since you r data never leaves your device, +you don't ned to worry aout us selling it or using it to train LLMs. + +The best part: Harper can give you feedback instantly. +For most documents, Harper can serve up suggestions in under 10 ms. diff --git a/harper-core/src/linting/matcher.rs b/harper-core/src/linting/matcher.rs index 0ca6ef926..ac5beffcb 100644 --- a/harper-core/src/linting/matcher.rs +++ b/harper-core/src/linting/matcher.rs @@ -38,6 +38,12 @@ macro_rules! pt { content: Some($str.chars().collect()), } }; + (Period) => { + PatternToken { + kind: TokenKind::Punctuation(Punctuation::Period), + content: None, + } + }; (Hyphen) => { PatternToken { kind: TokenKind::Punctuation(Punctuation::Hyphen), @@ -122,13 +128,23 @@ impl Matcher { "more","then" => "more than", "gong","to" => "going to", "then","others" => "than others", + "Then","others" => "than others", "then","before" => "than before", + "Then","before" => "than before", "then","last","week" => "than last week", "then","her" => "than her", "then","hers" => "than hers", "then","him" => "than him", "then","his" => "than his", - "simply","grammatical" => "simple grammatical" + "simply","grammatical" => "simple grammatical", + "you","r" => "your", + "that","s" => "that's", + "That","s" => "that's", + "that","s" => "that is", + "That","s" => "that is", + "ms" => "milliseconds", + "LLM" => "large language model", + "LLMs" => "large language models" }; triggers.push(Rule { @@ -136,6 +152,23 @@ impl Matcher { replace_with: vecword!("break-up"), }); + triggers.push(Rule { + pattern: vec![pt!("L"), pt!(Period), pt!("L"), pt!(Period), pt!("M")], + replace_with: vecword!("large language model"), + }); + + triggers.push(Rule { + pattern: vec![ + pt!("L"), + pt!(Period), + pt!("L"), + pt!(Period), + pt!("M"), + pt!(Period), + ], + replace_with: vecword!("large language model"), + }); + Self { triggers } } } diff --git a/harper-wasm/Cargo.toml b/harper-wasm/Cargo.toml index 5d88dd57e..11554e347 100644 --- a/harper-wasm/Cargo.toml +++ b/harper-wasm/Cargo.toml @@ -9,7 +9,7 @@ publish = false crate-type = ["cdylib", "rlib"] [profile.release] -opt-level = "s" +opt-level = 3 strip = true [dependencies] diff --git a/web/src/lib/Editor.svelte b/web/src/lib/Editor.svelte index 49816ff53..4573e3f6b 100644 --- a/web/src/lib/Editor.svelte +++ b/web/src/lib/Editor.svelte @@ -41,7 +41,7 @@ >