Module:gml-conj

From Wiktionary, the free dictionary
Archived revision by Korn (talk | contribs) as of 12:06, 26 September 2016.
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This module is experimental.
The details of its operation have not yet been fully decided upon. Do not deploy widely until the module is finished.

Middle Low German conjugation table.


local p = {}
frame = mw.getCurrentFrame()

-- Initial consonant (cluster)
local arg1 = frame.args[1]

-- Vowels
local arg2 = frame.args[2]
local v1 = arg2 -- Infinitive; Present Indicative 1. Pers. Sing., Plur.; Optative Present; Present Participle; Imperative Plur.
local v2 = arg2 -- Present Indicative 2. and 3. Pers. Sing.
local v3 = arg2 -- Preterite Indicative 1. and 3. Pers. Sing.
local v4 = arg2 -- Preterite Indicative 2. Pers. Sing., Plur.
local v5 = arg2 -- Optative Preterite
local v6 = arg2 -- Imperative Sing.
local v7 = arg2 -- Past Participle
local v8 = arg2 -- Syncopated present 2nd/3rd

--Verb class
local class = "weak"

if arg2 == "1" then v1, v2, v3, v4, v5, v6, v7, v8, class = "î", "î", "ê", "ē", "ē", "î", "ē", "î", "class 1 strong"
elseif arg2 == "2a" then v1, v2, v3, v4, v5, v6, v7, v8, class = "ê", "ü̂", "ô", "ō", "ȫ", "ê", "ō", "ü̂", "class 2a strong"
elseif arg2 == "2b" then v1, v2, v3, v4, v5, v6, v7, v8, class = "û", "ü̂", "ô", "ō", "ȫ", "û", "ō", "ü̂", "class 2b strong"
elseif arg2 == "3a" then v1, v2, v3, v4, v5, v6, v7, v8, class = "i", "i", "a", "u", "ü", "i", "u", "i", "class 3a strong"
elseif arg2 == "3b" then v1, v2, v3, v4, v5, v6, v7, v8, class = "e", "e", "a", "u", "ü", "i", "u", "i", "class 3b strong"
elseif arg2 == "3c" then v1, v2, v3, v4, v5, v6, v7, v8, class = "e", "e", "a", "o", "ö", "e", "o", "e", "class 3c strong"
elseif arg2 == "4" then v1, v2, v3, v4, v5, v6, v7, v8, class = "ē", "ē", "a", "â", "ê", "i", "ō", "i", "class 4 strong"
elseif arg2 == "5" then v1, v2, v3, v4, v5, v6, v7, v8, class = "ē", "ē", "a", "â", "ê", "i", "ē", "i", "class 5 strong"
elseif arg2 == "6" then v1, v2, v3, v4, v5, v6, v7, v8, class = "ā", "ē", "ô", "ô", "ö̂", "a", "ā", "e", "class 6 strong"
end

-- Consonants
local arg3 = frame.args[3]
local fod = arg3 -- Final Obstruent Devoicing
local simp1 = "" -- Medial consonant (cluster) before /t/
local arg4 = frame.args[4]
local unsep = arg4 -- Unseparable prefix
local sep = "" -- Separable prefix
local ppen = "et" -- Past participle ending

-- Stetting fod
if tonumber(string.sub(arg2, 0, 1)) == nil then fod = arg3.."ede"
elseif string.sub(fod, -1) == string.sub(fod, 0, 1)	then 
	fod = string.sub(fod, -1)
	fod = string.gsub(fod, "d", "t")
	fod = string.gsub(fod, "g", "ch")
	fod = string.gsub(fod, "v", "f")
	ppen = "en"
end

if string.sub(fod, -1) == "t" then simp1 = string.sub(fod, 0, -2)
else simp1 = fod
end

-- Setting for sep/unsep
if arg4 == "af"
	or arg4 == "an"
	or arg4 == "āne"
	or arg4 == "dȫr"
	or arg4 == "dörch"
	or arg4 == "hin"
	or arg4 == "hen"
	or arg4 == "hēne"
	or arg4 == "hinder"
	or arg4 == "achter"
	or arg4 == "her"
	or arg4 == "mit"
	or arg4 == "mēde"
	or arg4 == "nâ"
	or arg4 == "nâch"
	or arg4 == "ût"
	or arg4 == "ûte"
	or arg4 == "up"
	or arg4 == "uppe"
	or arg4 == "under"
	or arg4 == "ünder"
	or arg4 == "ümme"
	or arg4 == "umme"
	or arg4 == "ȫver"
	or arg4 == "ōver"
	or arg4 == "āver"
	or arg4 == "vȫr"
	or arg4 == "tô"
	then unsep, sep = "", arg4
end

--Stems
stem1 = unsep..arg1..v1..arg3
stem2 = unsep..arg1..v2..arg3
stem3 = unsep..arg1..v3..fod
stem4 = unsep..arg1..v4..arg3
stem5 = unsep..arg1..v5..arg3
stem8 = unsep..arg1..v8

ppref = "ge" -- Past participle prefix
if unsep ~= "" then ppref = unsep end

-- Alternative forms
local impalt = "" -- Imperative
if string.sub(arg2, 0, 1) == "2" then impalt = [=[ ''or'' ]=]..unsep..arg1..v2..fod.." "..sep end

local ppalt = "" -- Past participle
if arg2 == "2a"
	or arg2 == "2b"
	or arg2 == "4"
	then ppalt = [=[ ''or'' ]=]..sep.." "..ppref..arg1.."ā"..arg3..[=[en]=]
elseif arg2 == "3b" then ppalt = [=[ ''or'' ]=]..sep..ppref..arg1.."o"..arg3..[=[en]=]
end

local pre3b2 = "" -- Alternative present for 2nd person present in class 3b
if arg2 == "3b" then pre3b2 = " ''or'' "..stem8..arg3.."est "..sep.." ''or'' "..unsep..arg1..v2..fod.."st "..sep end

local pretalt2 = "" -- Preterite 2nd Pers. Sing.
local pretaltp = "" -- Preterite Plur.
if string.sub(arg2, 0, 1) == "2" then pretalt2, pretaltp = [=[ ''or'' ]=]..unsep..arg1.."ȫ"..arg3.."est "..sep, [=[ ''or'' ]=]..unsep..arg1.."ȫ"..arg3.."en "..sep
elseif arg2 == "3a" or arg2 == "3b" then pretalt2, pretaltp = [=[ ''or'' ]=]..unsep..arg1.."ü"..arg3.."est "..sep, [=[ ''or'' ]=]..unsep..arg1.."ü"..arg3.."en "..sep
elseif arg2 == "3c" then pretalt2, pretaltp = [=[ ''or'' ]=]..unsep..arg1.."ö"..arg3.."est "..sep, [=[ ''or'' ]=]..unsep..arg1.."ö"..arg3.."en "..sep
elseif arg2 == "6" then pretalt2, pretaltp = [=[ ''or'' ]=]..unsep..arg1.."ö̂"..arg3.."est "..sep, [=[ ''or'' ]=]..unsep.. arg1.."ö̂"..arg3.."en "..sep
end

scat = "" -- Supercategory for verb classes with several subclasses
if string.sub(arg2, 0, 1) == "2" or string.sub(arg2, 0, 1) == "3" then scat = "[[Category: Middle Low German class "..string.sub(arg2, 0, 1).." strong verbs]]" end
	
function p.conj( frame )
    return [=[<div class="NavFrame" style="width: 55em">
<div class="NavHead" style="background: #CCCCFF;">Conjugation of ]=]..mw.title.getCurrentTitle().text..[=[ as a ]=]..class..[=[ verb</div>
<div class="NavContent">
{| border="1px solid #000000" style="border-collapse:collapse; background:#F9F9F9; text-align:center; width:100%" class="inflection-table""
|-
! style="background-color:#dedeee; font-weight: bold" | Plain [[infinitive|Infinitive]]
| colspan="4"| ''']=]..sep..stem1..[=[en'''
|-
! style="background-color:#dedeee; font-weight: bold" | Full [[infinitive|Infinitive]] ([[gerund|Gerund]])
| colspan="4" |]=]..sep..[=[ tô ]=]..stem1..[=[ene ''or'' ]=]..sep..[=[ tô ]=]..stem1..[=[ende
|-
! style="background-color:#dedeee; font-weight: bold" | [[verbal noun|Verbal Noun]]
| colspan="4" | ]=]..sep..stem1..[=[en ''or'' ]=]..sep..stem1..[=[ent
|-
! colspan="3" style="background-color:#dedeee; font-weight: bold" | [[participle|Participles]]
! colspan="2" style="background-color:#dedeee; font-weight: bold" | [[imperative|Imperatives]]
|-
! style="background-color:#efefff; font-weight: bold" | [[present tense|Present]]
| colspan="2" | ]=]..sep..stem1..[=[ende
! style="background-color:#efefff; font-weight: bold" | [[second-person|2nd Pers.]] [[singular|Sing.]]
| colspan="1" | ]=]..unsep..arg1..v6..fod.." "..sep..impalt..[=[<br>
|-
! style="background-color:#efefff; font-weight: bold" | [[past tense|Past]]
| colspan="2" | ]=]..sep..ppref..arg1..v7..arg3..ppen..ppalt..[=[<br>
! style="background-color:#efefff; font-weight: bold" | [[second-person|2nd Pers.]] [[plural|Plur.]]
| colspan="1" | ]=]..stem1..[=[et ]=]..sep..[=[<br>
|-
! rowspan="2" style="background-color:#dedeee; font-weight: bold" | 
! colspan="2" style="background-color:#dedeee; font-weight: bold" | [[indicative mood|Indicative]]
! colspan="2" style="background-color:#dedeee; font-weight: bold" | [[subjunctive mood|Subjunctive]]
|-
! style="background-color:#dedeee; font-weight: bold" | [[present tense|Present]]
! style="background-color:#dedeee; font-weight: bold" | [[preterite|Preterite]]
! style="background-color:#dedeee; font-weight: bold" | [[present tense|Present]]
! style="background-color:#dedeee; font-weight: bold; width:15%" | [[preterite|Preterite]]
|-
! style="background-color:#efefff; font-weight: bold" |[[first-person|1st Pers.]] [[singular|Sing.]]
| ]=]..stem1..[=[e ]=]..sep..[=[<br>
| ]=]..stem3.." "..sep..[=[<br>
| ]=]..stem1..[=[e ]=]..sep..[=[<br>
| ]=]..stem5..[=[e ]=]..sep..[=[<br>
|-
! style="background-color:#efefff; font-weight: bold" |[[second-person|2nd Pers.]] [[singular|Sing.]]
| ]=]..stem2..[=[est ]=]..sep..[=[ ''or'' ]=]..stem8..fod..[=[st ]=]..sep..pre3b2..[=[<br>
| ]=]..stem4..[=[est ]=]..sep..pretalt2..[=[<br>
| ]=]..stem1..[=[est ]=]..sep..[=[<br>
| ]=]..stem5..[=[est ]=]..sep..[=[<br>
|-
! style="background-color:#efefff; font-weight: bold" |[[third-person|3rd Pers.]] [[singular|Sing.]]
| ]=]..stem2..[=[et ]=]..sep..[=[  ''or'' ]=]..stem8..simp1..[=[t ]=]..sep..[=[<br>
| ]=]..stem3.." "..sep..[=[<br>
| ]=]..stem1..[=[et ]=]..sep..[=[<br>
| ]=]..stem5..[=[et ]=]..sep..[=[<br>
|-
! style="background-color:#efefff; font-weight: bold" |[[plural|Plur.]]
| ]=]..stem1..[=[en ]=]..sep..[=[ (]=]..stem1..[=[et ]=]..sep..[=[[[ Wiktionary:About_Middle_Low_German#Grammatical_normalisation_.E2.80.93_The_L.C3.BCbeck_standard|<sup>note</sup>]])
| ]=]..stem4..[=[en  ]=]..sep..pretaltp..[=[<br>
| ]=]..stem1..[=[en ]=]..sep..[=[<br>
| ]=]..stem5..[=[en ]=]..sep..[=[<br>
|}</div></div>
[[Category: Middle Low German ]=]..class..[=[ verbs]]]=]..scat..[=[
]=]

end

function p.alt (frame)
return [=[<div class="NavFrame" style="width: 55em">
<div class="NavHead" style="background: #CCCCFF;">Conjugation of {{{head}}}</div>
<div class="NavContent">
{| border="1px solid #000000" style="border-collapse:collapse; background:#F9F9F9; text-align:center; width:100%" class="inflection-table""
|- style="background-color:#F2F2FF; "
|-
! style="background-color:#dedeee; font-weight: bold" | Optional alternative word order in [[subordinate clause|Subordinate Clauses]]
! style="background-color:#dedeee; font-weight: bold" | [[present tense|Present]]
! style="background-color:#dedeee; font-weight: bold" | [[preterite|Preterite]]
! style="background-color:#dedeee; font-weight: bold" | [[present tense|Present]]
! style="background-color:#dedeee; font-weight: bold" | [[preterite|Preterite]]
|-
! style="background-color:#efefff; font-weight: bold" |[[first-person|1st Person]] [[singular|Singular]]
| {{{24}}} 
| {{{28}}}
| {{{32}}}
| {{{36}}}
|-
! style="background-color:#efefff; font-weight: bold" |[[second-person|2nd Person]] [[singular|Singular]]
| {{{25}}} 
| {{{29}}}
| {{{33}}}
| {{{37}}}
|-
! style="background-color:#efefff; font-weight: bold" |[[third-person|3rd Person]] [[singular|Singular]]
| {{{26}}} 
| {{{30}}}
| {{{34}}}
| {{{38}}}
|-
! style="background-color:#efefff; font-weight: bold" |[[plural|Plural]]
| {{{27}}} 
| {{{31}}}
| {{{35}}}
| {{{39}}}
|}</div></div>]=]
end

return p