Module:fa-adj

Definition from Wiktionary, the free dictionary
Jump to: navigation, search

This module implements {{fa-adj}}.


local export = {}

local m_common = require("Module:fa-common")

local lang = require("Module:languages").getByCode("fa")

function export.main(frame)
	local args = frame:getParent().args
	local word = mw.title.getCurrentTitle().text
	local tr = args["tr"]; if tr == "" then tr = nil end
	local c = args["c"]
	
	local data = {lang = lang, pos_category = "adjectives", categories = {}, translits = {tr}, inflections = {}}
	
	if c == "+" then
		table.insert(data.inflections, {
			label = 'comparative',
			accel = 'comparative-form-of' .. (tr and (' transliteration-' .. mw.uri.anchorEncode(tr) .. '-tar') or ""),
			word .. m_common.ZWNJ(word) .. "تر"
		})
		
		table.insert(data.inflections, {
			label = 'superlative',
			accel = 'superlative-form-of' .. (tr and (' transliteration-' .. mw.uri.anchorEncode(tr) .. '-tarin') or ""),
			word .. m_common.ZWNJ(word) .. "ترین"
		})
	end
	
	return require("Module:headword").full_headword(data)
end

return export