Skip to content

Commit b860877

Browse files
committed
Add SJP dictionary to Polish spellcheck
1 parent 929849d commit b860877

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

‎.github/workflows/spellcheck.yml‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: Install dependencies
5050
run: |
5151
sudo apt-get update
52-
sudo apt-get install -y hunspell hunspell-pl
52+
sudo apt-get install -y curl hunspell hunspell-pl unzip
5353
make venv
5454
# Pospell needs newer Docutils than the Sphinx used by older branches.
5555
uv venv "$RUNNER_TEMP/spellcheck-venv"
@@ -64,6 +64,26 @@ jobs:
6464
sed -i 's/^SET .*/SET UTF-8/' "$RUNNER_TEMP/hunspell-utf8/pl_PL.aff"
6565
iconv -f "$dictionary_encoding" -t UTF-8 /usr/share/hunspell/pl_PL.dic \
6666
> "$RUNNER_TEMP/hunspell-utf8/pl_PL.dic"
67+
- name: Download SJP Polish dictionary
68+
run: |
69+
curl --fail --location --retry 3 \
70+
https://sjp.pl/sl/ort/sjp-hunspell-pl-20260901.zip \
71+
--output "$RUNNER_TEMP/sjp-hunspell.zip"
72+
echo "47a5ab02cf3def374994b1b03efd9fed2de868349b8ddcebac281b484353d157 $RUNNER_TEMP/sjp-hunspell.zip" \
73+
| sha256sum --check --strict
74+
# SJP wraps the dictionary files in a second ZIP archive.
75+
unzip -p "$RUNNER_TEMP/sjp-hunspell.zip" pl_PL.zip \
76+
> "$RUNNER_TEMP/sjp-pl_PL.zip"
77+
unzip -p "$RUNNER_TEMP/sjp-pl_PL.zip" pl_PL.aff \
78+
> "$RUNNER_TEMP/sjp-pl_PL.aff"
79+
unzip -p "$RUNNER_TEMP/sjp-pl_PL.zip" pl_PL.dic \
80+
> "$RUNNER_TEMP/sjp-pl_PL.dic"
81+
dictionary_encoding=$(sed -n 's/^SET //p' "$RUNNER_TEMP/sjp-pl_PL.aff")
82+
iconv -f "$dictionary_encoding" -t UTF-8 "$RUNNER_TEMP/sjp-pl_PL.aff" \
83+
> "$RUNNER_TEMP/hunspell-utf8/pl_SJP.aff"
84+
sed -i 's/^SET .*/SET UTF-8/' "$RUNNER_TEMP/hunspell-utf8/pl_SJP.aff"
85+
iconv -f "$dictionary_encoding" -t UTF-8 "$RUNNER_TEMP/sjp-pl_PL.dic" \
86+
> "$RUNNER_TEMP/hunspell-utf8/pl_SJP.dic"
6787
- name: Download Polish terminology glossary
6888
working-directory: cpython/Doc/locales/pl/LC_MESSAGES
6989
env:
@@ -90,7 +110,7 @@ jobs:
90110
env:
91111
DICPATH: ${{ runner.temp }}/hunspell-utf8
92112
run: >
93-
"$RUNNER_TEMP/spellcheck-venv/bin/pospell" --language pl_PL
113+
"$RUNNER_TEMP/spellcheck-venv/bin/pospell" --language pl_PL,pl_SJP
94114
--personal-dict "$RUNNER_TEMP/hunspell-glossary.dic"
95115
--glob 'locales/pl/LC_MESSAGES/**/*.po'
96116
# PO updates exist only in this disposable checkout; nothing is committed.

0 commit comments

Comments
 (0)