Skip to content

Latin language pack (lat) — u/v & i/j normalization + macron stripping #23

Description

@bsesic

Summary

Add a Latin language pack (lat) to TRACE, mirroring the structure of the Arabic (ara, #16) and Greek (grc, #22) packs. Unlocks Vulgate, patristic, and scholastic material.

Motivation

Latin is a planned roadmap pack (Vulgata, patristic, scholastic) and part of the cross-tradition / Hexapla-style work (roadmap Stage 6). Reuses the language-pack architecture proven by the Arabic pack.

Scope

Mirror src/tracealign/lang/arabic/:

  • Normalization (normalize.py): lowercase; strip macrons / vowel-length diacritics (NFD + combining-mark removal) into text; orthographic skeleton folding — u/v unification, i/j unification, ae/æ → ae and oe/œ → oe. Keep the diplomatic form in Token.raw.
  • Tokenization (tokenize.py): Latin's analog to Arabic proclitics is the set of enclitics (-que, -ve, -ne). Start conservative — likely defer enclitic splitting for v0.1.0 (document it), or split only the unambiguous -que if justified.
  • Scoring tiers (scoring.py): EXACT → DIACRITICS_STRIPPED (macrons) → ORTHOGRAPHIC_VARIANT (u/v, i/j, ae/oe folding) → fuzzy, reusing the shared Reason enum values.

Acceptance criteria

  • list_languages() includes lat; tokenize/align with lang="lat" work end-to-end.
  • Orthographic normalization folds u/v and i/j and ae/oe into the skeleton; macrons stripped into text; diplomatic form preserved in raw.
  • Tiered scoring returns reason tags from the existing Reason enum (extend only if a genuinely Latin-specific reason is justified).
  • Tests follow TDD; full suite green on 3.10/3.11/3.12; flake8 clean.
  • pack.version set (lat-0.1.0) and surfaced in result params.

Notes

  • Rule-based and dependency-light (stdlib + existing rapidfuzz). 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