Skip to content

Modernize for Python 3.9+ and add DSTU 9112:2021, ALA-LC tables (v2.0) - #11

Merged
dchaplinsky merged 4 commits into
masterfrom
claude/modernize-translit-ua
Jul 19, 2026
Merged

dchaplinsky merged 4 commits into
masterfrom
claude/modernize-translit-ua

Conversation

@dchaplinsky

@dchaplinsky dchaplinsky commented Jul 19, 2026 •

Copy link
Copy Markdown
Owner

Same treatment as visual-logging 2.0, plus new transliteration standards. Existing tables and behavior are unchanged — all doctests pass byte-for-byte.

New transliteration tables

  • UkrainianDSTU9112A / UkrainianDSTU9112B — DSTU 9112:2021, the current State Standard of Ukraine (approved April 2022, based on modified ISO 9:1995). Includes the standard's contextual rule separating consonant+й with an apostrophe (підйом → pid'jom). Outputs cross-validated against the MIT-licensed uklatn reference implementation on a real-word corpus (52/52 exact) and fuzz-tested over 6000 random strings — the only divergences are sequences impossible in Ukrainian orthography (e.g. word-initial soft sign), noted in the docstrings.
  • UkrainianALALC / UkrainianALALCModified — the ALA-LC library-catalog standard, full form with ligature ties (Знам'янка → Znam'i͡anka) and the simplified academic form (Znamianka).
  • RussianALALC — ALA-LC for russian.
  • UkrainianBGN2019 / UkrainianUNGEGN — aliases of UkrainianKMU: both bodies adopted the 2010 national system as-is. UkrainianBGN (1965) docstring now notes it is superseded.

Totals: 17 Ukrainian + 11 russian tables. Every new table has doctests.

Packaging

  • Replace setup.py/setup.cfg with pyproject.toml: version 2.0, requires-python >= 3.9, py.typed marker
  • Fixes source builds: setup.py reads its long description from README.rst, which no longer exists in the repo

Code

  • Python 2 shims removed; type hints on public functions; new TransliterationTable Protocol documents the table contract and types translit()'s signature

CI / releasing

  • tests.yml: doctests via pytest (config in pyproject.toml) on CPython 3.9–3.13 and PyPy; push runs scoped to master so PR commits run the matrix once
  • publish.yml: PyPI trusted publishing on v* tags or manual dispatch (needs one-time PyPI publisher registration: workflow publish.yml, environment pypi)

Docs

  • README: badges, Python 3.9+ note, new tables documented, changelog

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ha16zNy2fDMdrZBMQGgpBt

dchaplinsky and others added 3 commits July 19, 2026 12:29
…usted publishing

- Replace setup.py/setup.cfg with pyproject.toml (version 2.0); this also
  fixes source builds, which read the long description from README.rst —
  a file that no longer exists
- Drop the Python 2 compatibility shims (unicode_literals, text_type,
  object-inheriting classes); transliteration tables and behavior unchanged
- Add type hints to the public functions and ship a py.typed marker
- Run the doctest suite on GitHub Actions against CPython 3.9-3.13 and PyPy
- Add publish workflow: build and upload to PyPI via trusted publishing on
  v* tags or manual dispatch
- Refresh README: badges, Python 3.9+ note, changelog

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha16zNy2fDMdrZBMQGgpBt
- Describe the table interface with a TransliterationTable Protocol and
  use it in translit()'s signature instead of a bare 'type'; exported for
  users typing their own tables
- Move doctest collection into [tool.pytest.ini_options] so plain pytest
  runs the suite locally exactly as CI does
- Scope the push trigger to master so PR commits run the matrix once,
  not twice

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha16zNy2fDMdrZBMQGgpBt
- UkrainianDSTU9112A/B: the current State Standard of Ukraine (2022),
  including the contextual consonant-й apostrophe rule; outputs
  cross-validated against the uklatn reference implementation on a
  real-word corpus and fuzz-tested (divergence only on sequences
  impossible in Ukrainian orthography, noted in the docstrings)
- UkrainianALALC (full, with ligature ties) and UkrainianALALCModified
  (simplified academic form); RussianALALC
- UkrainianBGN2019 / UkrainianUNGEGN aliases of UkrainianKMU, since both
  bodies adopted the 2010 national system; UkrainianBGN docstring now
  notes it is the superseded 1965 system
- Doctests for every new table; README table lists, credits and
  changelog updated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha16zNy2fDMdrZBMQGgpBt
@dchaplinsky dchaplinsky changed the title Modernize for Python 3.9+: pyproject packaging, GitHub Actions CI, trusted publishing Modernize for Python 3.9+ and add DSTU 9112:2021, ALA-LC tables (v2.0) Jul 19, 2026
- UkrainianDSTU9112B references system A's consonant-й SPECIAL_CASES and
  PATTERN1 rather than repeating them
- UkrainianALALCModified reuses UkrainianKMU's DELETE_PATTERN for the
  soft sign and apostrophe removal

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha16zNy2fDMdrZBMQGgpBt
@dchaplinsky
dchaplinsky merged commit a16b606 into master Jul 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant