Jump to content

Module:R:fi:NSK

From Wiktionary, the free dictionary

This module implements the reference template {{R:fi:NSK}}.


local export = {}

function export.getVolume(frame)
	local word = frame.args[1] or error("must specify word")
	word = mw.ustring.lower(require("Module:languages").getByCode("fi"):makeSortKey(word))
	if mw.ustring.match(word, "^[a-i]") then
		return "1 (A–I)"
	elseif mw.ustring.match(word, "^[j-k]") then
		return "2 (J–K)"
	elseif mw.ustring.match(word, "^[l-n]") then
		return "3 (L–N)"
	elseif mw.ustring.match(word, "^[o-r]") then
		return "4 (O–R)"
	elseif mw.ustring.match(word, "^s.*") or mw.ustring.match(word, "^t[a-r]") then
		return "5 (S–Tr)"
	elseif mw.ustring.match(word, "^t[s-zåäö]") or mw.ustring.match(word, "^[u-zåäö]") then
		return "6 (Ts–Ö)"
	end
	return "?"
end

return export