local export = {}
function export.etyl(frame)
local params = {
= {required = true, default = "und"},
= {},
= {},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local source = args
local lang = args
local sort_key = args
-- Empty language means English, but "-" means no language. Yes, confusing...
if not lang then
lang = "en"
elseif lang == "-" then
lang = nil
end
if lang then
lang = require("Module:User:Isomorphyc/languages-draft").getByCode(lang) or error("The language code \"" .. lang .. "\" is not valid.")
end
source =
require("Module:User:Isomorphyc/languages-draft").getByCode(source) or
require("Module:etymology languages").getByCode(source) or
require("Module:families").getByCode(source) or
error("The language, family or etymology language code \"" .. source .. "\" is not valid.")
if lang and (lang:getCode() == "la" or lang:getCode() == "nl") then
require("Module:debug").track("etyl/" .. lang:getCode())
require("Module:debug").track("etyl/" .. lang:getCode() .. "/" .. source:getCode())
end
return require("Module:User:Isomorphyc/etymology-draft").format_etyl(lang, source, sort_key)
end
function export.cognate(frame)
local params = {
= {required = true, default = "und"},
= {},
= {alias_of = "alt"},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {},
= {},
= {},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local source = args
local sc = args
source =
require("Module:User:Isomorphyc/languages-draft").getByCode(source) or
require("Module:etymology languages").getByCode(source) or
require("Module:families").getByCode(source) or
error("The language, family or etymology language code \"" .. source .. "\" is not valid.")
sc = (sc and (require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")) or nil)
return require("Module:User:Isomorphyc/etymology-draft").format_cognate(
{lang = source, sc = sc, term = args, alt = args, id = args, genders = {args}, tr = args, pr = args, gloss = args, pos = args, lit = args},
args)
end
function export.derived(frame)
local params = {
= {required = true, default = "und"},
= {required = true, default = "und"},
= {},
= {alias_of = "alt"},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {},
= {},
= {},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local lang = args
local source = args
local sc = args
lang = require("Module:User:Isomorphyc/languages-draft").getByCode(lang) or error("The language code \"" .. lang .. "\" is not valid.")
source =
require("Module:User:Isomorphyc/languages-draft").getByCode(source) or
require("Module:etymology languages").getByCode(source) or
require("Module:families").getByCode(source) or
error("The language, family or etymology language code \"" .. source .. "\" is not valid.")
sc = (sc and (require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")) or nil)
return require("Module:User:Isomorphyc/etymology-draft").format_derived(
lang,
{lang = source, sc = sc, term = args, alt = args, id = args, genders = {args}, tr = args, pr = args, gloss = args, pos = args, lit = args},
args)
end
function export.inherited(frame)
local params = {
= {required = true, default = "und"},
= {required = true, default = "und"},
= {},
= {alias_of = "alt"},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {},
= {},
= {},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local lang = args
local source = args
local sc = args
lang = require("Module:User:Isomorphyc/languages-draft").getByCode(lang) or error("The language code \"" .. lang .. "\" is not valid.")
source =
require("Module:User:Isomorphyc/languages-draft").getByCode(source) or
require("Module:etymology languages").getByCode(source) or
error("The language or etymology language code \"" .. source .. "\" is not valid.")
sc = (sc and (require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")) or nil)
return require("Module:User:Isomorphyc/etymology-draft").format_inherited(
lang,
{lang = source, sc = sc, term = args, alt = args, id = args, genders = {args}, tr = args, pr = args, gloss = args, pos = args, lit = args},
args)
end
function export.borrowed(frame)
local learned = frame.args; if not learned or learned == "" then learned = false else learned = true end
local params = {
= {required = true, default = "und"},
= {required = true, default = "und"},
= {},
= {alias_of = "alt"},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {},
= {},
= {},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {type = "boolean"},
= {type = "boolean"},
= {},
}
local compat = false
if frame:getParent().args then
compat = true
end
if compat then
require("Module:debug").track("borrowing/lang")
params = table.remove(params, 1)
end
local args = require("Module:parameters").process(frame:getParent().args, params)
local lang = args
local source = args
local sc = args
lang = require("Module:User:Isomorphyc/languages-draft").getByCode(lang) or error("The language code \"" .. lang .. "\" is not valid.")
source =
require("Module:User:Isomorphyc/languages-draft").getByCode(source) or
require("Module:etymology languages").getByCode(source) or
require("Module:families").getByCode(source) or
error("The language, family or etymology language code \"" .. source .. "\" is not valid.")
sc = (sc and (require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")) or nil)
return require("Module:User:Isomorphyc/etymology-draft").format_borrowed(
lang,
{lang = source, sc = sc, term = args, alt = args, id = args, genders = {args}, tr = args, pr = args, gloss = args, pos = args, lit = args},
args, args, args, learned)
end
function export.calque(frame)
local params = {
= {required = true, default = "und"},
= {required = true, default = "und"},
= {},
= {alias_of = "alt"},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {},
= {},
= {},
= {alias_of = "gloss"},
= {},
= {},
= {},
= {type = "boolean"},
= {type = "boolean"},
}
local compat_lang = false
local compat_etyl = false
if frame:getParent().args then
compat_lang = true
compat_etyl = true
elseif frame:getParent().args then
compat_etyl = true
end
if compat_etyl then
require("Module:debug").track("calque/etyl")
params = {required = true, default = "und"}
params = {}
params = {}
params = {}
params = {list = true, allow_holes = true}
params = nil
params = nil
params = nil
params = {list = true, allow_holes = true}
params = nil
params = {list = true, allow_holes = true}
params = nil
params = nil
params = {list = true, allow_holes = true}
params = {alias_of = "gloss", list = true, allow_holes = true}
params = {list = true, allow_holes = true}
params = {list = true, allow_holes = true}
end
if compat_lang then
require("Module:debug").track("calque/lang")
params = table.remove(params, 1)
end
local args = require("Module:parameters").process(frame:getParent().args, params)
local lang = args
local source = args
lang = require("Module:User:Isomorphyc/languages-draft").getByCode(lang) or error("The language code \"" .. lang .. "\" is not valid.")
source =
require("Module:User:Isomorphyc/languages-draft").getByCode(source) or
require("Module:etymology languages").getByCode(source) or
error("The language or etymology language code \"" .. source .. "\" is not valid.")
local parts = {}
if compat_etyl then
for i = 1, math.max(args.maxindex, args.maxindex, args.maxindex, args.maxindex, args.maxindex) do
table.insert(parts, {
term = args,
alt = args,
tr = args,
pr = args,
gloss = args,
pos = args,
})
end
end
return require("Module:User:Isomorphyc/etymology-draft").calque(
lang,
{lang = source, term = args, alt = not compat_etyl and args or nil, tr = args, pr = args, gloss = args},
parts, args, args, args)
end
return export