aboutsummaryrefslogtreecommitdiff
path: root/spelling
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-02-06 03:35:26 -0300
committerEuAndreh <eu@euandre.org>2020-02-06 03:35:47 -0300
commit43c7f6385bac45ed67e381d968e7873e0fb8cff0 (patch)
tree01d6767f71e51c6ce274f7fa6414e215653949bb /spelling
parentAdd aliases to english Atom feed (diff)
downloadeuandre.org-43c7f6385bac45ed67e381d968e7873e0fb8cff0.tar.gz
euandre.org-43c7f6385bac45ed67e381d968e7873e0fb8cff0.tar.xz
WIP setup hunspell
Diffstat (limited to 'spelling')
-rwxr-xr-xspelling/check-spelling.sh38
-rw-r--r--spelling/en_US.aff.txt10
-rw-r--r--spelling/en_US.dic.txt11
-rw-r--r--spelling/fr_FR.dic.txt1
-rw-r--r--spelling/international.dic.txt50
-rw-r--r--spelling/pt_BR.dic.txt2
6 files changed, 112 insertions, 0 deletions
diff --git a/spelling/check-spelling.sh b/spelling/check-spelling.sh
new file mode 100755
index 0000000..653a5f9
--- /dev/null
+++ b/spelling/check-spelling.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+set -Eeuo pipefail
+
+HTML_DIR="${1:-}"
+[[ -z "${HTML_DIR}" ]] && {
+ echo 'Undefined input HTML_DIR.' >&2
+ exit 2
+}
+
+# Required by =sort= and =hunspell=
+export LANG=C.UTF-8
+
+for DICT in spelling/*.txt; do
+ diff <(sort "$DICT") "$DICT" || {
+ echo "The $DICT dictionary is unsorted. To fix it, run:" >&2
+ echo " LANG=C.UTF-8 sort $DICT | sponge $DICT" >&2
+ exit 1
+ }
+done
+
+finish() {
+ rm -f spelling.txt
+ rm -f dicts.txt
+}
+trap finish EXIT
+
+cat spelling/*.txt > dicts.txt
+
+find "${HTML_DIR}" -type f -name '*.html' | grep -v pastebin | hunspell -l -p dicts.txt -d fr_FR -d en_US -i utf-8 >> spelling.txt
+
+if [[ -s spelling.txt ]]; then
+ printf "\nvvv Mispelled words detected by hunspell.\n\n" >&2
+ sort < spelling.txt | uniq >&2
+ printf "\n^^^\n" >&2
+ exit 1
+else
+ echo "No words mispelled" >&2
+fi
diff --git a/spelling/en_US.aff.txt b/spelling/en_US.aff.txt
new file mode 100644
index 0000000..827c34f
--- /dev/null
+++ b/spelling/en_US.aff.txt
@@ -0,0 +1,10 @@
+aren
+couldn
+didn
+doesn
+isn
+pre
+sr
+ve
+wasn
+wouldn
diff --git a/spelling/en_US.dic.txt b/spelling/en_US.dic.txt
new file mode 100644
index 0000000..90a7531
--- /dev/null
+++ b/spelling/en_US.dic.txt
@@ -0,0 +1,11 @@
+autocommit
+curation
+declaratively
+decrypting
+programmatically
+realising
+repo
+reproducibility
+scriptable
+symlinks
+tradeoffs
diff --git a/spelling/fr_FR.dic.txt b/spelling/fr_FR.dic.txt
new file mode 100644
index 0000000..b402cff
--- /dev/null
+++ b/spelling/fr_FR.dic.txt
@@ -0,0 +1 @@
+dimanche
diff --git a/spelling/international.dic.txt b/spelling/international.dic.txt
new file mode 100644
index 0000000..f3637be
--- /dev/null
+++ b/spelling/international.dic.txt
@@ -0,0 +1,50 @@
+144p
+250GB
+32GB
+500GB
+81F90EC3CD356060
+8GB
+André
+BSON
+CI
+EuAndreh
+Fastmail
+GPLv3
+GitLab
+Gmail
+GuixSD
+JS
+Lerna
+Matroska
+Merkle
+NPM
+Nextcloud
+NixOS
+Pastebin
+Raku
+SSD
+Sourcehut
+Spacemacs
+Staltz
+VPN
+Yandex
+YouTube
+brainer
+buildGoModule
+ci
+dl
+guix
+html
+i5
+i7
+intbytes
+js
+libre
+merkle
+myrepos
+nixos
+no-brainer
+npm
+touchpad
+v8
+youtube
diff --git a/spelling/pt_BR.dic.txt b/spelling/pt_BR.dic.txt
new file mode 100644
index 0000000..7ed8a57
--- /dev/null
+++ b/spelling/pt_BR.dic.txt
@@ -0,0 +1,2 @@
+os
+sobre