[go: up one dir, main page]
More Web Proxy on the site http://driver.im/Ugrás a tartalomhoz

Modul:zh-verb

A Wikiszótárból, a nyitott szótárból

A modult a Modul:zh-verb/doc lapon tudod dokumentálni

local export = {}

function export.show(frame)
	local args = frame:getParent().args
	local title = args.pagename or mw.title.getCurrentTitle().text
	local inflections = {}
	local sortkey = require('Module:zh-sortkey').makeSortKey(title)

	if args.type then
		local wordtype, div_pos = args.type:match'([a-z]+)([1-9]*)'

		wordtype = ({
			['sp'] = 'subject-predicate',
			['vo'] = 'verb-object',
			['vc'] = 'verb-complement',
		})[wordtype] or error'Invalid value for parameter "type".'

		div_pos = tonumber(div_pos) or 1
		title = mw.ustring.sub(title, 1, div_pos) .. "⫽" .. mw.ustring.sub(title, div_pos + 1)
		inflections[1] = {label = wordtype}
	end
	return require('Module:headword').full_headword{
		lang = require('Module:languages').getByCode'zh',
		sc = require('Module:scripts').getByCode'Hani',
		heads = {title},
		inflections = inflections,
		categories = {'kínai igék'},
		sort_key = sortkey
	}
end

return export