feat: reversible SLP1 anunāsika (m̐ → M~) vs anusvāra (ṃ → M)#3
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ISO 15919 distinguishes anunāsika
m̐from anusvāraṃ, but standard SLP1 uses asingle token
Mfor both, soISO → SLP1 → ISOlost the distinction. Them̐row now emits a project-specific extended SLP1 token
M~, whileṃkeeps plainM, making the pair reversible.Contract
am̐aM~aṃaMaM~am̐aMaṃM → ṃis preserved by the existing first-win rule (theṃrowprecedes the
m̐row).M~ → m̐works because the matcher sorts source tokens longest-first, so the2-char
M~is matched before bareM.M~is a deliberate, reversible, non-standard SLP1 extension. Consumersneeding strict external SLP1 should strip a trailing
~(documented in README).Changes
SanskritTransliteration/transliteration_table.csv—m̐row SLP1 columnM→M~; all other rows/columns unchanged.tests/test_transliteration.py— newTestReversibleAnunasika(6 tests:4 contract cases + 2 ISO round-trips).
README.md— new "SLP1 Anunāsika Extension" section.Verification
uv run pytest→ 20 passeduv run ruff check/uv run ruff format --check→ cleanuv run ty check SanskritTransliteration tests→ cleanCloses #2
🤖 Generated with Claude Code