Skip to content

feat: reversible SLP1 anunāsika (m̐ → M~) vs anusvāra (ṃ → M)#3

Merged
Yuzki merged 1 commit into
mainfrom
feat/reversible-slp1-anunasika
Jun 29, 2026
Merged

feat: reversible SLP1 anunāsika (m̐ → M~) vs anusvāra (ṃ → M)#3
Yuzki merged 1 commit into
mainfrom
feat/reversible-slp1-anunasika

Conversation

@Yuzki

@Yuzki Yuzki commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

ISO 15919 distinguishes anunāsika from anusvāra , but standard SLP1 uses a
single token M for both, so ISO → SLP1 → ISO lost the distinction. The
row now emits a project-specific extended SLP1 token M~, while keeps plain
M, making the pair reversible.

Contract

Input From → To Output
am̐ iso → slp1 aM~
aṃ iso → slp1 aM
aM~ slp1 → iso am̐
aM slp1 → iso aṃ
  • Reverse M → ṃ is preserved by the existing first-win rule (the row
    precedes the row).
  • M~ → m̐ works because the matcher sorts source tokens longest-first, so the
    2-char M~ is matched before bare M.
  • M~ is a deliberate, reversible, non-standard SLP1 extension. Consumers
    needing strict external SLP1 should strip a trailing ~ (documented in README).

Changes

  • SanskritTransliteration/transliteration_table.csv row SLP1 column
    MM~; all other rows/columns unchanged.
  • tests/test_transliteration.py — new TestReversibleAnunasika (6 tests:
    4 contract cases + 2 ISO round-trips).
  • README.md — new "SLP1 Anunāsika Extension" section.

Verification

  • uv run pytest → 20 passed
  • uv run ruff check / uv run ruff format --check → clean
  • uv run ty check SanskritTransliteration tests → clean

Closes #2

🤖 Generated with Claude Code

ISO 15919 distinguishes anunasika m̐ from anusvara ṃ, but both mapped to SLP1 M, so ISO -> SLP1 -> ISO lost the distinction. The m̐ row now emits the project-specific extended SLP1 token M~ while ṃ keeps plain M, making the pair reversible. Reverse M -> ṃ is preserved by the first-win rule; M~ -> m̐ works because the matcher sorts source tokens longest-first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Yuzki
Yuzki merged commit 30f80d4 into main Jun 29, 2026
3 checks passed
@Yuzki
Yuzki deleted the feat/reversible-slp1-anunasika branch June 29, 2026 01:54
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.

Decide reversible handling for ISO anunāsika m̐ vs anusvāra ṃ in SLP1

1 participant