Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

interscript-py

The Python leg of the Interscript deterministic transliteration engines (siblings: interscript-ruby, interscript-js). Parity matters: a map must produce identical output in every engine, and maps that need the phonological layer dispatch to a secryst crystal (pip install secryst).

Status (v0.1.0, 2026-08-19) — honest scope

Implemented against the real interscript/maps corpus (289 .imp maps):

  • .imp DSL parsing: metadata (incl. | block scalars), embedded tests, dependency, stages.
  • Executor: parallel { sub } with longest-match-wins AND the interscript-ruby casing convention (uppercase result inside ALL-CAPS words: БЯГАBYAGA, БягаByaga), subst regex, run, compose/decompose, downcase/upcase/titlecase.
  • Unsupported constructs (sub with after:/before: contexts, any(), boundary, secryst/rababa) raise ExecutionError by default, or are recorded in engine.skipped_unsupported with on_unsupported="skip".

Expression layer (v0.2): any("…") char classes, any("a".."z") ranges, any(["x","y"]) alternations, maybe("…"), space, boundary, line_start/line_end, + concatenation, and before:/after: context guards compiled to lookarounds. Dependency-aliased dotted run map.<alias>.stage.<name> targets resolve through the map's own dependency …, as: … table.

Measured against the maps' own embedded tests (2026-08-20):

mapresultremaining gap
un-bul-Cyrl-Latn-197798/98none
un-ell-Grek-Latn-1987-ts206/242posix letter-class guards (libs aliases)
bgnpcgn-prs-Arab-Latn-2007loads, runsproper-noun capitalization + diphthong context rules

Roadmap: posix alias resolution (libs/*.iml) → capitalization semantics for caseless scripts → .isc YAML front-end (shares this executor) → golden parity vs interscript-ruby across all 289 maps.

Use

importinterscriptinterscript.add_load_path(".../interscript/maps/maps")
interscript.transliterate("un-bul-Cyrl-Latn-1977", "нос Бяга БЯГА")
# -> "nos Byaga BYAGA"

Test

python3 -m pytest tests

License: BSD-3-Clause.

About

Archived MVP — superseded by interscript/interscript-py (direct .imp engine)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages