Module:User:Trimpulot/tr-conj-test

-- Test

local export = {}

function export.main(frame) local lv = { --low vowels ["a"] = "a", ["ı"] = "a", ["o"] = "a", ["u"] = "a", ["e"] = "e", ["i"] = "e", ["ö"] = "e", ["ü"] = "e" }	local hv = { --high vowels ["a"] = "ı", ["ı"] = "ı", ["o"] = "u", ["u"] = "u", ["e"] = "i", ["i"] = "i", ["ö"] = "ü", ["ü"] = "ü" }	local inf_noun = { --infinitive and verbal noun [1] = "infinitive", [2] = "verbal noun", }	local imper_part = { --impersonal participles [1] = "imperfective", [2] = "perfective", [3] = "prospective" }	local per_part = { --personal participles [1] = "non-prospective", [2] = "prospective" }	local time_adv = { --temporal adverbs [1] = "simple", [2] = "specific", [3] = "perfective", [4] = '"since"', [5] = '"until"', [6] = '"as long as"' }	local mode_adv = { --modal adverbs [1] = "simple", [2] = "reduplicated", [3] = '"as if"' }	local nm = { --"normal" moods names (moods which use copula personal endings) [1] = "aorist", [2] = "continuous", [3] = "inferential", [4] = "future", [5] = "progressive", [6] = "necessitative" }	local nqual = { --qualifiers for "normal" moods [1] = "simple", [2] = "past", [3] = "inferential", [4] = "conditional", }	local wm = { --"weird" moods names (moods which don't use copula personal endings) [1] = "past", [2] = "conditional" }	local wqual = { --"weird" moods qualifiers [1] = "simple", [12] = "conditional", [22] = "past", [3] = "inferential" }	local impqual = { -- imperative qualifiers [1] = "simple", [2] = "formal", [3] = "informal" }	local new_row = "" local note = "" local comma = "" local voiceless = "ptkçfshş"

local str = frame:getParent.args.title or mw.title.getCurrentTitle.text local irr = frame:getParent.args[1]

local extra, stem = mw.ustring.match(str, "([%w]*[%s]?)([%w]+)m[ae]k$")

local function link_term(term, index) index = index or 1 if term ~= " " then term = extra .. term if term == str then return "" .. term .. "" end if index == 1 then return "" .. term .. "" else return term end else return " " end end

local v2, v1, c = mw.ustring.match(stem, "([aeıioöuü]*)[^aeıioöuü]*([aeıioöuü]+)([^aeıioöuü]*)$") c = mw.ustring.sub(c, -1, -1)

local altStem_V, altStem_iyor = stem, stem --alternative stems before vowels and before -iyor

if irr == "d" then irr = "e" altStem_V = mw.ustring.sub(stem, 1, -2) .. "d" altStem_iyor = altStem_V elseif not irr then if c == "" then altStem_V = stem .. "y" altStem_iyor = mw.ustring.sub(stem, 1, -2) if v2 == "" then altStem_V = altStem_iyor .. "iy" end else if v2 == "" then irr = lv[v1] else irr = hv[v1] end end end

local neg_stem = stem .. "m" .. lv[v1] local pot_stem = altStem_V .. lv[v1] .. "bil" local impot_stem = altStem_V ..lv[v1] .. "m" .. lv[v1]

local tab = [=[ Conjugation of '']=] .. str .. [=[''

if index == 2 or index == 3 then tab = tab .. " "		elseif index == 4 then tab = tab .. "  "		end end conjugate(stem, 1)

--NEGATIVE

tab = tab .. [=[


 * Show negative conjugation:

{| border="1px solid #aaaaaa" style="border-collapse:collapse; background:#F9F9F9; text-align:center; width:100%" class="inflection-table" ! class="vsToggleElement" colspan=8 style="background: #DFDFDF" | Negative conjugation ! colspan=3 style="background:#DFDFDF" | singular ! colspan=3 style="background:#DFDFDF" | plural ! style="background:#DFDFDF" | 1st (ben) ! style="background:#DFDFDF" | 2nd (sen) ! style="background:#DFDFDF" | 3rd (o) ! style="background:#DFDFDF" | 1st (biz) ! style="background:#DFDFDF" | 2nd (siz) ! style="background:#DFDFDF" | 3rd (onlar)]=] conjugate(neg_stem, 2)
 * rowspan=2 colspan=2 |
 * rowspan=2 colspan=2 |

--POTENTIAL

tab = tab .. [=[


 * Show potential conjugation:

{| border="1px solid #aaaaaa" style="border-collapse:collapse; background:#F9F9F9; text-align:center; width:100%" class="inflection-table" ! class="vsToggleElement" colspan=8 style="background: #DFDFDF" | Potential conjugation ! colspan=3 style="background:#DFDFDF" | singular ! colspan=3 style="background:#DFDFDF" | plural ! style="background:#DFDFDF" | 1st (ben) ! style="background:#DFDFDF" | 2nd (sen) ! style="background:#DFDFDF" | 3rd (o) ! style="background:#DFDFDF" | 1st (biz) ! style="background:#DFDFDF" | 2nd (siz) ! style="background:#DFDFDF" | 3rd (onlar)]=] conjugate(pot_stem, 3)
 * rowspan=2 colspan=2 |
 * rowspan=2 colspan=2 |

--IMPOTENTIAL

tab = tab .. [=[


 * Show impotential conjugation:

{| border="1px solid #aaaaaa" style="border-collapse:collapse; background:#F9F9F9; text-align:center; width:100%" class="inflection-table" ! class="vsToggleElement" colspan=8 style="background: #DFDFDF" | Impotential conjugation ! colspan=3 style="background:#DFDFDF" | singular ! colspan=3 style="background:#DFDFDF" | plural ! style="background:#DFDFDF" | 1st (ben) ! style="background:#DFDFDF" | 2nd (sen) ! style="background:#DFDFDF" | 3rd (o) ! style="background:#DFDFDF" | 1st (biz) ! style="background:#DFDFDF" | 2nd (siz) ! style="background:#DFDFDF" | 3rd (onlar)]=] conjugate(impot_stem, 4) return(tab) end
 * rowspan=2 colspan=2 |
 * rowspan=2 colspan=2 |

return export