local decl = {}

decl['a'] = {
    m = {{'⌫o'}, {'⌫ā'}, {'ṃ'}, {'⌫e'},
         {'⌫ena'}, {'⌫ehi', '⌫ebhi'}, {'ssa', '⌫āya', 'tthaṃ'}, {'⌫ānaṃ'},
         {'smā', 'mhā', '⌫ā'}, {'⌫ehi', '⌫ebhi'}, {'ssa'}, {'⌫ānaṃ'},
         {'smiṃ', 'mhi', '⌫e'}, {'⌫esu'}, {''}, {'⌫ā'}},
    n = {{'ṃ'}, {'⌫āni'}, {'ṃ'}, {'⌫āni'},
         {'⌫ena'}, {'⌫ehi', '⌫ebhi'}, {'ssa', '⌫āya', 'tthaṃ'}, {'⌫ānaṃ'},
         {'smā', 'mhā', '⌫ā'}, {'⌫ehi', '⌫ebhi'}, {'ssa'}, {'⌫ānaṃ'},
         {'smiṃ', 'mhi', '⌫e'}, {'⌫esu'}, {''}, {'⌫āni'}},
}

decl['ā'] = {
    f = {{''}, {'yo', ''}, {'⌫aṃ'}, {'yo', ''},
         {'ya'}, {'hi', 'bhi'}, {'ya'}, {'naṃ'},
         {'ya'}, {'hi', 'bhi'}, {'ya'}, {'naṃ'},
         {'ya', 'yaṃ'}, {'su'}, {'⌫e'}, {'yo', ''}},
    m = {{''}, {''}, {'⌫aṃ'}, {'ne'},
         {'⌫ena'}, {'hi', 'bhi'}, {'⌫assa', 'ya'}, {'naṃ'},
         {'⌫asmā', '⌫amhā', ''}, {'hi', 'bhi'}, {'⌫assa'}, {'naṃ'},
         {'⌫asmiṃ', '⌫amhi', '⌫e'}, {'su'}, {'⌫a'}, {''}},
}
decl['aa'] = decl['ā']

decl['i'] = {
    m = {{''}, {'⌫ayo', '⌫ī'}, {'ṃ'}, {'⌫ayo', '⌫ī'},
         {'nā'}, {'⌫īhi', '⌫ībhi'}, {'ssa', 'no'}, {'⌫īnaṃ'},
         {'smā', 'mhā'}, {'⌫īhi', '⌫ībhi'}, {'ssa', 'no'}, {'⌫īnaṃ'},
         {'smiṃ', 'mhi'}, {'⌫īsu'}, {''}, {'⌫ayo', '⌫ī'}},
    n = {{''}, {'⌫īni', '⌫ī'}, {'ṃ'}, {'⌫īni', '⌫ī'},
         {'nā'}, {'⌫īhi', '⌫ībhi'}, {'ssa', 'no'}, {'⌫īnaṃ'},
         {'smā', 'mhā'}, {'⌫īhi', '⌫ībhi'}, {'ssa', 'no'}, {'⌫īnaṃ'},
         {'smiṃ', 'mhi'}, {'⌫īsu'}, {''}, {'⌫īni', '⌫ī'}},
    f = {{''}, {'yo', '⌫ī'}, {'ṃ'}, {'yo', '⌫ī'},
         {'yā'}, {'⌫īhi', '⌫ībhi'}, {'yā'}, {'⌫īnaṃ'},
         {'yā', '⌫yā'}, {'⌫īhi', '⌫ībhi'}, {'yā'}, {'⌫īnaṃ'},
         {'yā', 'yaṃ', '⌫yaṃ'}, {'⌫īsu'}, {''}, {'yo', '⌫ī'}},
}

decl['ī'] = {
    m = {{''}, {'⌫ino', ''}, {'⌫iṃ', '⌫inaṃ'}, {'⌫ino', ''},
         {'⌫inā'}, {'hi', 'bhi'}, {'⌫issa', '⌫ino'}, {'naṃ'},
         {'⌫ismā', '⌫imhā'}, {'hi', 'bhi'}, {'⌫issa', '⌫ino'}, {'naṃ'},
         {'⌫ismiṃ', '⌫imhi'}, {'su'}, {'⌫i'}, {'⌫ino', ''}},
    f = {{''}, {'⌫iyo', ''}, {'⌫iṃ', '⌫iyaṃ'}, {'⌫iyo', ''},
         {'⌫iyā'}, {'hi', 'bhi'}, {'⌫iyā'}, {'naṃ'},
         {'⌫iyā'}, {'hi', 'bhi'}, {'⌫iyā'}, {'naṃ'},
         {'⌫iyā', '⌫iyaṃ'}, {'su'}, {'⌫i'}, {'⌫iyo', ''}},
}
decl['ii'] = decl['ī']

decl['in'] = {
    m = {{'⌫⌫ī'}, {'o', '⌫⌫ī'}, {'⌫ṃ', 'aṃ'}, {'o', '⌫⌫ī'},
         {'ā'}, {'⌫⌫īhi', '⌫⌫ībhi'}, {'⌫⌫issa', 'o'}, {'⌫⌫īnaṃ'},
         {'⌫⌫ismā', '⌫⌫imhā'}, {'⌫⌫īhi', '⌫⌫ībhi'}, {'⌫⌫issa', 'o'}, {'⌫⌫īnaṃ'},
         {'⌫⌫ismiṃ', '⌫⌫imhi'}, {'⌫⌫īsu'}, {'⌫'}, {'o', '⌫⌫ī'}},
    n = {{'⌫'}, {'⌫⌫īni', '⌫⌫ī'}, {'⌫ṃ'}, {'⌫⌫īni', '⌫⌫ī'},
         {'ā'}, {'⌫⌫īhi', '⌫⌫ībhi'}, {'⌫ssa', 'o'}, {'⌫⌫īnaṃ'},
         {'⌫smā', '⌫mhā'}, {'⌫⌫īhi', '⌫⌫ībhi'}, {'⌫ssa', 'o'}, {'⌫⌫īnaṃ'},
         {'⌫smiṃ', '⌫mhi'}, {'⌫⌫īsu'}, {'⌫'}, {'⌫⌫īni', '⌫⌫ī'}},
}
decl['ii'] = decl['ī']

decl['u'] = {
    m = {{''}, {'⌫avo', '⌫ū'}, {'ṃ'}, {'⌫avo', '⌫ū'},
         {'nā'}, {'⌫ūhi', '⌫ūbhi'}, {'ssa', 'no'}, {'⌫ūnaṃ'},
         {'smā', 'mhā'}, {'⌫ūhi', '⌫ūbhi'}, {'ssa', 'no'}, {'⌫ūnaṃ'},
         {'smiṃ', 'mhi'}, {'⌫ūsu'}, {''}, {'⌫ave', '⌫avo'}},
    n = {{''}, {'⌫ūni', '⌫ū'}, {'ṃ'}, {'⌫ūni', '⌫ū'},
         {'nā'}, {'⌫ūhi', '⌫ūbhi'}, {'ssa', 'no'}, {'⌫ūnaṃ'},
         {'smā', 'mhā'}, {'⌫ūhi', '⌫ūbhi'}, {'ssa', 'no'}, {'⌫ūnaṃ'},
         {'smiṃ', 'mhi'}, {'⌫ūsu'}, {''}, {'⌫ūni', '⌫ū'}},
    f = {{''}, {'yo', '⌫ū'}, {'ṃ'}, {'yo', '⌫ū'},
         {'yā'}, {'⌫ūhi', '⌫ūbhi'}, {'yā'}, {'⌫ūnaṃ'},
         {'yā'}, {'⌫ūhi', '⌫ūbhi'}, {'yā'}, {'⌫ūnaṃ'},
         {'yā', 'yaṃ'}, {'⌫ūsu'}, {''}, {'yo', '⌫ū'}},
}

decl['ū'] = {
    m = {{''}, {'⌫uno', ''}, {'⌫uṃ'}, {'⌫uno', ''},
         {'⌫unā'}, {'hi', 'bhi'}, {'⌫ussa', '⌫uno'}, {'naṃ'},
         {'⌫usmā', '⌫umhā'}, {'hi', 'bhi'}, {'⌫ussa', '⌫uno'}, {'naṃ'},
         {'⌫usmiṃ', '⌫umhi'}, {'su'}, {'⌫u'}, {'⌫uno', ''}},
    f = {{''}, {'⌫uyo', ''}, {'⌫uṃ'}, {'⌫uyo', ''},
         {'⌫uyā'}, {'hi', 'bhi'}, {'⌫uyā'}, {'naṃ'},
         {'⌫uyā'}, {'hi', 'bhi'}, {'⌫uyā'}, {'naṃ'},
         {'⌫uyā', '⌫uyaṃ'}, {'su'}, {'⌫u'}, {'⌫uyo', ''}},
}
decl['uu'] = decl['ū']

decl['ar'] = {
    m = {{'⌫⌫ā'}, {'⌫⌫āro', '⌫⌫ā'}, {'⌫⌫āraṃ', 'aṃ'}, {'⌫⌫āro', '⌫⌫āre'},
         {'ā', '⌫⌫ārā', '⌫⌫unā'}, {'⌫⌫ārehi', '⌫⌫ārebhi'}, {'⌫⌫u', '⌫⌫ussa', '⌫⌫uno'}, {'⌫⌫ānaṃ', '⌫⌫ārānaṃ', '⌫⌫ūnaṃ'},
         {'ā', '⌫⌫ārā', '⌫⌫unā'}, {'⌫⌫ārehi', '⌫⌫ārebhi'}, {'⌫⌫u', '⌫⌫ussa', '⌫⌫uno'}, {'⌫⌫ānaṃ', '⌫⌫ārānaṃ', '⌫⌫ūnaṃ'},
         {'i'}, {'⌫⌫āresu', '⌫⌫ūsu'}, {'⌫', '⌫⌫ā'}, {'⌫⌫āro', '⌫⌫ā'}},
}

decl['as'] = {
    n = {{'⌫⌫o', '⌫ṃ'}, {'⌫⌫āni'}, {'⌫⌫o', '⌫ṃ'}, {'⌫⌫āni'},
         {'ā', '⌫⌫ena'}, {'⌫⌫ehi', '⌫⌫ebhi'}, {'o', '⌫ssa',},  {'⌫⌫ānaṃ'},
         {'ā', 'mā', '⌫mhā', '⌫⌫ā'}, {'⌫⌫ehi', '⌫⌫ebhi'}, {'o', '⌫ssa'}, {'⌫⌫ānaṃ'},
         {'i', '⌫smiṃ', '⌫mhi', '⌫⌫e'}, {'⌫⌫esu'}, {'⌫⌫o', '⌫', '⌫ṃ', '⌫⌫ā'}, {'⌫⌫āni'}},
}

decl['an'] = {
    m = {{'⌫⌫ā'}, {'⌫⌫āno', '⌫⌫ā'}, {'⌫⌫ānaṃ', '⌫ṃ', 'aṃ'}, {'⌫⌫āno', '⌫⌫e'},
         {'ā', '⌫⌫ena'}, {'ehi', 'ebhi'}, {'o', '⌫ssa'},  {'⌫⌫ānaṃ'},
         {'ā', '⌫smā', '⌫mhā'}, {'ehi', 'ebhi'}, {'o', '⌫ssa'}, {'⌫⌫ānaṃ'},
         {'i', '⌫smiṃ', '⌫mhi'}, {'⌫⌫esu'}, {'⌫', '⌫⌫ā'}, {'⌫⌫āno', '⌫⌫ā'}},
}

-- 'ant', 'ent' and 'ont' are present participle endings.  Treating mahant as irregular.
-- 'mant' and 'vant' are as on the tin.
decl.ant = {
	m = {{'⌫⌫ṃ', 'o'}, {'o', 'ā'}, {'aṃ'}, {'o', 'e'},
         {'⌫⌫tā', 'ena'}, {'ehi', 'ebhi'}, {'⌫⌫to', 'assa'}, {'⌫⌫taṃ', 'ānaṃ'},
         {'⌫⌫tā', 'asmā', 'amhā', 'ā'}, {'ehi', 'ebhi'}, {'⌫⌫to', 'assa'}, {'⌫⌫taṃ', 'ānaṃ'},
         {'⌫⌫ti', 'asmiṃ', 'amhi', 'e'}, {'esu'}, {'⌫⌫ṃ', 'a'}, {'o', 'ā'}},
n = {}
}

for i, v in pairs(decl.ant.m) do
	decl.ant.n[i] = v
end
decl.ant.n[1] = {'⌫⌫ṃ', 'aṃ'}
decl.ant.n[3] = decl.ant.n[1]
decl.ant.n[15] = {'⌫⌫ṃ', 'a'}

decl.ant.n[2]  = {'i','āni'}
decl.ant.n[4]  = decl.ant.n[2]
decl.ant.n[16] = decl.ant.n[2]

decl.ent = {m = {}, n = {}}
for i, v in pairs(decl.ant.m) do
	decl.ent.m[i] = v
end
for i, v in pairs(decl.ant.n) do
	decl.ent.n[i] = v
end
decl.ent.m[1] = {'o'}
decl.ent.m[15] = {'a'}
decl.ent.n[1] = {'aṃ'}
decl.ent.n[3] = decl.ent.n[1]
decl.ent.n[15] = {'a'}

decl.mant = {m = {}, n = {}}
for i, v in pairs(decl.ant.m) do
	decl.mant.m[i] = v
end
for i, v in pairs(decl.ant.n) do
	decl.mant.n[i] = v
end
decl.mant.m[1]  = {'⌫⌫⌫ā', 'o'}
decl.mant.m[15] = {'⌫⌫⌫ā', '⌫⌫', '⌫⌫ṃ', 'a'} -- Duroiselle also has 'ā' (m & n.)
-- Evidence for 'o' in accusative plural is weak - supported by Collins and
-- da Silva, and historically expected.
decl.mant.n[15] = decl.mant.m[15]
-- Duroiselle has neuter NVA 'ā' - a-stem issue, and no 'i'.

decl.ont = decl.ent
decl.vant = decl.mant

return decl