The official Python runtime for Interscript — deterministic transliteration over the interscript map corpus (300+ authority-backed systems: BGN/PCGN, ISO, UN, ALA-LC, ODNI, ICAO, DIN, and others).
This version (0.2.0) parses the .imp map DSL directly — no
pre-compiled Python map modules or monorepo bootstrap required. Point
it at the map corpus and go.
Maps that need vocalized input (undiacritized Arabic, nikud-less Hebrew, unsegmented Thai) dispatch to a secryst crystal through the optional phonological layer; see the phonological-layer documentation on our site.
importinterscriptinterscript.add_load_path(".../interscript/maps/maps")
interscript.transliterate("un-bul-Cyrl-Latn-1977", "нос Бяга БЯГА")
# -> "nos Byaga BYAGA"add_load_path(path)— register a directory containing.imp/.iscmap filesmap_exist(name)— check whether a map is availablemap_list()— list all discoverable map namesload_map(name)— parse and cache a map (returns anEngine)transliterate(name, text)— apply a map to text
The engine passes maps' own embedded tests with the following scores; remaining gaps are documented in the test suite:
| map | embedded tests | gap |
|---|---|---|
un-bul-Cyrl-Latn-1977 | 98/98 | none |
un-ell-Grek-Latn-1987-ts | 206/242 | posix letter-class guards |
bgnpcgn-prs-Arab-Latn-2007 | loads, runs | proper-noun capitalization |
parser.py—.impDSL parser: metadata (incl.|block scalars), tests, dependency declarations, stages, parallel groups, sub expressionsexpr.py— expression layer:any("…")char classes,any("a".."z")ranges,any(["x","y"])alternations,maybe("…"),space,boundary,line_start/line_end,+concatenation,before:/after:context guardsengine.py— executor: parallel subs (longest-match-wins + word-aware casing),substregex,run(dependency-aliased dotted targets), compose/decompose, downcase/upcase/titlecase
Ruby:
gem install interscript(https://rubygems.org/gems/interscript)npm:
npm install interscript(https://www.npmjs.com/package/interscript)This:
pip install interscript
BSD-2-Clause. See LICENSE.adoc.