From 99380d59be12989796ae1dca17d5c9069e381fab Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 9 Jul 2025 13:50:37 +0200 Subject: Better hunspell setup --- Makefile | 7 ++++--- README.md | 9 +++++++++ constance-ring.aff | 1 + constance-ring.dic | 6 ++++++ constance-ring.epub | Bin 250086 -> 250085 bytes dict | 6 ------ spellcheck-words | 4 ---- 7 files changed, 20 insertions(+), 13 deletions(-) create mode 120000 constance-ring.aff create mode 100644 constance-ring.dic diff --git a/Makefile b/Makefile index 7c903d7..169bf9d 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,7 @@ stage-6.md: stage-5.txt Makefile # This actually updates dict by sorting and removing leading numbers/spaces. dict.tmp: dict + touch dict.tmp cat dict |\ sed "s,^[0-9 ]*,," |\ sort |\ @@ -67,11 +68,11 @@ dict.tmp: dict uniq > dict.tmp && cp dict.tmp dict spellcheck: stage-6.md - hunspell -p dict -d nb_NO stage-6.md dict.tmp + hunspell -p $$(pwd)/dict -d nb_NO,constance-ring $< -spellcheck-words: stage-6.md dict.tmp +spellcheck-words: stage-6.md dict.tmp constance-ring.dic @echo hunspell - hunspell -p dict -d nb_NO -l < $< | sort | uniq -c | sort -n > $@.tmp + hunspell -p $$(pwd)/dict -d nb_NO,constance-ring -l < $< | sort | uniq -c | sort -n > $@.tmp @mv $@.tmp spellcheck-words constance-ring.epub: header.md stage-6.md spellcheck-words diff --git a/README.md b/README.md index 19b4f86..076c579 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,12 @@ For each word in `spellcheck-words`: This happends when the word is just too old. * Check with manual spellcheck with `make spellcheck`. This is more tedious as it runs through the entire document from the beginning. + +# Hunspell + +Hunspell has affix (.aff) files and dictionary (.dic) files. The documentation +claims that it should be possible to load single `.dic` files as "special +dictionaries", however I can't get that to work. + +However, the base Norwegian affix file can be used as the affix file for the +spellchecker by creating a symlink, problem solved. diff --git a/constance-ring.aff b/constance-ring.aff new file mode 120000 index 0000000..00f9af8 --- /dev/null +++ b/constance-ring.aff @@ -0,0 +1 @@ +/usr/share/hunspell/nb_NO.aff \ No newline at end of file diff --git a/constance-ring.dic b/constance-ring.dic new file mode 100644 index 0000000..465e062 --- /dev/null +++ b/constance-ring.dic @@ -0,0 +1,6 @@ +1000 +øie/BCDEFGHIJQQRSYyz +øine/CEGHJMRSTtz +øieblikk/BCGHJ +øielokk/BCG +# vim: set fileencoding=latin1 : diff --git a/constance-ring.epub b/constance-ring.epub index aca660d..373122a 100644 Binary files a/constance-ring.epub and b/constance-ring.epub differ diff --git a/dict b/dict index 64022e9..b40582f 100644 --- a/dict +++ b/dict @@ -188,12 +188,6 @@ ungkarløs vedblev vilde vinterstivnet -øie -øieblikk -øieblikket -øieblikks øiebrynene øiemedet -øine -øinene Ã¥stopper diff --git a/spellcheck-words b/spellcheck-words index 9c33276..f0ae26a 100644 --- a/spellcheck-words +++ b/spellcheck-words @@ -703,11 +703,7 @@ 1 XXXIV 1 ymitet 1 Ø - 1 øieblikkets - 1 øielokk - 1 øielokkene 1 øienvidne - 1 øiet 1 ølekast 1 ølmannen 1 ølnene -- cgit v1.2.3