Skip to content

Rust pipeline - #3

Merged
blopker merged 5 commits into
mainfrom
rust-pipeline
Jun 11, 2026
Merged

Rust pipeline#3
blopker merged 5 commits into
mainfrom
rust-pipeline

Conversation

@blopker

@blopker blopker commented Jun 11, 2026

Copy link
Copy Markdown
Owner

No description provided.

blopker added 5 commits June 10, 2026 09:51
The upstream affix file used ICONV rules to map every Latin letter to
the digit 0, making Hunspell silently accept any Latin-script word as a
number. Remove those rules so Latin words are flagged as misspellings.

Document this and the earlier da patch in a new "Fork modifications"
section in the root readme, since the per-dictionary files are
regenerated. Also remove funding.yml and ignore tsconfig.tsbuildinfo.
Replace the JavaScript/shell pipeline (crawl.sh, generate.js, npm
toolchain) with a single Rust binary: crawl, build, generate, patch,
validate, readme, and all subcommands, each filterable with --only.

- Output per dictionary is now just index.aff, index.dic, and license;
  the npm packaging files (package.json, index.js, index.d.ts, readme)
  are removed from all dictionary dirs.
- Upstream sources live as declarative data in src/table.rs, ported
  from crawl.sh with provenance comments. Normalization is byte-faithful
  to the old iconv/sed pipeline.
- Fork-local fixes are a fail-loud patch registry (src/patches.rs):
  each patch asserts the exact upstream text it expects and errors when
  upstream changes. The readme patch list is generated from it.
- validate parses every dictionary with spellbook (what Codebook uses),
  offline. This found 8 dictionaries that did not parse at all (br, gl,
  hy, ia, la, mn, ne, tr) due to upstream typos; all are now patched.
- Six dictionaries whose upstreams disappeared are kept as frozen:
  fo, fur, hy, hyw, it, mk — validated but not regenerable.
- CI now runs cargo test + validate. A Makefile wraps common commands.
First full regeneration with the Rust pipeline. Content drift comes
from upstream branches that moved since the last crawl (mn was largely
rewritten upstream; br, cy, gl, hr, ne, rw, tr changed modestly; uk
only gained a trailing newline).

br, gl, hy, ia, la, mn, ne, and tr previously failed to parse with
spellbook (and so could not load in Codebook) due to upstream data
bugs — SFK/SFT typos for SFX, wrong affix rule counts, corrupted flag
lists, a doubled closing bracket, and Turkish using reserved flag 0.
All are fixed by the patches in src/patches.rs; hy is frozen (dead
upstream), so its fix is applied directly to the checked-in file.
lint, test, and validate, plus a check that the readme tables are in
sync with src/table.rs and src/patches.rs. Crawl/build/generate need
network and host tools, so they stay local. Full git history is fetched
because the patch tests read their fixtures from old commits.
Codebook already references dictionaries/grc and dictionaries/sa from
this repo, but they never existed here (404 at runtime). Add both:

- grc from mrakia/hunspell-ancient-greek (GPL-3.0), based on the
  Perseus Project's Morpheus word list. Parses cleanly.
- sa from Shreeshrii/hindi-hunspell (GPL-2.0). Upstream has stray
  carriage returns inside lines; a new patch repairs 109 dic entries
  and 6 affix rules where a CR is glued onto a word, and drops 119
  single-rule affix blocks whose strip/condition field is a bare CR
  (dead rules hunspell could never match either).

Both validate with spellbook and spot-check correctly with the
hunspell CLI (dictionary words accepted, garbage rejected).
@blopker
blopker merged commit 08e96f0 into main Jun 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant