The plan said "Hunspell pt-PT vendored like en-US". Measuring that first is what saved it: nspell expands affixes eagerly on construction, and European Portuguese's 1,340 rules over 44,257 stems want over a gigabyte of browser heap — ~340 MB for the first 12,000 entries, and no return at all after three minutes on the whole file. So the expansion runs once at build time instead: 1,039,058 forms, 2.66 MB gzipped, read by the same nspell in 842 ms. The obvious npm package would also have shipped the wrong language. Both dictionary-pt and dictionary-pt-br carry VERO, the Brazilian word list, so vendoring by name puts pt-BR spellings behind a pt-PT label — the drift SUGGESTIONS §3 warns about, arriving through the packaging where no reviewer can see it. The source is Projecto Natura's, and the build script now asserts the fault lines (receção in, recepção out) before writing anything. Spellcheck consults both dictionaries and flags only what both reject, which is the no-detector answer to a pair with no script boundary. The word card does the same in the other direction: "data" is a word in both languages, so Petal shows both readings rather than guessing which she meant. Writing the tests caught the one real bug — extendedAlphabet was a snapshot while correct/suggest read live, and her dictionary arrives after English, so every lookup would have resolved "cora" while the underlines were already right. Not done, and not claimed: the pack has not been read by a pt-PT speaker, and the Piper voice is deferred with the deploy. Claude-Session: https://claude.ai/code/session_016y6gyuHkQXPiEuW8RGQyua
33 lines
1.5 KiB
Plaintext
33 lines
1.5 KiB
Plaintext
European Portuguese spelling dictionary
|
|
=======================================
|
|
|
|
The word list in `pt-PT.dic.gz` and the suggestion directives in `pt-PT.aff` are
|
|
derived from the LibreOffice/Projecto Natura Hunspell dictionary for European
|
|
Portuguese (`pt_PT.aff` / `pt_PT.dic`), as packaged by Debian/Ubuntu in
|
|
`hunspell-pt-pt`.
|
|
|
|
Copyright (C) 2006-2012 José João de Almeida <jj@di.uminho.pt>
|
|
Rui Vilela <ruivilela@di.uminho.pt>
|
|
Alberto Simões <ambs@di.uminho.pt>
|
|
Universidade do Minho — Projecto Natura
|
|
|
|
License: GPL-2 or LGPL-2.1 or MPL-1.1
|
|
(Petal redistributes it under the MPL-1.1 option.)
|
|
|
|
Upstream: https://natura.di.uminho.pt/ — via
|
|
https://git.libreoffice.org/dictionaries/+/refs/heads/master/pt_PT
|
|
|
|
What Petal changed
|
|
------------------
|
|
|
|
Nothing about which words are correct. `scripts/build_ptpt_dictionary.py`
|
|
applies the upstream affix rules ahead of time — Hunspell's PFX/SFX expansion
|
|
run once at build time instead of once per browser — and writes the resulting
|
|
1,039,058 surface forms as a flat word list. The shipped `.aff` keeps only
|
|
upstream's TRY/KEY/REP/MAP/WORDCHARS lines, which shape *corrections* rather
|
|
than membership. See that script's header for why the dictionary could not be
|
|
vendored in its original form.
|
|
|
|
Note that npm's `dictionary-pt` is *not* this dictionary: both it and
|
|
`dictionary-pt-br` package the Brazilian VERO word list.
|