From f60df5ae847d23b36ec6ac1dd309b2970d3a5315 Mon Sep 17 00:00:00 2001 From: Sofus Addington Date: Thu, 23 Oct 2025 11:58:41 +0200 Subject: [PATCH 1/2] danish dictionary --- README.md | 1 + crates/codebook/src/dictionaries/repo.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 05e6786..ea98e18 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ Project-specific configuration is loaded from either `codebook.toml` or `.codebo # - Portuguese (Brazil): "pt_br" # - Russian: "ru" # - Swedish: "sv" +# - Danish: "da" dictionaries = ["en_us", "en_gb"] # Custom allowlist of words to ignore (case-insensitive) diff --git a/crates/codebook/src/dictionaries/repo.rs b/crates/codebook/src/dictionaries/repo.rs index b362bb0..8c46d5b 100644 --- a/crates/codebook/src/dictionaries/repo.rs +++ b/crates/codebook/src/dictionaries/repo.rs @@ -109,6 +109,11 @@ static HUNSPELL_DICTIONARIES: LazyLock> = LazyLock::new(|| { "https://raw.githubusercontent.com/wooorm/dictionaries/refs/heads/main/dictionaries/nl/index.aff", "https://raw.githubusercontent.com/wooorm/dictionaries/refs/heads/main/dictionaries/nl/index.dic", ), + HunspellRepo::new( + "da", + "https://raw.githubusercontent.com/wooorm/dictionaries/refs/heads/main/dictionaries/da/index.aff", + "https://raw.githubusercontent.com/wooorm/dictionaries/refs/heads/main/dictionaries/da/index.dic", + ), ] }); From 8b2cc68a5645821395354a297040a1b2edf1e8f9 Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Sat, 25 Oct 2025 00:29:05 -0700 Subject: [PATCH 2/2] Update da dictionary, add example --- crates/codebook/src/dictionaries/dictionary.rs | 5 +++-- crates/codebook/src/dictionaries/repo.rs | 4 ++-- examples/da.md | 7 +++++++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 examples/da.md diff --git a/crates/codebook/src/dictionaries/dictionary.rs b/crates/codebook/src/dictionaries/dictionary.rs index ea7ec4d..0feccba 100644 --- a/crates/codebook/src/dictionaries/dictionary.rs +++ b/crates/codebook/src/dictionaries/dictionary.rs @@ -34,8 +34,9 @@ impl HunspellDictionary { pub fn new(aff_path: &str, dic_path: &str) -> Result> { let aff = std::fs::read_to_string(aff_path)?; let dic = std::fs::read_to_string(dic_path)?; - let dict = spellbook::Dictionary::new(&aff, &dic) - .map_err(|e| format!("Dictionary parse error: {e}"))?; + let dict = spellbook::Dictionary::new(&aff, &dic).map_err(|e| { + format!("Dictionary [aff: {aff_path}, dic: {dic_path}] parse error: {e}") + })?; Ok(HunspellDictionary { dictionary: dict, diff --git a/crates/codebook/src/dictionaries/repo.rs b/crates/codebook/src/dictionaries/repo.rs index 8c46d5b..5e0f583 100644 --- a/crates/codebook/src/dictionaries/repo.rs +++ b/crates/codebook/src/dictionaries/repo.rs @@ -111,8 +111,8 @@ static HUNSPELL_DICTIONARIES: LazyLock> = LazyLock::new(|| { ), HunspellRepo::new( "da", - "https://raw.githubusercontent.com/wooorm/dictionaries/refs/heads/main/dictionaries/da/index.aff", - "https://raw.githubusercontent.com/wooorm/dictionaries/refs/heads/main/dictionaries/da/index.dic", + "https://raw.githubusercontent.com/blopker/dictionaries/refs/heads/main/dictionaries/da/index.aff", + "https://raw.githubusercontent.com/blopker/dictionaries/refs/heads/main/dictionaries/da/index.dic", ), ] }); diff --git a/examples/da.md b/examples/da.md new file mode 100644 index 0000000..4758299 --- /dev/null +++ b/examples/da.md @@ -0,0 +1,7 @@ +# En forårsda ved kanalerne + +Mens den sidste vinterkole lansomt veg for den milde forårssol, vågnede Købmhavn i en palet af friske grønne nuancer og blomstrende tulipaner. Historiske kanalhuse, med deres karakteristise gavlfacader, spejlede sig i det rolige vand, hvor ænder svømmede stille forbi, og cyglister kørte hurtigt over broerne. + +På Nyhavn var terasserne allerede fule af menesker, der nød de første varme dage. Doften af friske vafler svævede fra boden på hjørnet, hvor turister og lokale beboere stod tålmodit i kø. Hr. Hansen, ejeren af den lille café ved kajen, hilste på sine stamgæster, mens han skænkede kaffe med rutinen fra en, der har gjort dette arbejde i tyve år. "Endelig godt vejr igen," sagde han smilene, mens forårssolen skinnede på de små borde. + +Den lokale panekagerestaurant, 'Hos Jensen', havde allerede tilpaset sæsonmenuen med friske aspages og jorbær. Ejerinden, en venlig kvinde med en smitende latter, arrangerede blomsterne på bordene, mens hun fortalte historier om kvarteret og dets beboer. Duften af nybate pandekager blannede sig med den af varm æbletærte, hvilket lokkede forbipasende til at komme indenfor til et måltid, der ville vare i timevis, som det sig hør og bør. Farve. Farwe. cykel hyggelit