Add Arabic language pack (ara) — proclitic tokenization + orthographic normalization#21
Open
bsesic wants to merge 8 commits into
Open
Add Arabic language pack (ara) — proclitic tokenization + orthographic normalization#21bsesic wants to merge 8 commits into
bsesic wants to merge 8 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Arabic language pack (
ara) — the first non-Hebrew language pack, exercising and validating theLanguagePackabstraction. Closes #16.Rule-based and dependency-light (stdlib + existing
rapidfuzzonly), mirroring the structure ofsrc/tracealign/lang/hebrew/.What's included
tokenize.py): conservative proclitic splitting — splits the definite articleال, single-letter proclitics (و/ف/ب/ك) only before the article, and theلل(li- + article) contraction. Deliberately does not amputate word-initial radicals (وزير,باب,كتاب). Spans are contiguous (no separator character).normalize.py):strip_tashkil(NFC, remove combining marks + tatweel) intotext; orthographicskeletonfolding (alif variants → ا, ة → ه, ى → ي, hamza seats, bare hamza dropped). Diplomatic form preserved inToken.raw.scoring.py): four tiers —EXACT→DIACRITICS_STRIPPED→ORTHOGRAPHIC_VARIANT(skeleton) →ORTHOGRAPHIC(fuzzy).DIACRITICS_STRIPPED,ORTHOGRAPHIC_VARIANT.ArabicLanguagePack(code="ara",aliases=("arabic",),version="ara-0.1.0", emptyLexica()), wired via the side-effect-import +_BUILTIN_PACK_MODULESpattern.Design notes
docs/superpowers/specs/2026-06-24-arabic-language-pack-design.md.Testing
لل+كالcases, normalize, scoring tiers, registry, end-to-end align withlanguage_pack_versionin params).flake8 src/ tests/clean.Follow-up (non-blocking, from review)
details["layer"]label (Arabic"fuzzy"vs Hebrew"orthographic") — left as a deliberate design question.