မာတိကာသို့ ခုန်သွားရန်

မဝ်ဂျူ:la-noun/table

နူ ဝိက်ရှေန်နရဳ
ထာမ်ပလိက်တဏအ်ဒးနွံကဵုလိက်စၟတ်သမ္တီမချူလဝ်သာဓက။
သ္ပဂုန်တုဲထာမ်ပလိက်တဏအ်ဒးစၟတ်သမ္တီကဵုလိက်မချူလဝ်နူကဵုဓမံက်ထ္ၜးကဵုဗီုပြၚ်ကိစ္စမရန်တၟအ်လဝ် ကဵု ပရေၚ်မရပ်စပ်လ္တူမုက်လိက်နကဵုလိက်စၟတ်သမ္တီမချူလဝ်သာဓက

local export = {}

local Array = require 'Module:array'

local function add_forms(wikitable, forms)
	if type(wikitable) ~= 'string' then
		error('Expected string, got ' .. type(wikitable))
	end
	
	wikitable = wikitable:gsub('{{{([^}]+)}}}', forms)
	return wikitable
end

function export.make_table_sg(data)
	local output = Array(data.title, mw.getCurrentFrame():expandTemplate{
		title = 'inflection-table-top',
		args = {
			title = '-',
			palette = 'cyan',
			class = 'sticky-left-column',
			lang = "la",
		}
	})
	output:insert [=[
! class="outer" |
! class="outer" | ကိုန်ဨကဝုစ်
|-
! [[nominative case|နာမ်ကံ]]
| {{{nom_sg}}}
|-
! [[genitive case|ဗဳဇဂကူ]]
| {{{gen_sg}}}
|-
! [[dative case|ထ္ၜးကမ္မကာရက]]
| {{{dat_sg}}}
|-
! [[accusative case|ကမ္မကာရက]]
| {{{acc_sg}}}
|-
! [[ablative case|ပရေၚ်ပိုၚ်ခြာပါၚ်တိုက်]]
| {{{abl_sg}}}
|-
! [[vocative case|ရမျာၚ်ဟီုအရေဝ်]]
| {{{voc_sg}}}
|-]=]
	if data.forms.loc_sg then
		output:insert [=[

! [[locative case|ကဆံၚ်ခၞံဗဒှ်]]
| {{{loc_sg}}}]=]
	end
	output:insert('\n')
	output:insert(mw.getCurrentFrame():expandTemplate{ title = 'inflection-table-bottom' })
	if data.footnotes and data.footnotes ~= '' then
		output:insert('\n' .. data.footnotes)
	end

	return add_forms(output:concat(), data.forms)
end

function export.make_table_pl(data)
	local output = Array(data.title, mw.getCurrentFrame():expandTemplate{
		title = 'inflection-table-top',
		args = {
			title = '-',
			palette = 'cyan',
			class = 'sticky-left-column',
			lang = "la",
		}
	})
	output:insert [=[
! class="outer" |
! class="outer" | ကိုန်ဗဟုဝစ်
|-
! [[nominative case|နာမ်ကံ]]
| {{{nom_pl}}}
|-
! [[genitive case|ဗဳဇဂကူ]]
| {{{gen_pl}}}
|-
! [[dative case|ထ္ၜးကမ္မကာရက]]
| {{{dat_pl}}}
|-
! [[accusative case|ကမ္မကာရက]]
| {{{acc_pl}}}
|-
! [[ablative case|ပရေၚ်ပိုၚ်ခြာပါၚ်တိုက်]]
| {{{abl_pl}}}
|-
! [[vocative case|ရမျာၚ်ဟီုအရေဝ်]]
| {{{voc_pl}}}
|-
]=]
	if data.forms.loc_pl then
		output:insert [=[

! [[locative case|ကဆံၚ်ခၞံဗဒှ်]]
| {{{loc_pl}}}]=]
	end
	output:insert('\n')
	output:insert(mw.getCurrentFrame():expandTemplate{ title = 'inflection-table-bottom' })
	if data.footnotes and data.footnotes ~= '' then
		output:insert('\n' .. data.footnotes)
	end
	
	return add_forms(output:concat(), data.forms)
end

function export.make_table(data)
	local output = Array(data.title, mw.getCurrentFrame():expandTemplate{
		title = 'inflection-table-top',
		args = {
			title = '-',
			palette = 'cyan',
			class = 'sticky-left-column',
			lang = "la",
		}
	})
	output:insert [=[
! class="outer" |
! class="outer" | ကိုန်ဨကဝုစ်
! class="outer" | ကိုန်ဗဟုဝစ်
|-
! [[nominative case|နာမ်ကံ]]
| {{{nom_sg}}}
| {{{nom_pl}}}
|-
! [[genitive case|ဗဳဇဂကူ]]
| {{{gen_sg}}}
| {{{gen_pl}}}
|-
! [[dative case|ထ္ၜးကမ္မကာရက]]
| {{{dat_sg}}}
| {{{dat_pl}}}
|-
! [[accusative case|ကမ္မကာရက]]
| {{{acc_sg}}}
| {{{acc_pl}}}
|-
! [[ablative case|ပရေၚ်ပိုၚ်ခြာပါၚ်တိုက်]]
| {{{abl_sg}}}
| {{{abl_pl}}}
|-
! [[vocative case|ရမျာၚ်ဟီုအရေဝ်]]
| {{{voc_sg}}}
| {{{voc_pl}}}
|-]=]
	if data.forms.loc_sg or data.forms.loc_pl then
		output:insert [=[

! [[locative case|ကဆံၚ်ခၞံဗဒှ်]]
| {{{loc_sg}}}
| {{{loc_pl}}}]=]
	end
	output:insert('\n')
	output:insert(mw.getCurrentFrame():expandTemplate{ title = 'inflection-table-bottom' })
	if data.footnotes and data.footnotes ~= '' then
		output:insert('\n' .. data.footnotes)
	end
	
	return add_forms(output:concat(), data.forms)
end

return export