From 74be2af59ca9b46640ebcff292ca7b7ffec00ddf Mon Sep 17 00:00:00 2001 From: Elijah Potter Date: Tue, 23 Jan 2024 10:58:37 -0700 Subject: [PATCH] Changed demo text on web app --- Dockerfile | 2 +- alice.txt | 19 ------------------- demo.md | 3 +++ harper-core/dictionary.dict | 7 ++++++- harper-core/src/linting/repeated_words.rs | 8 +++++++- web/src/lib/Editor.svelte | 4 ++-- 6 files changed, 19 insertions(+), 24 deletions(-) delete mode 100644 alice.txt create mode 100644 demo.md diff --git a/Dockerfile b/Dockerfile index f503b786..c999e812 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN mkdir harper-wasm COPY --from=wasm-build /usr/build/harper-wasm/pkg /usr/build/harper-wasm/pkg COPY web web -COPY alice.txt . +COPY demo.md . WORKDIR /usr/build/web diff --git a/alice.txt b/alice.txt deleted file mode 100644 index 36a55fda..00000000 --- a/alice.txt +++ /dev/null @@ -1,19 +0,0 @@ -after a time she heard a little pattering of feet in the distance, and -she hastily dried her eyes to see what was coming. It was the White -Rabbit returning, splendidly dressed, with a pair of white kid gloves in -one hand and a large fan in the other: he came trotting along in a great -hurry, muttering to himself as he came, "Oh! the Duchess, the Duchess! -Oh! won't she be savage if I've kept her 100 waiting!" Alice felt so -desperate that she was ready to ask help of any one; so, when the -Rabbit came near her, she began, in a low, timid voice, "If you please, -sir---" The Rabbit started violently, dropped the white kid gloves and -the fan, and scurried away into the darkness as hard as he could go. - -Alice took up the fan and gloves, and, as the hall was very hot, she -kept fanning hrself all the time she went on talking! "Dear, dear! How -queer everything is today! And yesterday things went on just as usual. -I wonder if I've been changed during the night? Let me think: was I -the same when I got up this morning? I almost think I can remember -feeling a little different. But if I'm not the same, the next question -is, who in the world am I? Ah, that's the great puzzle!" And she began -thinking over all the children she knew that were of the same age as diff --git a/demo.md b/demo.md new file mode 100644 index 00000000..df49aebe --- /dev/null +++ b/demo.md @@ -0,0 +1,3 @@ +Harper is a language checker for artists. it can detect +improper capitalization and mispelled words. There are some cases, +where the the standard grammar checkers don't cut it. That's where Harper comes in handy. diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict index 5bdea91a..73c70a20 100644 --- a/harper-core/dictionary.dict +++ b/harper-core/dictionary.dict @@ -1,4 +1,4 @@ -49568 +50000 0/nm 0th/pt 1/n1 @@ -10729,7 +10729,11 @@ Maia/M Semele/M Chiron/M Katniss/M +Cloudflare/M +TLS Everdeen/M +pseudorandom/P +counterintuitively Leto/M Ouranos/M Hecatoncheires/M @@ -49576,3 +49580,4 @@ zydeco/M zygote/SM zygotic zymurgy/M +StackOverflow/M diff --git a/harper-core/src/linting/repeated_words.rs b/harper-core/src/linting/repeated_words.rs index d1828e8b..0a778e62 100644 --- a/harper-core/src/linting/repeated_words.rs +++ b/harper-core/src/linting/repeated_words.rs @@ -7,7 +7,7 @@ use crate::{ use super::{Lint, LintKind, Linter}; -#[derive(Debug, Clone, Default)] +#[derive(Debug, Clone)] pub struct RepeatedWords { /// The set of words that can be considered for repetition checking. set: HashSet>, @@ -47,6 +47,12 @@ impl RepeatedWords { } } +impl Default for RepeatedWords { + fn default() -> Self { + Self::new() + } +} + impl Linter for RepeatedWords { /// A linter that checks to make sure the first word of each sentence is capitalized. fn lint(&mut self, document: &Document) -> Vec { diff --git a/web/src/lib/Editor.svelte b/web/src/lib/Editor.svelte index 685e27ae..e81dfae9 100644 --- a/web/src/lib/Editor.svelte +++ b/web/src/lib/Editor.svelte @@ -1,12 +1,12 @@