Skip to content

feat: add misspell-ar package v0.1.0 - #242

Merged
smeech merged 6 commits into
espanso:mainfrom
hosam00:add-misspell-ar
Sep 25, 2026
Merged

smeech merged 6 commits into
espanso:mainfrom
hosam00:add-misspell-ar

Conversation

@hosam00

@hosam00 hosam00 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds misspell-ar — Arabic typo auto-corrector package (~6,100 corrections), co-developed with an AI assistant.

Contents (packages/misspell-ar/0.1.0/):

  • _manifest.yml — name, title, description, version 0.1.0, author, tags
  • package.yml — 6,063 word: true matches
  • README.md — docs, usage, contribution notes, attribution

Match composition:

  • ~3,000 taa marbouta/هaa fixes (ة→ه), stem-collision filtered to avoid pronominal-suffix false hits (فتحه vs فتحة)
  • ~2,750 def. article + hamza fixes (الأ/الإ/الآ→الا) — structurally unambiguous
  • ~350 curated entries: tanween, ض/ظ, madda, religious phrases, names, places, ى/ي endings

Generation: rule-based pipeline over hermitdave/FrequencyWords Arabic corpus (CC-BY-SA-4.0, attributed in README). Generator included in the source repo for reproducibility.

Validation: passes the hub validator locally (uv run .github/scripts/validate/main.py → misspell-ar... OK).

Safety note: all generated rules avoid overwriting valid words; word: true only on single-word triggers (multi-word triggers drop it to avoid an espanso known bug where the trigger is deleted without replacement).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Multiple correction rules produce invalid text or corrupt valid words and must be fixed before publication.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity · 2 Medium severity · 1 Low severity

Open (5)
What changed in this PR

Adds misspell-ar v0.1.0, an Espanso package with over 6,000 Arabic typo corrections.

Changes:

  • Adds generated Arabic correction matches.
  • Adds package metadata and documentation.
  • Documents usage, contribution, and corpus attribution.
File Description
packages/​misspell-ar/​0.1.0/​README.md Documents installation, usage, generation, and attribution.
packages/​misspell-ar/​0.1.0/​_manifest.yml Defines package metadata, version, and tags.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/misspell-ar/0.1.0/package.yml Outdated
Comment thread packages/misspell-ar/0.1.0/package.yml Outdated
Comment thread packages/misspell-ar/0.1.0/package.yml Outdated
Comment thread packages/misspell-ar/0.1.0/package.yml Outdated
Comment thread packages/misspell-ar/0.1.0/README.md Outdated
@hosam00

hosam00 commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all review findings. Regenerated package: 6,063 → 4,953 matches.

HIGH — الاستجابة→الإستجابة / alif-wasl family: pairs are now kept only when the hamza form clearly dominates the plain form in corpus frequency (الإسلام/الاسلام ratio ~6x kept; الإستجابة/الاستجابة ~0.9x dropped). Generator also refuses إ after ال- in the ة→ه rule. Verified absent: الاستجابة→الإستجابة, بالاستجابة→بالإستجابة, الاتجاهات→الإتجاهات, الاعتراف→الإعتراف (+بال/وال variants).

HIGH — مشابه→مشابة: corpus variant frequencies are now summed across tatweel/haraka duplicates (previously last-write-wins flattened ratios to 1.0 and let junk through); مشابة/مشابه ≈ 0.03x → dropped.

MEDIUM — الأتجاه→الأتجاة: dropped (~0.1x). MEDIUM — مستائة: ائة-suffixed junk excluded in the ة→ه rule (correct form is مستاءة).

LOW — reproducibility: generator scripts/gen.py lives in the package's source repository and is documented in the README; the hub package ships only the generated dictionary. Corpus pinned at scripts/ar_full.txt (FrequencyWords, CC-BY-SA-4.0) for byte-identical regeneration.

Verified locally: espanso match list loads the package; official hub validator passes.

@smeech

smeech commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Addressed all review findings. Regenerated package: 6,063 → 4,953 matches.

I don't think your amended files have made it through to the PR, I'm afraid, and we now have six files in two directories.

😦

@hosam00

hosam00 commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Fixed — apologies. My earlier attempt stacked corrected copies at the repo root instead of replacing the package files, so the PR briefly had six files across two directories (and the package file inside packages/ was still the old 6,063-match version). The branch now contains only:

  • packages/misspell-ar/0.1.0/package.yml (4,953 matches)
  • packages/misspell-ar/0.1.0/_manifest.yml
  • packages/misspell-ar/0.1.0/README.md

All five Copilot findings (alif-wasl corruption, مشابه→مشابة, الأتجاه→الأتجاة, مستائة, generator reproducibility note) are addressed in the regenerated package. A fresh review would be appreciated.

@smeech

smeech commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Can you attend to the issues in the other two files?

@hosam00

hosam00 commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Attended to both files:

  • _manifest.yml — added homepage: https://github.com/hosam00/misspell-ar.
  • README.md — the generator sentence now links the actual source repository (scripts/gen.py is public there, with the FrequencyWords corpus pinned for byte-identical regeneration), so the reproducibility path is verifiable from the submitted files.

@smeech smeech left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rerun Copilot and the automated checks.
Some of my original comments are still outstanding and I've made a couple more, I'm afraid. Thank you for your patience.

Comment thread packages/misspell-ar/0.1.0/_manifest.yml
Comment thread packages/misspell-ar/0.1.0/_manifest.yml
Comment thread packages/misspell-ar/0.1.0/README.md Outdated
Comment thread packages/misspell-ar/0.1.0/README.md Outdated
Comment thread packages/misspell-ar/0.1.0/README.md Outdated
Comment thread packages/misspell-ar/0.1.0/README.md
Comment thread packages/misspell-ar/0.1.0/README.md Outdated
@hosam00

hosam00 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Round 2 done — all points addressed:

  • Tags: added spell-correction and typofixer alongside the existing ones.
  • homepage: present (https://github.com/hosam00/misspell-ar).
  • README: dropped "official", removed the manual espanso restart line (Espanso reloads automatically on install).
  • Contributing: now directs contributors to open PRs against the source repository (hosam00/misspell-ar), with the generator + corpus linked for reproducible additions.
  • Generator: kept out of the hub package, accessible via the source repo link as suggested.

Hub validator passes on the updated files.

@smeech
smeech merged commit b75b5ba into espanso:main Sep 25, 2026
1 check 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.

3 participants