Module:sish-pronunc: Difference between revisions
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...." |
No edit summary |
||
| 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 | |||
return concat(lines, "\n") | return concat(lines, "\n") | ||
end | end | ||
return export | return export | ||