0% found this document useful (0 votes)
11 views

Module Cel-Verbs

This document provides code for generating conjugation tables for verbs in different tenses and aspects in various languages. It defines functions for processing verb data and generating present, imperfect, and imperative forms. It includes rules for default athematic conjugation as well as thematic and other irregular conjugations involving stem changes or infixes.

Uploaded by

Richie Tozier
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Module Cel-Verbs

This document provides code for generating conjugation tables for verbs in different tenses and aspects in various languages. It defines functions for processing verb data and generating present, imperfect, and imperative forms. It includes rules for default athematic conjugation as well as thematic and other irregular conjugations involving stem changes or infixes.

Uploaded by

Richie Tozier
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Module:cel-verbs

The following documentation is located at Module:cel-verbs/documentation. [edit]


Useful links: subpage list • links • transclusions • testcases • sandbox

1 local m_utilities = require("Module:utilities")


2 local m_links = require("Module:links")
3
4 local export = {}
5
6 local lang = require("Module:languages").getByCode("cel-pro")
7
8
9 local function postprocess(args, data)
10 data.actv = true
11 data.pasv = true
12
13 if args["v"] == "actv" then
14 data.pasv = false
15 elseif args["v"] == "pasv" then
16 data.actv = false
17 data.info = data.info .. ", deponent"
18 table.insert(data.categories, lang:getCanonicalName() .. " deponent verbs")
19 end
20
21 for key, form in pairs(data.forms) do
22 -- Do not show singular or plural forms for nominals that don't have them
23 if (args["v"] == "actv" and key:find("pasv")) or (args["v"] == "pasv" and
key:find("actv")) then
24 form = nil
25 end
26
27 data.forms[key] = form
28 end
29 end
30
31
32 local function present(data, stem)
33 if not stem then
34 stem = "?"
35 end
36 local stem2 = stem
37 local stem_pl = stem
38
39 -- Present indicative: default athematic; overridden by stem-class specific rules
40 data.forms["actv_pres_indc_1sg"] = {stem .. "mi"}
41 data.forms["actv_pres_indc_2sg"] = {stem .. "si"}
42 data.forms["actv_pres_indc_3sg"] = {stem .. "ti"}
43 data.forms["actv_pres_indc_1pl"] = {stem .. "mosi"}
44 data.forms["actv_pres_indc_2pl"] = {stem .. "tesi"}
45 data.forms["actv_pres_indc_3pl"] = {stem .. "nti"}
46
47 data.forms["pasv_pres_indc_1sg"] = {stem .. "r"}
48 data.forms["pasv_pres_indc_2sg"] = {stem .. "tar"}
49 data.forms["pasv_pres_indc_3sg"] = {stem .. "tor"}
50 data.forms["pasv_pres_indc_1pl"] = {stem .. "mmor"}
51 data.forms["pasv_pres_indc_2pl"] = {stem .. "dwe"}
52 data.forms["pasv_pres_indc_3pl"] = {stem .. "ntor"}
53
54 -- Imperfect indicative
55 data.forms["actv_impf_indc_1sg"] = {stem .. "mam"}
56 data.forms["actv_impf_indc_2sg"] = {stem .. "tās"}
57 data.forms["actv_impf_indc_3sg"] = {stem .. "to"}
58 data.forms["actv_impf_indc_1pl"] = {stem .. "mo"}
59 data.forms["actv_impf_indc_2pl"] = {stem .. "stē"}
60 data.forms["actv_impf_indc_3pl"] = {stem .. "nto"}
61
62 data.forms["pasv_impf_indc_3sg"] = {"?"}
63 data.forms["pasv_impf_indc_3pl"] = {"?"}
64
65 -- Imperative
66 data.forms["actv_impr_2sg"] = {stem}
67 data.forms["actv_impr_3sg"] = {stem .. "tou"}
68 data.forms["actv_impr_1pl"] = {stem .. "mos"}
69 data.forms["actv_impr_2pl"] = {stem .. "te"}
70 data.forms["actv_impr_3pl"] = {stem .. "ntou"}
71
72 -- Present-stem overrides
73
74 if mw.ustring.find(stem, "e$") then
75 table.insert(data.info, "thematic present")
76 stem2 = string.sub(stem, 1, -2)
77 data.forms["actv_pres_indc_1sg"] = {stem2 .. "ū"}
78 data.forms["actv_pres_indc_2sg"] = {stem2 .. "esi"}
79 data.forms["actv_pres_indc_3sg"] = {stem2 .. "eti"}
80 data.forms["actv_pres_indc_1pl"] = {stem2 .. "omosi"}
81 data.forms["actv_pres_indc_2pl"] = {stem2 .. "etesi"}
82 data.forms["actv_pres_indc_3pl"] = {stem2 .. "onti"}
83
84 data.forms["pasv_pres_indc_1sg"] = {stem2 .. "ūr"}
85 data.forms["pasv_pres_indc_2sg"] = {stem2 .. "etar"}
86 data.forms["pasv_pres_indc_3sg"] = {stem2 .. "etor"}
87 data.forms["pasv_pres_indc_1pl"] = {stem2 .. "ommor"}
88 data.forms["pasv_pres_indc_2pl"] = {stem2 .. "edwe"}
89 data.forms["pasv_pres_indc_3pl"] = {stem2 .. "ontor"}
90
91 data.forms["actv_impr_1pl"] = {stem2 .. "omos"}
92 data.forms["actv_impr_2pl"] = {stem2 .. "ete"}
93 data.forms["actv_impr_3pl"] = {stem2 .. "ontou"}
94
95 elseif mw.ustring.find(stem, "<h2e>$") then
96 table.insert(data.info, "thematic present with a-colouring")
97 stem2 = string.sub(stem, 1, -6)
98 pref, suf = string.match(stem2, "^(.-)e(.+)$")
99 -- for *sistati
100 if pref == nil then
101 stem_a = stem2
102 else stem_a = pref .. "a" .. suf
103 end
104
105 data.forms["actv_pres_indc_1sg"] = {stem2 .. "ū"}
106 data.forms["actv_pres_indc_2sg"] = {stem_a .. "asi"}
107 data.forms["actv_pres_indc_3sg"] = {stem_a .. "ati"}
108 data.forms["actv_pres_indc_1pl"] = {stem2 .. "omosi"}
109 data.forms["actv_pres_indc_2pl"] = {stem_a .. "atesi"}
110 data.forms["actv_pres_indc_3pl"] = {stem2 .. "onti"}
111
112 data.forms["pasv_pres_indc_1sg"] = {stem2 .. "ūr"}
113 data.forms["pasv_pres_indc_2sg"] = {stem_a .. "atar"}
114 data.forms["pasv_pres_indc_3sg"] = {stem_a .. "ator"}
115 data.forms["pasv_pres_indc_1pl"] = {stem2 .. "ommor"}
116 data.forms["pasv_pres_indc_2pl"] = {stem_a .. "adwe"}
117 data.forms["pasv_pres_indc_3pl"] = {stem2 .. "ontor"}
118
119 data.forms["actv_impf_indc_1sg"] = {stem_a .. "amam"}
120 data.forms["actv_impf_indc_2sg"] = {stem_a .. "atās"}
121 data.forms["actv_impf_indc_3sg"] = {stem_a .. "ato"}
122 data.forms["actv_impf_indc_1pl"] = {stem_a .. "amo"}
123 data.forms["actv_impf_indc_2pl"] = {stem_a .. "astē"}
124 data.forms["actv_impf_indc_3pl"] = {stem_a .. "anto"}
125
126 data.forms["actv_impr_2sg"] = {stem_a .. "a"}
127 data.forms["actv_impr_3sg"] = {stem_a .. "atou"}
128 data.forms["actv_impr_1pl"] = {stem2 .. "omos"}
129 data.forms["actv_impr_2pl"] = {stem_a .. "ate"}
130 data.forms["actv_impr_3pl"] = {stem2 .. "ontou"}
131
132 elseif mw.ustring.find(stem, "a$") then
133 table.insert(data.info, "athematic present")
134
135 -- Se ṭ-root nasal-infixed presents
136 elseif mw.ustring.find(stem, "<H>$") then
137 table.insert(data.info, "athematic h₂-root nasal-infix present")
138 stem2 = string.sub(stem, 1, -4)
139 stem_pl = string.sub(stem, 1, -6) .. "a"
140 data.forms["actv_pres_indc_1sg"] = {stem2 .. "mi"}
141 data.forms["actv_pres_indc_2sg"] = {stem2 .. "si"}
142 data.forms["actv_pres_indc_3sg"] = {stem2 .. "ti"}
143 data.forms["actv_pres_indc_1pl"] = {stem_pl .. "mosi"}
144 data.forms["actv_pres_indc_2pl"] = {stem_pl .. "tesi"}
145 data.forms["actv_pres_indc_3pl"] = {stem_pl .. "nti"}
146 data.forms["pasv_pres_indc_1sg"] = {stem2 .. "r"}
147 data.forms["pasv_pres_indc_2sg"] = {stem2 .. "tar"}
148 data.forms["pasv_pres_indc_3sg"] = {stem2 .. "tor"}
149 data.forms["pasv_pres_indc_1pl"] = {stem_pl .. "mmor"}
150 data.forms["pasv_pres_indc_2pl"] = {stem_pl .. "dwe"}
151 data.forms["pasv_pres_indc_3pl"] = {stem_pl .. "ntor"}
152
153 data.forms["actv_impf_indc_1sg"] = {stem_pl .. "mam"}
154 data.forms["actv_impf_indc_2sg"] = {stem_pl .. "tās"}
155 data.forms["actv_impf_indc_3sg"] = {stem_pl .. "to"}
156 data.forms["actv_impf_indc_1pl"] = {stem_pl .. "mo"}
157 data.forms["actv_impf_indc_2pl"] = {stem_pl .. "stē"}
158 data.forms["actv_impf_indc_3pl"] = {stem_pl .. "nto"}
159
160 data.forms["actv_impr_2sg"] = {stem2}
161 data.forms["actv_impr_3sg"] = {stem2 .. "tou"}
162 data.forms["actv_impr_1pl"] = {stem_pl .. "mos"}
163 data.forms["actv_impr_2pl"] = {stem_pl .. "te"}
164 data.forms["actv_impr_3pl"] = {stem_pl .. "ntou"}
165 elseif mw.ustring.find(stem, "<h1>$") then
166 table.insert(data.info, "athematic h₁-root nasal-infix present")
167 stem2 = string.sub(stem, 1, -5)
168 stem_pl = string.sub(stem, 1, -7) .. "a"
169 stem_3pl = string.sub(stem, 1, -7) .."e"
170 data.forms["actv_pres_indc_1sg"] = {stem2 .. "mi"}
171 data.forms["actv_pres_indc_2sg"] = {stem2 .. "si"}
172 data.forms["actv_pres_indc_3sg"] = {stem2 .. "ti"}
173 data.forms["actv_pres_indc_1pl"] = {stem_pl .. "mosi"}
174 data.forms["actv_pres_indc_2pl"] = {stem_pl .. "tesi"}
175 data.forms["actv_pres_indc_3pl"] = {stem_3pl .. "nti"}
176 data.forms["pasv_pres_indc_1sg"] = {stem2 .. "r"}
177 data.forms["pasv_pres_indc_2sg"] = {stem2 .. "tar"}
178 data.forms["pasv_pres_indc_3sg"] = {stem2 .. "tor"}
179 data.forms["pasv_pres_indc_1pl"] = {stem_pl .. "mmor"}
180 data.forms["pasv_pres_indc_2pl"] = {stem_pl .. "dwe"}
181 data.forms["pasv_pres_indc_3pl"] = {stem_3pl .. "ntor"}
182
183 data.forms["actv_impf_indc_1sg"] = {stem_pl .. "mam"}
184 data.forms["actv_impf_indc_2sg"] = {stem_pl .. "tās"}
185 data.forms["actv_impf_indc_3sg"] = {stem_pl .. "to"}
186 data.forms["actv_impf_indc_1pl"] = {stem_pl .. "mo"}
187 data.forms["actv_impf_indc_2pl"] = {stem_pl .. "stē"}
188 data.forms["actv_impf_indc_3pl"] = {stem_pl .. "nto"}
189
190 data.forms["actv_impr_2sg"] = {stem2}
191 data.forms["actv_impr_3sg"] = {stem2 .. "tou"}
192 data.forms["actv_impr_1pl"] = {stem_pl .. "mos"}
193 data.forms["actv_impr_2pl"] = {stem_pl .. "te"}
194 data.forms["actv_impr_3pl"] = {stem_3pl .. "ntou"}
195 elseif mw.ustring.find(stem, "<h3>$") then
196 table.insert(data.info, "athematic h₃-root nasal-infix present")
197 stem2 = string.sub(stem, 1, -5)
198 stem_pl = string.sub(stem, 1, -7) .. "a"
199 stem_3pl = string.sub(stem, 1, -7) .."o"
200 data.forms["actv_pres_indc_1sg"] = {stem2 .. "mi"}
201 data.forms["actv_pres_indc_2sg"] = {stem2 .. "si"}
202 data.forms["actv_pres_indc_3sg"] = {stem2 .. "ti"}
203 data.forms["actv_pres_indc_1pl"] = {stem_pl .. "mosi"}
204 data.forms["actv_pres_indc_2pl"] = {stem_pl .. "tesi"}
205 data.forms["actv_pres_indc_3pl"] = {stem_3pl .. "nti"}
206 data.forms["pasv_pres_indc_1sg"] = {stem2 .. "r"}
207 data.forms["pasv_pres_indc_2sg"] = {stem2 .. "tar"}
208 data.forms["pasv_pres_indc_3sg"] = {stem2 .. "tor"}
209 data.forms["pasv_pres_indc_1pl"] = {stem_pl .. "mmor"}
210 data.forms["pasv_pres_indc_2pl"] = {stem_pl .. "dwe"}
211 data.forms["pasv_pres_indc_3pl"] = {stem_3pl .. "ntor"}
212
213 data.forms["actv_impf_indc_1sg"] = {stem_pl .. "mam"}
214 data.forms["actv_impf_indc_2sg"] = {stem_pl .. "tās"}
215 data.forms["actv_impf_indc_3sg"] = {stem_pl .. "to"}
216 data.forms["actv_impf_indc_1pl"] = {stem_pl .. "mo"}
217 data.forms["actv_impf_indc_2pl"] = {stem_pl .. "stē"}
218 data.forms["actv_impf_indc_3pl"] = {stem_pl .. "nto"}
219
220 data.forms["actv_impr_2sg"] = {stem2}
221 data.forms["actv_impr_3sg"] = {stem2 .. "tou"}
222 data.forms["actv_impr_1pl"] = {stem_pl .. "mos"}
223 data.forms["actv_impr_2pl"] = {stem_pl .. "te"}
224 data.forms["actv_impr_3pl"] = {stem_3pl .. "ntou"}
225 -- Weak presents
226 elseif mw.ustring.find(stem, "ā$") then
227 table.insert(data.info, "ā-present")
228 elseif mw.ustring.find(stem, "ī$") then
229 table.insert(data.info, "ī-present")
230 stem2 = string.sub(stem, 1, -3) .. "ey"
231 data.forms["actv_pres_indc_1sg"] = {stem2 .. "ū"}
232 data.forms["actv_pres_indc_2sg"] = {stem .. "si"}
233 data.forms["actv_pres_indc_3sg"] = {stem .. "ti"}
234 data.forms["actv_pres_indc_1pl"] = {stem2 .. "omosi"}
235 data.forms["actv_pres_indc_2pl"] = {stem .. "tesi"}
236 data.forms["actv_pres_indc_3pl"] = {stem2 .. "onti"}
237
238 data.forms["pasv_pres_indc_1sg"] = {stem2 .. "ūr"}
239 data.forms["pasv_pres_indc_2sg"] = {stem .. "tar"}
240 data.forms["pasv_pres_indc_3sg"] = {stem .. "tor"}
241 data.forms["pasv_pres_indc_1pl"] = {stem2 .. "ommor"}
242 data.forms["pasv_pres_indc_2pl"] = {stem .. "dwe"}
243 data.forms["pasv_pres_indc_3pl"] = {stem2 .. "ontor"}
244
245 data.forms["actv_impr_1pl"] = {stem2 .. "omos"}
246 data.forms["actv_impr_2pl"] = {stem .. "te"}
247 data.forms["actv_impr_3pl"] = {stem2 .. "ontou"}
248 --- Copula
249 elseif mw.ustring.find(stem, "esē$") then
250 table.insert(data.info, "athematic present")
251 data.forms["actv_pres_indc_1sg"] = {"esmi"}
252 data.forms["actv_pres_indc_2sg"] = {"esi"}
253 data.forms["actv_pres_indc_3sg"] = {"esti"}
254 data.forms["actv_pres_indc_1pl"] = {"esmosi"}
255 data.forms["actv_pres_indc_2pl"] = {"estesi"}
256 data.forms["actv_pres_indc_3pl"] = {"senti"}
257 data.forms["actv_impr_2sg"] = {"es"}
258 data.forms["actv_impr_3sg"] = {"estou"}
259 data.forms["actv_impr_1pl"] = {"smos"}
260 data.forms["actv_impr_2pl"] = {"ste"}
261 data.forms["actv_impr_3pl"] = {"sentou"}
262 --- *essi "to eat"
263 elseif mw.ustring.find(stem, "ed$") then
264 table.insert(data.info, "athematic present")
265 data.forms["actv_pres_indc_2sg"] = {"etsi"}
266 data.forms["actv_pres_indc_3sg"] = {"essi"}
267 data.forms["actv_pres_indc_2pl"] = {"essesi"}
268 data.forms["actv_pres_indc_3pl"] = {"(e)denti"}
269 data.forms["actv_impf_indc_1sg"] = {"?"}
270 data.forms["actv_impf_indc_2sg"] = {"?"}
271 data.forms["actv_impf_indc_3sg"] = {"?"}
272 data.forms["actv_impf_indc_1pl"] = {"?"}
273 data.forms["actv_impf_indc_2pl"] = {"?"}
274 data.forms["actv_impf_indc_3pl"] = {"?"}
275 data.forms["actv_impr_2sg"] = {"?"}
276 data.forms["actv_impr_3sg"] = {"?"}
277 data.forms["actv_impr_1pl"] = {"?"}
278 data.forms["actv_impr_2pl"] = {"?"}
279 data.forms["actv_impr_3pl"] = {"?"}
280 data.forms["pasv_pres_indc_1sg"] = {"?"}
281 data.forms["pasv_pres_indc_2sg"] = {"?"}
282 data.forms["pasv_pres_indc_3sg"] = {"?"}
283 data.forms["pasv_pres_indc_1pl"] = {"?"}
284 data.forms["pasv_pres_indc_2pl"] = {"?"}
285 data.forms["pasv_pres_indc_3pl"] = {"?"}
286 else
287 stem = "?"
288 end
289
290 -- Non-finite forms, do not use
291 data.forms["actv_pres_ptcp"] = {stem .. "nts"}
292 data.forms["pasv_pres_ptcp"] = {stem .. "mnos"}
293 end
294
295
296 local function future(data, stem)
297 if not stem then
298 stem = "?"
299 elseif stem == "-" then
300 return
301 end
302
303 data.forms["actv_futr_indc_1sg"] = {stem .. "sū"}
304 data.forms["actv_futr_indc_2sg"] = {stem .. "sesi"}
305 data.forms["actv_futr_indc_3sg"] = {stem .. "seti"}
306 data.forms["actv_futr_indc_1pl"] = {stem .. "somosi"}
307 data.forms["actv_futr_indc_2pl"] = {stem .. "setesi"}
308 data.forms["actv_futr_indc_3pl"] = {stem .. "sonti"}
309
310 data.forms["pasv_futr_indc_1sg"] = {stem .. "sūr"}
311 data.forms["pasv_futr_indc_2sg"] = {stem .. "setar"}
312 data.forms["pasv_futr_indc_3sg"] = {stem .. "setor"}
313 data.forms["pasv_futr_indc_1pl"] = {stem .. "sommor"}
314 data.forms["pasv_futr_indc_2pl"] = {stem .. "sedwe"}
315 data.forms["pasv_futr_indc_3pl"] = {stem .. "sontor"}
316 end
317
318
319 local function preterite_actv(data, stem)
320 if not stem then
321 stem = "?"
322 elseif stem == "-" then
323 return
324 end
325
326 -- t-preterite
327 if mw.ustring.find(stem, "<t>$") then
328 stem_t = string.sub(stem, 1, -4)
329 stem_t2 = mw.ustring.gsub(stem_t, "[bgkɸm]$", {["b"] = "x", ["g"] = "x", ["k"] =
"x", ["ɸ"] = "x", ["m"] = "n"})
330 table.insert(data.info, "t-preterite")
331 data.forms["actv_pret_indc_1sg"] = {stem_t .. "am"}
332 data.forms["actv_pret_indc_2sg"] = {stem_t2 .. "s" or stem_t .. "s"}
333 data.forms["actv_pret_indc_3sg"] = {stem_t2 .. "t" or stem_t .. "t"}
334 data.forms["actv_pret_indc_1pl"] = {stem_t .. "me"}
335 data.forms["actv_pret_indc_2pl"] = {stem_t2 .. "te" or stem_t .. "te"}
336 data.forms["actv_pret_indc_3pl"] = {stem_t .. "ant"}
337 -- s-preterite
338 elseif mw.ustring.find(stem, "<st>$") then
339 stem_s = string.sub(stem, 1, -5)
340 table.insert(data.info, "s-preterite")
341 data.forms["actv_pret_indc_1sg"] = {stem_s .. "am"}
342 data.forms["actv_pret_indc_2sg"] = {stem_s .. "s"}
343 data.forms["actv_pret_indc_3sg"] = {stem_s .. "t"}
344 data.forms["actv_pret_indc_1pl"] = {stem_s .. "me"}
345 data.forms["actv_pret_indc_2pl"] = {stem_s .. "te"}
346 data.forms["actv_pret_indc_3pl"] = {stem_s .. "ant"}
347 --- For *dāti "give"
348 elseif mw.ustring.find(stem, "<oh>$") then
349 stem_oh = string.sub(stem, 1, -5)
350 table.insert(data.info, "suffixless preterite")
351 data.forms["actv_pret_indc_1sg"] = {stem_oh .. "ū"}
352 data.forms["actv_pret_indc_2sg"] = {stem_oh .. "ūs"}
353 data.forms["actv_pret_indc_3sg"] = {stem_oh .. "ū"}
354 data.forms["actv_pret_indc_1pl"] = {stem_oh .. "amo"}
355 data.forms["actv_pret_indc_2pl"] = {stem_oh .. "ate"}
356 data.forms["actv_pret_indc_3pl"] = {stem_oh .. "ar"}
357 --- For *kerat "fell"
358 elseif mw.ustring.find(stem, "<at>$") then
359 stem_at = string.sub(stem, 1, -5)
360 table.insert(data.info, "root aorist")
361 data.forms["actv_pret_indc_1sg"] = {stem_at .. "am"}
362 data.forms["actv_pret_indc_2sg"] = {stem_at .. "as"}
363 data.forms["actv_pret_indc_3sg"] = {stem_at .. "at"}
364 data.forms["actv_pret_indc_1pl"] = {stem_at .. "ame"}
365 data.forms["actv_pret_indc_2pl"] = {stem_at .. "ate"}
366 data.forms["actv_pret_indc_3pl"] = {stem_at .. "ant"}
367 --- Stative endings as default
368 else
369 table.insert(data.info, "suffixless preterite")
370 stem_2pl = mw.ustring.gsub(stem, "[bgkɸmtd]$", {["b"] = "xt", ["g"] = "xt", ["k"]
= "xt", ["ɸ"] = "xt", ["m"] = "nt", ["t"] = "ss", ["d"] = "ss"})
371 data.forms["actv_pret_indc_1sg"] = {stem .. "a"}
372 data.forms["actv_pret_indc_2sg"] = {stem .. "as?"}
373 data.forms["actv_pret_indc_3sg"] = {stem .. "e"}
374 data.forms["actv_pret_indc_1pl"] = {stem .. "mo"}
375 data.forms["actv_pret_indc_2pl"] = {stem_2pl .. "e"}
376 data.forms["actv_pret_indc_3pl"] = {stem .. "ar"}
377 end
378 end
379
380 local function subjunctive(data, stem)
381 if not stem then
382 stem = "?"
383 elseif stem == "-" then
384 return
385 end
386
387 data.forms["actv_pres_subj_1sg"] = {stem .. "ū"}
388 data.forms["actv_pres_subj_2sg"] = {stem .. "esi"}
389 data.forms["actv_pres_subj_3sg"] = {stem .. "eti"}
390 data.forms["actv_pres_subj_1pl"] = {stem .. "omosi"}
391 data.forms["actv_pres_subj_2pl"] = {stem .. "etesi"}
392 data.forms["actv_pres_subj_3pl"] = {stem .. "onti"}
393
394 data.forms["pasv_pres_subj_1sg"] = {stem .. "ūr"}
395 data.forms["pasv_pres_subj_2sg"] = {stem .. "etar"}
396 data.forms["pasv_pres_subj_3sg"] = {stem .. "etor"}
397 data.forms["pasv_pres_subj_1pl"] = {stem .. "ommor"}
398 data.forms["pasv_pres_subj_2pl"] = {stem .. "edwe"}
399 data.forms["pasv_pres_subj_3pl"] = {stem .. "ontor"}
400
401 data.forms["actv_past_subj_1sg"] = {"?"}
402 data.forms["actv_past_subj_2sg"] = {"?"}
403 data.forms["actv_past_subj_3sg"] = {"?"}
404 data.forms["actv_past_subj_1pl"] = {"?"}
405 data.forms["actv_past_subj_2pl"] = {"?"}
406 data.forms["actv_past_subj_3pl"] = {"?"}
407 end
408
409
410 -- Inflection functions
411
412 export["reg"] = function(frame)
413 local params = {
414 [1] = {},
415 [2] = {},
416 [3] = {},
417 [4] = {allow_holes = true},
418 [5] = {},
419
420 ["v"] = {},
421 }
422
423 local args = require("Module:parameters").process(frame:getParent().args, params)
424
425 local data = {forms = {}, info = {}, categories = {}}
426
427 present(data, args[1])
428 future(data, args[2])
429 preterite_actv(data, args[3])
430 subjunctive(data, args[5])
431
432 data.info = table.concat(data.info, ", ")
433
434 postprocess(args, data)
435
436 return make_table(data) .. m_utilities.format_categories(data.categories, lang)
437 end
438
439 local names = {
440 ["actv"] = "Active voice",
441 ["pasv"] = "Passive voice",
442
443 ["pres_indc"] = "Present",
444 ["impf_indc"] = "Imperfect",
445 ["futr_indc"] = "Future",
446 ["pret_indc"] = "Preterite",
447 ["pres_subj"] = "Pres. subjunctive",
448 ["past_subj"] = "Past subjunctive",
449 ["impr"] = "Imperative",
450
451 ["1sg"] = "1st singular",
452 ["2sg"] = "2nd singular",
453 ["3sg"] = "3rd singular",
454 ["1pl"] = "1st plural",
455 ["2pl"] = "2nd plural",
456 ["3pl"] = "3rd plural",
457 }
458
459 -- Make the table
460 function make_table(data)
461 local function repl(param)
462 if param == "info" then
463 return mw.getContentLanguage():ucfirst(data.info or "")
464 end
465
466 local form = data.forms[param]
467
468 if not form or #form == 0 then
469 return "&mdash;"
470 end
471
472 if mw.ustring.find(form[1], "^?") then
473 return "?"
474 end
475
476 local ret = {}
477
478 for key, subform in ipairs(form) do
479 table.insert(ret, m_links.full_link({lang = lang, alt = "*" .. subform}))
480 end
481
482 return table.concat(ret, ", ")
483 end
484
485 local pns = {"1sg", "2sg", "3sg", "1pl", "2pl", "3pl"}
486 local rows = {
487 {"pres_indc", "impf_indc", "futr_indc", "pret_indc"},
488 {"pres_subj", "past_subj", "impr"}}
489 local voices = {}
490
491 if data.actv then
492 table.insert(voices, "actv")
493 end
494
495 if data.pasv then
496 table.insert(voices, "pasv")
497 end
498
499 local colnum = 0
500
501 for _, row in ipairs(rows) do
502 colnum = math.max(colnum, #row)
503 end
504
505 local wikicode = {}
506
507 table.insert(wikicode, "{| class=\"inflection-table vsSwitcher\" data-toggle-
category=\"inflection\" style=\"background: #FAFAFA; border: 1px solid #d0d0d0; text-
align: left;\" cellspacing=\"1\" cellpadding=\"2\"")
508 table.insert(wikicode, "|- style=\"background: #CCCCFF;\"\n!
class=\"vsToggleElement\" colspan=\"" .. (colnum + 1) .. "\" | {{{info}}}")
509
510 for _, voice in ipairs(voices) do
511 table.insert(wikicode, "|- class=\"vsHide\" style=\"background: #CCCCFF;\"")
512 table.insert(wikicode, "! colspan=\"" .. (colnum + 1) .. "\" style=\"text-align:
center;\" | " .. names[voice])
513
514 for _, row in ipairs(rows) do
515 table.insert(wikicode, "|- class=\"vsHide\" style=\"background: #CCCCFF;\"")
516 table.insert(wikicode, "!")
517
518 local i = 0
519
520 for _, tm in ipairs(row) do
521 table.insert(wikicode, "! style=\"min-width: 11em; background: #CCCCFF;\"
| " .. names[tm])
522 i = i + 1
523 end
524
525 if i < colnum then
526 table.insert(wikicode, "! style=\"min-width: 11em; background: #CCCCFF;\"
rowspan=\"" .. (#pns + 1) .. "\" colspan=\"" .. (colnum - i) .. "\" |")
527 end
528
529 for _, pn in ipairs(pns) do
530 table.insert(wikicode, "|- class=\"vsHide\" style=\"background-color:
#F2F2FF;\"")
531 table.insert(wikicode, "! style=\"min-width: 8em; background-color:
#E6E6FF;\" | " .. names[pn])
532
533 for _, tm in ipairs(row) do
534 table.insert(wikicode, "| {{{" .. voice .. "_" .. tm .. "_" .. pn ..
"}}}")
535 end
536 end
537 end
538 end
539
540 table.insert(wikicode, "|}")
541
542 wikicode = table.concat(wikicode, "\n")
543
544 return (mw.ustring.gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl))
545 end
546
547 return export

Retrieved from "https://en.wiktionary.org/w/index.php?title=Module:cel-verbs&oldid=77603600"

This page was last edited on 11 January 2024, at 09:44.

Definitions and other text are available under the Creative Commons Attribution-ShareAlike License; additional terms
may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

You might also like