Модуль:морфо/sources

Матеріал з Вікісловника

Документацію для цього модуля можна створити у Модуль:морфо/sources/документація

local export = {}
local u = require("Module:utils")

function export.process_sources(value, title)
	skip_categories = false
	if value == 'т' then
		reference = '{{Тихонов}}'
	elseif value == 'т2' or value == 'т-ся' then
		if u.endswith(title, 'ся') then
			reference = '{{Тихонов|' .. mw.ustring.sub(title, 1, -3) .. '(ся)}}'
		else
			reference = '{{Тихонов|2=(ся)}}'
		end
	elseif value == 'т-сь' then
		if u.endswith(title, 'сь') then
			reference = '{{Тихонов|' .. mw.ustring.sub(title, 1, -3) .. '(сь)}}'
		else
			reference = '{{Тихонов|2=(сь)}}'
		end
	elseif u.startswith(value, 'т:') then
		reference = '{{Тихонов|' .. mw.ustring.sub(value, 3) .. '}}'
	elseif u.contains({'т3'}, value) then
		reference = '{{Тихонов-3}}'
	elseif u.contains({'є'}, value) then
		reference = '{{Єфремова}}'
		skip_categories = true
	elseif u.contains({'к', 'кє', 'к,є', 'к, є'}, value) then
		reference = '{{Кузнецова і Єфремова}}'
		skip_categories = true
	elseif u.contains({'БУС'}, value) then
		reference = '{{БУС|сокр=1}}'
	else
		-- reference = wu.span_red('(невідоме джерело)')
		reference = ''
	end
	return reference, skip_categories
end

return export