Module:yi-verb

Hello, you have come here looking for the meaning of the word Module:yi-verb. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:yi-verb, but we will also tell you about its etymology, its characteristics and you will know how to say Module:yi-verb in singular and plural. Everything you need to know about the word Module:yi-verb you have here. The definition of the word Module:yi-verb will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:yi-verb, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Implements the templates {{yi-conj}} and {{yi-conj-e}}.


-- TODO: `cv' transliteration

local strutils = require("Module:string utilities")
local com = require("Module:yi-common")
local links = require("Module:links")

local export = {}

local lang = require("Module:languages").getByCode("yi")

local past_forms = {
	 = true,
	 = true,
	 = true,
	 = true,
}

local auxiliaries = {
	 = {
		 = "האָבן",
		 = "האָב",
		 = "האָבן",
		 = "האָסט",
		 = "האָט",
		 = "האָט",
		 = "האָבן",
		 = "געהאַט",
	},
	 = {
		 = "זײַן",
		 = "בין",
		 = "זענען",
		 = "ביסט",
		 = "זענט",
		 = "איז",
		 = "זענען",
		 = "געווען",
	},
}

local veln = {
	 = "וועל",
	 = "וועלן",
	 = "וועסט",
	 = "וועט",
	 = "וועט",
	 = "וועלן",
}

local numbers = {
	 = "איך",
	 = "מיר",
	 = "דו",
	 = "איר",
	 = "ער",
	 = "זיי",
}

local imperatives = {
	 = "דו",
	 = "איר",
}

local nonfinites = {
	 = true,
	 = true,
	 = true,
	 = true,
}

local function make_link_form(text, tr, accel)
	return (
		links.full_link({lang = lang, term = text, tr = "-", accel = accel}) ..
		"<br/><small>" .. tr .. "</small>"
	)
end

local function make_display_form(text, tr)
	return (
		links.full_link({lang = lang, alt = text, tr = "-"}) ..
		"<br/><small>" .. tr .. "</small>"
	)
end

local function process_forms(forms, aux)
	-- present
	for n, p in pairs(numbers) do
		f = "pres" .. n
		if forms == "-" then
			forms = "—"
		else
			forms = make_link_form(
				p .. " .text .. "]]",
				com.translit(p) .. " " .. com.translit(forms),
				{ form = n .. "|pres" }
			)
		end
	end

	-- imperative
	for n, p in pairs(imperatives) do
		if forms == "-" then
			forms = "—"
		else
			forms = make_link_form(
				".text .. "]] (" .. p .. ")",
				com.translit(forms) .. " (" .. com.translit(p) .. ")",
				{ form = n }
			)
		end
	end

	-- past
	for n, p in pairs(numbers) do
		p = p .. " " .. aux
		n = "past" .. n
		if forms == "-" then
			forms = "—"
		else
			forms = make_display_form(
				p .. " " .. forms.text,
				com.translit(p) .. " " .. com.translit(forms)
			)
		end
	end

	-- pluperfect
	for n, p in pairs(numbers) do
		p = p .. " " .. aux .. " " .. aux
		n = "plup" .. n
		if forms == "-" then
			forms = "—"
		else
			forms = make_display_form(
				p .. " " .. forms.text,
				com.translit(p) .. " " .. com.translit(forms)
			)
		end
	end

	-- future
	for n, p in pairs(numbers) do
		p = p .. " " .. veln
		n = "fut" .. n
		if forms == "-" then
			forms = "—"
		else
			forms = make_display_form(
				p .. " " .. forms.text,
				com.translit(p) .. " " .. com.translit(forms)
			)
		end
	end

	-- future perfect
	for n, p in pairs(numbers) do
		p = p .. " " .. veln .. " " .. aux
		n = "futp" .. n
		if forms == "-" then
			forms = "—"
		else
			forms = make_display_form(
				p .. " " .. forms.text,
				com.translit(p) .. " " .. com.translit(forms)
			)
		end
	end

	-- non-finite forms (must be done last)
	for n, v in pairs(nonfinites) do
		if forms == "-" then
			forms = "—"
		else
			forms = make_link_form(
				".text .. "]]",
				com.translit(forms),
				{ form = n }
			)
		end
	end
end

local function generate_forms(args, hint, aux)
	local forms = {}

	local inftext = args or SUBPAGENAME
	
	local prescv = ""
	local cv = ""
	if args then
		cv = args
		prescv = " " .. cv
	end
	
	local base = nil
	if args then
		base = com.form(args, args)
		hint = hint or com.ends_in(base, "e") and "e" or hint
	elseif inftext == "-" then
		base = com.form(SUBPAGENAME, args)
	else
		hint = hint or args and mw.ustring.match(args, "e$") and "e" or hint
		local tmp = mw.ustring.gsub(inftext, "ע?ן$", "")
		if hint == "e" then
			tmp = tmp .. "ע"
		else
			tmp = mw.ustring.gsub(tmp, "יִ$", "י")
		end
		base = com.form(tmp, args)
	end

	local inftr = nil
	if args or not base.tr then
		inftr = args
	else
		local tmp = base
		if hint == "e" then
			tmp = com.form(
				mw.ustring.gsub(tmp.text, "ע$", ""),
				mw.ustring.gsub(tmp.tr, "e$", "")
			)
		end
		if (inftext ~= "-" and
			#tmp.text < #inftext and
			tmp.text == inftext:sub(1, #tmp.text)) then
			local ending = inftext:sub(#tmp.text + 1)
			if ending == "ען" then
				inftr = tmp.tr .. "en"
			elseif ending == "ן" then
				inftr = tmp.tr .. (com.ends_nasal(tmp) and "en" or "n")
			end
		end
	end
	local inf = com.form(inftext, inftr)

	local nbase = nil
	if args then
		nbase = com.form(args, args)
	else
		local tmp = base
		if hint == "e" then
			tmp = com.form(
				mw.ustring.gsub(tmp.text, "ע$", ""),
				tmp.tr and mw.ustring.gsub(tmp.tr, "e$", "")
			)
		end
		if (inf ~= "-" and
			#tmp.text < #inf.text and
			tmp.text == inf.text:sub(1, #tmp.text)) then
			nbase = com.form(inf.text, args or inf.tr)
		else
			local suf = "ן"
			if com.ends_nasal(tmp) then
				suf = "ען"
			end
			nbase = com.suffix(tmp, suf)
		end
	end

	local tbase = nil
	if args then
		tbase = com.form(args, args)
	elseif com.ends_in(base, "t") then
		tbase = base
	else
		tbase = com.suffix(base, "ט")
	end

	base = com.finalize(base)

	forms = inf
	forms = com.form(args or (base.text .. prescv), args or base.tr)
	forms = com.form(args or (tbase.text .. prescv), args or tbase.tr)
	forms = com.form(args or (tbase.text .. prescv), args or tbase.tr)
	forms = com.form(args or (nbase.text .. prescv), args or nbase.tr)
	forms = com.form(args or (nbase.text .. prescv), args or nbase.tr)
	if args then
		forms = com.form(args, args)
	elseif com.ends_in(base, "s") then -- or com.ends_in(base, "ts")
		forms = com.form((tbase.text .. prescv), args or tbase.tr)
	-- elseif com.ends_in(base, "z") then
	--	 forms = com.form(
	--		 mw.ustring.gsub(base.text, "ז$", "סט"),
	--		 base.tr and mw.ustring.gsub(base.tr, "z$", "st")
	--	 )
	else
		forms = com.form((com.suffix(base, "סט").text .. prescv), args or com.suffix(base, "סט").tr)
	end
	if args == "-" then
		forms = "-"
		forms = "-"
	else
		forms = com.form(args or (base.text .. prescv), args or base.tr)
		forms = com.form(args or (tbase.text .. prescv), args or tbase.tr)
	end
	forms = com.form(
		args or cv .. com.suffix(nbase, "דיק").text,
		args or com.suffix(nbase, "דיק").tr
	)
	local past_form = args or "t"
	if past_forms then
		local past = nil
		if past_form:sub(-1, -1) == "n" then
			past = nbase
		else
			past = tbase
		end
		if past_form:sub(1, 1) ~= "-" then
			past = com.prefix(cv .. "גע", past)
		end
		forms = com.form(past.text, args or past.tr)
	else
		forms = com.form(past_form, args)
	end

	forms = com.form(aux)

	return forms
end

local template = nil

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.conjugate(frame)
	local args = frame:getParent().args
	local hint = args or frame.args
	SUBPAGENAME = frame.args or mw.title.getCurrentTitle().subpageText
	NAMESPACE = mw.title.getCurrentTitle().nsText

	for k, v in pairs(args) do
		if v == "" then
			args = nil
		end
	end

	local aux = auxiliaries or "h"]

	local forms = generate_forms(args, hint, aux)
	process_forms(forms, aux)
	forms = args or (
		"Conjugation of " ..
		links.full_link({lang = lang, alt = SUBPAGENAME, tr = "-"})
	)
	return strutils.format(template, forms)
end

template = [===[
<div class="NavFrame" style="width:56em">
<div class="NavHead" style="background:#ccccff">{title}</div>
<div class="NavContent">
{\op}| style="border:1px solid #ccccff; text-align:center; width:100%" class="inflection-table" cellspacing="1" cellpadding="3"
|- style="background:#f2f2ff"
! colspan="1" style="background:#ccccff; width:20%" | infinitive
| colspan="2" | {inf}
|- style="background:#f2f2ff"
! colspan="1" style="background:#ccccff" | present participle
| colspan="2" | {pres}
|- style="background:#f2f2ff"
! colspan="1" style="background:#ccccff" | past participle
| colspan="2" | {past-participle}
|- style="background:#f2f2ff"
! colspan="1" style="background:#ccccff" | auxiliary
| colspan="2" | {aux}
|- style="background:#f2f2ff"
! colspan="3" style="background:#ccccff; height:0.25em" |
|- style="background:#f2f2ff"
! rowspan="3" style="background:#ccccff" | present
| {pres1s}
| {pres1p}
|- style="background:#f2f2ff"
| {pres2s}
| {pres2p}
|- style="background:#f2f2ff"
| {pres3s}
| {pres3p}
|- style="background:#f2f2ff"
| colspan="3" style="background:#ccccff; height:0.25em" |
|- style="background:#f2f2ff"
! style="background:#ccccff" | imperative
| {imp|s}
| {imp|p}
|-
| colspan="3" | <div class="NavFrame" style="width:100%">
<div class="NavHead" style="background:#ccccff">Composed forms</div>
<div class="NavContent">
{\op}| style="border:1px solid #ccccff; text-align:center; width:100%" class="inflection-table" cellspacing="1" cellpadding="3"
|- style="background:#f2f2ff"
! rowspan="3" style="background:#ccccff; width:20%" | past
| {past1s}
| {past1p}
|- style="background:#f2f2ff"
| {past2s}
| {past2p}
|- style="background:#f2f2ff"
| {past3s}
| {past3p}
|- style="background:#f2f2ff"
! colspan="3" style="background:#ccccff; height:0.25em" |
|- style="background:#f2f2ff"
! rowspan="3" style="background:#ccccff" | pluperfect
| {plup1s}
| {plup1p}
|- style="background:#f2f2ff"
| {plup2s}
| {plup2p}
|- style="background:#f2f2ff"
| {plup3s}
| {plup3p}
|- style="background:#f2f2ff"
! colspan="3" style="background:#ccccff; height:0.25em" |
|- style="background:#f2f2ff"
! rowspan="3" style="background:#ccccff" | future
| {fut1s}
| {fut1p}
|- style="background:#f2f2ff"
| {fut2s}
| {fut2p}
|- style="background:#f2f2ff"
| {fut3s}
| {fut3p}
|- style="background:#f2f2ff"
! colspan="3" style="background:#ccccff; height:0.25em" |
|- style="background:#f2f2ff"
! rowspan="3" style="background:#ccccff" | future perfect
| {futp1s}
| {futp1p}
|- style="background:#f2f2ff"
| {futp2s}
| {futp2p}
|- style="background:#f2f2ff"
| {futp3s}
| {futp3p}
|{\cl}</div></div>
|{\cl}</div></div>]===]

return export