Module:sish-pronunc: Difference between revisions

Melinoë (talk | contribs)
Created page with "local export = {} local m_str_utils = require("Module:string utilities") local lang = require("Module:languages").getByCode("hy") local m_IPA = require("Module:IPA") local yesno_module = "Module:yesno" local toNFC = mw.ustring.toNFC local trim = m_str_utils.trim local ufind = m_str_utils.find local ugsub = m_str_utils.gsub local ulower = m_str_utils.lower local ufind = m_str_utils.find local unpack = unpack or table.unpack -- Lua 5.2 compatibility local insert = table...."
 
Melinoë (talk | contribs)
No edit summary
Tag: Manual revert
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:


local m_str_utils = require("Module:string utilities")
local m_str_utils = require("Module:string utilities")
local lang = require("Module:languages").getByCode("hy")
local lang = require("Module:languages").getByCode("sish")
local m_IPA = require("Module:IPA")
local m_IPA = require("Module:IPA")
local yesno_module = "Module:yesno"
local yesno_module = "Module:yesno"
Line 637: Line 637:
end
end


local function insert_east_or_west(prons, system, standard_accent, coll_pron, coll_qualifier)
local items = {}
for _, pron in ipairs(prons) do
if pron then
insert(items, generate_pron(pron, system))
end
end
ins("* " .. m_IPA.format_IPA_full({
lang = lang,
items = items,
a = { standard_accent },
}))
if coll_pron then
ins("** " .. m_IPA.format_IPA_full({
lang = lang,
items = { generate_pron(coll_pron, system) },
q = { coll_qualifier, "colloquial" },
}))
end
end
local function is_empty(tbl)
return tbl == nil or next(tbl) == nil
end
local function first_item_is_nil_in_non_empty_table(tbl)
if is_empty(tbl) then return false end
return tbl[1] == nil
end
local function insert_all_from_table(result, source)
for _, value in ipairs(source) do
if value then
insert(result, value)
end
end
end
if #args[1] == 1 and args[1][1] == get_pagename() then
-- [[Wiktionary:Tracking/hy-pronunciation/input equal to pagename]]
track("input equal to pagename")
end
if args.E then
local eastern = {}
if not is_empty(args[1]) then
insert_all_from_table(eastern, args[1])
elseif not is_empty(args.e) then
if first_item_is_nil_in_non_empty_table(args.e) then
args.e[1] = get_pagename()
end
insert_all_from_table(eastern, args.e)
else
insert(eastern, get_pagename())
end
insert_east_or_west(
eastern,
"standard",
"sish-st",
args.colle,
"Standard Ossamic"
)
end
return concat(lines, "\n")
return concat(lines, "\n")
end
end


return export
return export