Module:ko-headword-hanja

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

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

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