Visitar URL original
Pospell check by m-aciek · Pull Request #153 · python/python-docs-pl · GitHub
Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add SJP dictionary to Polish spellcheck
  • Loading branch information
m-aciek committed Oct 7, 2026
commit b86087701ea32a76e39f1d7831b00ca60a4f38b2
24 changes: 22 additions & 2 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y hunspell hunspell-pl
sudo apt-get install -y curl hunspell hunspell-pl unzip
make venv
# Pospell needs newer Docutils than the Sphinx used by older branches.
uv venv "$RUNNER_TEMP/spellcheck-venv"
Expand All @@ -64,6 +64,26 @@ jobs:
sed -i 's/^SET .*/SET UTF-8/' "$RUNNER_TEMP/hunspell-utf8/pl_PL.aff"
iconv -f "$dictionary_encoding" -t UTF-8 /usr/share/hunspell/pl_PL.dic \
> "$RUNNER_TEMP/hunspell-utf8/pl_PL.dic"
- name: Download SJP Polish dictionary
run: |
curl --fail --location --retry 3 \
https://sjp.pl/sl/ort/sjp-hunspell-pl-20260901.zip \
--output "$RUNNER_TEMP/sjp-hunspell.zip"
echo "47a5ab02cf3def374994b1b03efd9fed2de868349b8ddcebac281b484353d157 $RUNNER_TEMP/sjp-hunspell.zip" \
| sha256sum --check --strict
# SJP wraps the dictionary files in a second ZIP archive.
unzip -p "$RUNNER_TEMP/sjp-hunspell.zip" pl_PL.zip \
> "$RUNNER_TEMP/sjp-pl_PL.zip"
unzip -p "$RUNNER_TEMP/sjp-pl_PL.zip" pl_PL.aff \
> "$RUNNER_TEMP/sjp-pl_PL.aff"
unzip -p "$RUNNER_TEMP/sjp-pl_PL.zip" pl_PL.dic \
> "$RUNNER_TEMP/sjp-pl_PL.dic"
dictionary_encoding=$(sed -n 's/^SET //p' "$RUNNER_TEMP/sjp-pl_PL.aff")
iconv -f "$dictionary_encoding" -t UTF-8 "$RUNNER_TEMP/sjp-pl_PL.aff" \
> "$RUNNER_TEMP/hunspell-utf8/pl_SJP.aff"
sed -i 's/^SET .*/SET UTF-8/' "$RUNNER_TEMP/hunspell-utf8/pl_SJP.aff"
iconv -f "$dictionary_encoding" -t UTF-8 "$RUNNER_TEMP/sjp-pl_PL.dic" \
> "$RUNNER_TEMP/hunspell-utf8/pl_SJP.dic"
- name: Download Polish terminology glossary
working-directory: cpython/Doc/locales/pl/LC_MESSAGES
env:
Expand All @@ -90,7 +110,7 @@ jobs:
env:
DICPATH: ${{ runner.temp }}/hunspell-utf8
run: >
"$RUNNER_TEMP/spellcheck-venv/bin/pospell" --language pl_PL
"$RUNNER_TEMP/spellcheck-venv/bin/pospell" --language pl_PL,pl_SJP
--personal-dict "$RUNNER_TEMP/hunspell-glossary.dic"
--glob 'locales/pl/LC_MESSAGES/**/*.po'
# PO updates exist only in this disposable checkout; nothing is committed.