Skip to content

Phase 1a: சீர்.g4 — positional ஐ scansion, ஔ fix, காய்/கனி ordering, EOF - #11

Merged
srix merged 8 commits into
phase1/parser-helperfrom
phase1/seer-grammar
Sep 20, 2026
Merged

srix merged 8 commits into
phase1/parser-helperfrom
phase1/seer-grammar

Conversation

@srix

@srix srix commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Roadmap Phase 1a from specs/2026-09-20-revival-and-roadmap.md. Stacked on #10 (base phase1/parser-helper).

Closes the two long-standing xfails (தண்மையும் → கூவிளம்; இணைக்குறள் ஆசிரியப்பா) and fixes three more defects found while diagnosing them:

defect before after
every ஐ syllable listed only as நெடில் தண்மையும் = தேமாங்காய் கூவிளம் (positional rule: foot-initial ஐ long, later ஐ short)
'ஒள' typo for 'ஔ' ஔவை unlexable, ஒளியும் = தேமா தேமா / புளிமா
காய் and கனி interleaved in மூவசை வழிபடுக = புளிமாங்கனி கருவிளங்காய்
no EOF தண்மையும்xx "parsed" lexer error at 1:9

Also: வெண்பா.g4 no longer shadows the imported foot rules (it silently overrode them), and both importing grammars use the shared NL token and end with EOF, so trailing garbage after a poem is now reported.

Hand-checked: கையினை stays கூவிளம் (foot-initial ஐ must not flip to புளிமா), கிறை stays மலர், Kural 467 and நளவெண்பா 1 scan unchanged.

Suite: 116 passed, 9 xfailed (all known சொல்.g4 gaps).

Review the grammar only: git diff origin/phase1/parser-helper origin/phase1/seer-grammar -- 'pytamil/தமிழ்/resources/*.g4' pytamil/tests

🤖 Generated with Claude Code

Grammar (pytamil/தமிழ்/resources/சீர்.g4, rewritten with a header that
states the ambiguity policy):
- ஐ with a consonant (கை மை லை ...) moves out of நெடில் into a new
  ஐகாரக்குறுக்கம் rule. A foot-initial நிரை (முதல்நிரை) must start with a
  true குறில்; a later நிரை may start with a shortened ஐ. So தண்/மையும்
  = நேர் நிரை = கூவிளம் while கை/யினை stays கூவிளம் and கை/யும் தேமா.
  Word-initial bare ஐ remains நெடில். Decision: positional rule
  (specs/2026-09-20-revival-and-roadmap.md, Phase 1a).
- 'ஒள' (two code points) -> 'ஔ' (U+0B94). ஔவை could not be lexed;
  ஒளியும் scanned as தேமா, now புளிமா.
- மூவசை/நாலசை alternatives reordered so every காய் precedes any கனி:
  வழிபடுக was புளிமாங்கனி, now கருவிளங்காய்.
- Start rule ends with EOF; I and NL are real lexer rules shared with
  the importing grammars.

வெண்பா.g4: drop the local copies of தேமா..கூவிளங்காய் that shadowed the
import (the fix would not have applied to venba otherwise); மலர்/பிறப்பு
use முதல்நிரை; NL instead of '\n'; EOF on the start rule; delete ~50
lines of commented-out duplicate token tables.
ஆசிரியப்பா.g4: NL and EOF.
Regenerated சீர், வெண்பா, ஆசிரியப்பா (codegen.sh, ANTLR 4.13.2).

Tests: the two xfails (தண்மையும், இணைக்குறள் ஆசிரியப்பா) are removed and
pass; new சீர் cases for தேமா, புளிமா, கூவிளம், கருவிளங்காய் covering
each fix. pytest: 116 passed, 9 xfailed (all சொல்.g4 gaps).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
srix and others added 7 commits September 20, 2026 16:29
இலக்கணக் கருத்துகள் (அசை, சீர், ஐகாரக்குறுக்கம், மாற்றுத் தேர்வு நெறி) தமிழிலே
விளக்கப்பட வேண்டும்; ANTLR நுட்பம் மட்டும் ஆங்கிலம். Generated code unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
.github/workflows/test.yml
- pytest job, matrix 3.10 / 3.12, pip install -r requirements.txt.
- codegen-drift job: installs Java, runs codegen.sh and fails if anything
  under pytamil/தமிழ்/codegen differs, so the committed parsers can never
  fall out of sync with the .g4 grammars.

requirements.txt: PyYAML 6.0 -> 6.0.2. 6.0 fails to build on Python 3.12
(Cython 3 build_ext incompatibility); 6.0.2 supports 3.8-3.13. Verified
locally: 116 passed, 9 xfailed on both 3.10 and 3.12.

Roadmap Phase 1d (specs/2026-09-20-revival-and-roadmap.md).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…up-java v5)

The first run warned that v4/v5 of these target the deprecated Node 20 runtime.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@srix
srix merged commit 27d23ff into phase1/parser-helper Sep 20, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
github-pages — 27d23ff6 Deployed Sep 20, 2026 by srix via deploy #9
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