Skip to content

💥 Transliterate Grantha letters, with their vowel forms, by default - #1107

Merged
rathesDot merged 1 commit into
mainfrom
grantha-syllables
Oct 23, 2026
Merged

rathesDot merged 1 commit into
mainfrom
grantha-syllables

Conversation

@rathesDot

@rathesDot rathesDot commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Words with Grantha letters came out half in Tamil script: getIso15919('ஜன்னல்') gave ஜṉṉal, and getIPA('சந்தோஷம்') gave t͡ɕan̪toːஷm. Two reasons:

  • grantha.json held only the six bare consonants (ஜ், ஷ், …). A Grantha letter with a vowel (ஜ, ஜா, ஷோ) was never mapped, even with { grantha: true }.
  • Grantha was off unless the caller asked for it. learn-tamil.com never did, so some live dictionary titles show Tamil letters, for example tuஷ்pirayōkam.

Change

  • grantha.json has the same shape as script.json: one row per Grantha consonant (ஜ், ஶ், ஷ், ஸ், ஹ், க்ஷ்), with the dead consonant followed by its 12 vowel forms. index continues from script.json (247–324). I generated the rows from the six existing consonants and script.json's vowel row, nothing typed by hand.
  • Grantha is on by default. { grantha: false } keeps the old behaviour. The only change in index.ts is that default; the lookup is unchanged.
  • Tests: the granthaScript snapshot and its shape (6 rows × 13), plus words with Grantha syllables.
  • README: updated to match.
Tamil ISO 15919 IPA
ஜன்னல் jaṉṉal d͡ʑannal
சந்தோஷம் cantōṣam t͡ɕan̪toːʂam
கஷ்டம் kaṣṭam kaʂɖam
ஹோட்டல் hōṭṭal hoːɖɖal
பக்ஷி pakṣi pakʂi

Breaking

  • Default output changes: text with Grantha letters is now transliterated without the option.
  • Data shape changes: granthaScript rows grow from 1 entry to 13.

So this should be released as 1.0.0. I'll open the release pull request once this is merged, as CLAUDE.md describes. learn-tamil.com only looks letters up with .flat().find(...), so the shape change doesn't affect it.

Note: ஸ்ரீ gives srī, not the conventional śrī. It's written with ஸ (s), and I didn't add a special case.

Checks

pnpm test (8 passed, script snapshot unchanged, new granthaScript snapshot), pnpm eslint, pnpm tsc --noEmit and pnpm format --check all pass.

@rathesDot
rathesDot force-pushed the grantha-syllables branch 2 times, most recently from d557720 to 253ef1a Compare October 23, 2026 10:44
@rathesDot rathesDot changed the title ✨ Transliterate Grantha letters with a vowel, by default 💥 Transliterate Grantha letters, with their vowel forms, by default Oct 23, 2026
ஜன்னல் gave 'ஜṉṉal': grantha.json held only the six bare consonants
(ஜ் …), and only with { grantha: true }. Each consonant now has its full
row of vowel forms, shaped like script.json and numbered on from it, and
Grantha is on unless { grantha: false }. This changes default output.
@rathesDot
rathesDot merged commit 99ee15e into main Oct 23, 2026
4 checks passed
@rathesDot
rathesDot deleted the grantha-syllables branch October 23, 2026 10:47
This was referenced Oct 23, 2026
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