local export = {}
local m_head = require('Module:headword')
local m_lang = require('Module:languages')
local strings = {
= ']',
= ']',
= '] (South Korea)',
}
function clone(table)
local table_new = {}
for k, v in pairs(table) do
table_new = v
end
return table_new
end
function export.show(frame)
local params = {
= { list = true, allow_empty = true },
}
local args = require('Module:parameters').process(frame:getParent().args, params)
local hunPage, hunText, hunLink, eum, eumDueumBeopchik
if args - 1] == '' then
eumDueumBeopchik = table.remove(args)
table.remove(args)
end
eum = table.remove(args)
hunText = table.remove(args)
hunPage = table.remove(args)
if hunText and string.match(hunText, '%%]') then
hunLink = hunText
elseif hunPage then
hunLink = ']'
elseif hunText then
hunLink = ']'
end
local data = {}
data.lang = m_lang.getByCode('ko')
data.translits = {'-'}
data.pos_category = 'hanja'
data.categories = {}
data.inflections = {}
data.sort_key = eum -- or should this be radical+strokenumber?
if eum then
table.insert(data.inflections, {
label = (hunLink and strings.eh or strings.e),
(hunLink and hunLink .. ' ' or '') .. (']'),
enable_auto_translit = true,
})
else
error('The pronunciation of this hanja has not been provided.')
end
if eumDueumBeopchik then
table.insert(data.inflections, {
label = (strings.dueumBeopchik),
(hunLink and hunLink .. ' ' or '') .. (']'),
enable_auto_translit = true,
})
end
local fullHeadword = m_head.full_headword(data)
fullHeadword = mw.ustring.gsub(fullHeadword, "eumhuneum", "eumhun-eum") -- XXX
return fullHeadword
end
return export