Module:rad-stem/templates: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
mNo edit summary
No edit summary
Line 612: Line 612:
end
end
local function get_forms(stem, ending, regex1, regex2)
local function get_forms(stem, ending, regex1, regex2, regex3, regex4)
local temp = {}
local temp = {}
local post = ""
local post = ""
Line 636: Line 636:
for i, form in ipairs(stem) do
for i, form in ipairs(stem) do
temp[i] = {['word'] = mw.ustring.gsub(form['word'] .. ending, regex1, regex2), ['note'] = form['note']}
temp[i] = {['word'] = mw.ustring.gsub(form['word'] .. ending, regex1, regex2), ['note'] = form['note']}
temp[i]['word'] = mw.ustring.gsub(temp[i]['word'], regex3, regex4)
end
end
elseif type(stem) == "string" then
elseif type(stem) == "string" then
temp = mw.ustring.gsub(stem .. ending, regex1, regex2)
temp = mw.ustring.gsub(stem .. ending, regex1, regex2)
temp = mw.ustring.gsub(temp, regex3, regex4)
end
end
return rad_link_IPA(temp, post, noipa)
return rad_link_IPA(temp, post, noipa)
Line 1,034: Line 1,036:
local aidentical = false
local aidentical = false
if pp.vstem then
if pp.vstem then
local aiheight = 1
if get_forms(pp['2s'],"ai","avai$","áe") == get_forms(pp.pst,"ai", "aai$", "áe") then
if get_forms(pp['2s'],"ai","avai$","áe") == get_forms(pp.pst,"ai", "aai$", "áe") then
td(get_forms(pp['2s'],"ai","avai$","áe"),2)
aiheight = 2
aidentical = true
aidentical = true
else
td(get_forms(pp['2s'],"ai","avai$","áe"))
end
end
td(get_forms(pp['2s'],"ai","avai$","áe"),aiheight)
td(get_forms(pp['2s'],"á","avá$","áva"))
td(get_forms(pp['2s'],"á","avá$","áva"))
else
else
local aiheight = 1
if get_forms(pp['2s'],"ai","âai$","oai") == get_forms(pp.pst,"ai", "aai$", "áe") then
if get_forms(pp['2s'],"ai","âai$","oai") == get_forms(pp.pst,"ai", "aai$", "áe") then
td(get_forms(pp['2s'],"ai","âai$","oai"),2)
aiheight = 2
aidentical = true
aidentical = true
else
td(get_forms(pp['2s'],"ai","âai$","oai"))
end
end
td(get_forms(pp['2s'],"á","âá$","oá"))
td(get_forms(pp['2s'],"ai","âai$","oai","aai","áe"),aiheight)
td(get_forms(pp['2s'],"á","âá$","oá","[aá]á","ả"))
end
end
td(get_forms(pp.a,"ș"),1,2)
td(get_forms(pp.a,"ș"),1,2)