Skip to content

Greek language pack (grc) — polytonic diacritic stripping + orthographic normalization #22

Description

@bsesic

Summary

Add a Greek language pack (grc) to TRACE, mirroring the structure of the Arabic (ara, #16) and Hebrew (hbo) packs. Second classical pack; unlocks LXX, New Testament, and patristic material.

Motivation

Greek is a planned roadmap pack (LXX, NT, patristic) and a prerequisite for the cross-tradition / Hexapla-style work (roadmap Stage 6). It reuses the language-pack architecture proven by the Arabic pack.

Scope

Mirror src/tracealign/lang/arabic/:

  • Normalization (normalize.py): strip polytonic diacritics (acute/grave/circumflex accents, smooth/rough breathings, iota subscript, diaeresis) as a representations skeleton — via NFD + combining-mark (Mn) removal. Fold final sigma ς → σ; lowercase; optional lunate-sigma handling. Keep the diplomatic form in Token.raw; text = diacritic-stripped.
  • Tokenization (tokenize.py): Greek has no Arabic-style proclitics; the main concern is elision (apostrophe) and possibly enclitics. Start conservative — likely a near-identity post_tokenize; document what is deferred.
  • Scoring tiers (scoring.py): EXACT → DIACRITICS_STRIPPED → ORTHOGRAPHIC_VARIANT (sigma/case folding) → fuzzy, reusing the shared Reason enum values already added for Arabic.

Acceptance criteria

  • list_languages() includes grc; tokenize/align with lang="grc" work end-to-end.
  • Polytonic → monotonic folding collapses accent/breathing variants into the skeleton; final sigma normalized; diplomatic form preserved in raw.
  • Tiered scoring returns reason tags from the existing Reason enum (extend only if a genuinely Greek-specific reason is justified).
  • Tests follow TDD; full suite green on 3.10/3.11/3.12; flake8 clean.
  • pack.version set (grc-0.1.0) and surfaced in result params.

Notes

  • Rule-based and dependency-light (stdlib + existing rapidfuzz), consistent with the project ethos. No new third-party dependencies.
  • Roadmap: planned non-Hebrew language packs (Aramaic/Greek/Latin/Arabic/Persian).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions