Tamil grammar in silicon

The Tamil noun as a grammar: structure, endings and joining rules

This page is the reference behind Parts 1 and 2. It sets out the order of the parts of a noun, the endings with the verse behind each, and the rules that join them, over TLP1, the one-byte-per-sound encoding. Where a verse says it, the row names the verse. Where none does, the row says so.

The word, slot by slot

A noun form is a stem followed, in this order, by an optional plural or oblique-stem marker, an optional case with an extension that only some cases take, and an optional particle. The slots are written below in EBNF. The names in quotes are the feature labels of the reference lexicon, ThamizhiMorph.

noun_form = "noun", [ stem_kind ], [ case_part ], [ particle ] ;   (* the order of the slots *)
stem_kind = "infInc" | "pl" ;   (* infInc: the oblique stem with the இன் சாரியை; pl: the plural கள் *)
case_part = "nom", [ "cmpr" ]
          | "acc", [ "vpart" | "vpartp" ]
          | "dat", [ "ben" | "n" | "pl" ]
          | "inst"
          | "loc"
          | "abl"
          | "gen"
          | "soc"
          | "so" ;   (* a case; only some cases take an extension *)
particle  = "foc" | "psp" | sandhi ;   (* foc தான், psp a postposition, or a joining consonant at a word boundary *)
sandhi    = "sandhik" | "sandhic" | "sandhip" | "sandhit" ;   (* க் ச் ப் த் *)

The optional slots are the point. Naṉṉūl 243 says a சாரியை may appear, drop out or be optional, and Naṉṉūl 253 does not say which. So the grammar licenses a set of forms for each slot, and the output is that set.

This is a grammar of order, not of which combinations a given noun takes. That depends on the noun's class. The reference grid the chip is measured against uses 81 feature bundles. The grammar accepts all 81 and licenses 336 combinations in all. The model derives 67 of the 81; the other 14 carry labels it has no ending for (psp, a postposition, and n, vpart, vpartp). python3 tools/check_noun_grammar.py reruns this check.

The endings

Twenty-three endings, one row per label. Some labels give more than one form. infInc (the oblique stem) and nom (the bare name) have no ending of their own.

labelendingbasis
plகள்lexicon; no verse found. Six spellings in the lexicon are one ending once the joining is derived
inஇன்Naṉṉūl 244 lists it as a சாரியை
accஐNaṉṉūl 296
instஆல்Naṉṉūl 297
datகு, with the உ சாரியை (உக்கு) or the இன் சாரியை (இற்கு)கு: Naṉṉūl 298 and Tolkāppiyam வேற்றுமையியல் 14. The உ and இன்: Naṉṉūl 244, optional by 243. Where each applies: Arden 110 (rule P12 below)
benஆகlexicon; no verse found
locஇல், இடம்Naṉṉūl 302 lists both among the place words. The கண் of 301 is not generated
ablஇல், இன்Naṉṉūl 299
ablஇலிருந்துlexicon; no verse found
genஅதுNaṉṉūl 300
genஇன்lexicon; no verse found
socஓடுNaṉṉūl 297
soc, soஉடன்lexicon; no verse found
focதான்lexicon; a particle
cmprபோல்lexicon; a particle
sandhik sandhic sandhip sandhitக் ச் ப் த்lexicon; the joining consonants at a word boundary, see P3

The joining rules

Where two parts meet, the rules below apply. The first one that fits applies, in this order: the particle rule P10, then P9, then, at a word boundary, a filter that lets only ச், ட், த் and ப் trigger anything, then P5, P6, P3, P1, P2, P11 and P4. P8 and P12 act earlier, on the stem and on the dative ending.

In TLP1 the top two bits of a byte give its kind: 00 for a vowel and 01 for a consonant. For consonants the next two bits give the class (0100 வல்லினம், 0101 மெல்லினம்) and the low three bits give the place. Bytes are in hex.

rulewhat it doesconditionactionverse
P1a மெல்லினம் takes the place of a following வல்லினம்the left ends in ம் (54), the right begins with a வல்லினம் (b >> 4 = 4), not at a word boundaryreplace ம் by (a & ~7) | (b & 7): ம் + க் gives ங்Tolkāppiyam பிறப்பியல் 7 to 9, the place of each pair. The model applies it to ம் only
P2ல், ள், ன் harden before a வல்லினம்the left ends in ல் (65), ள் (62) or ன் (55), the right begins with a வல்லினம், not at a word boundary(a & 7) | 0x40: ல் gives ற், ள் gives ட், ன் gives ற்ல், ள்: Naṉṉūl 227. ன்: Tolkāppiyam புணரியல் 21 (the இன் before கு) and புள்ளிமயங்கியல் 37
P3a nasal is lost before ச் ட் த் ப்at a word boundary only, the left ends in a மெல்லினம், the right begins with ச், ட், த் or ப்drop the nasallexicon; no verse found. The model follows ThamizhiMorph, which keeps the nasal before க் and ற்
P4a வல்லினம் doubles after a vowelthe left ends in a vowel, the right begins with a வல்லினம், the noun's class says it doubles, not at a word boundaryinsert a copy of the வல்லினம்Tolkāppiyam உயிர்மயங்கியல் 1, 19, 47, 52, 62 and 87 (அ, ஆ, ஈ, உ, ஊ, ஓ), and 33 and 78 (இ and ஐ double only in a case relation); Naṉṉūl 165
P5a குற்றியலுகரம் drops before a vowelthe left ends in உ (02) after a consonant, the ending is a குற்றியலுகரம், the right begins with a voweldrop the உNaṉṉūl 164; Tolkāppiyam புணரியல் 3. Naṉṉūl 94 says which உகரம் is a குற்றியலுகரம்
P6a glide fills a vowel-vowel junctionthe left ends in a vowel and the right begins with oneinsert ய் after இ, எ or ஐ, otherwise வ்Naṉṉūl 162
P8ன் becomes ர் before கள்the noun is in the class of மாணவன் and ends in ன் (மாணவன் gives மாணவர்கள்); the model's condition is the classreplace the final ன் by ர்lexicon; no verse found
P9two equal vowels at the seam of a stem and its சாரியை become onethe left ends in a vowel, the right is a சாரியை beginning with the same voweldrop the right's first sound: மர + அத்து gives மரத்துNaṉṉūl 252; Tolkāppiyam புணரியல் 23. Naṉṉūl 244 lists அத்து
P10a particle doubles its initial வல்லினம் after a vowelthe right is a particle marked to double, the left ends in a vowel, the right begins with a வல்லினம்insert a copy of the வல்லினம்lexicon; no verse found
P11the final ஒற்று doubles before a vowel endingthe left ends in a consonant, the right begins with a vowel, the noun's class is marked for itrepeat the consonant: கண் + ஐ gives கண்ணைNaṉṉūl 205 restricts it to a monosyllable with a short vowel. The model marks whole classes, which is wider
P12the dative is கு alone after இ, ஈ or ஐthe base ends in இ, ஈ or ஐ and the case is the dativeuse கு, not உக்கு or இற்கு, and double the க்: குழந்தைக்குகு: Naṉṉūl 298 and Tolkāppiyam வேற்றுமையியல் 14. The உ is optional: Naṉṉūl 243 and 244, Tolkāppiyam உருபியல் 30. Where it is absent: Arden 110

What is checked and what is not

The EBNF accepts all 81 feature bundles of the grid, and its text above is produced by the same data the check runs on. The joining rules above are the eleven labelled rules in tools/phon_rules.py, and the hardware version of them agrees with the Python on 927,200 test vectors.

Two things are open. The table of which stems are cut and which take an increment, the class table of Part 2, is still fitted to ThamizhiMorph's lexicon; deriving it from the verses is the next job. And the readings of the verses above have not yet had outside review. If one is wrong, please say so.

Everything is at github.com/Ramaseshanr/tamil-grammar-silicon.