Модуль:Is surname disambiguation

Википеди материал

Для документации этого модуля может быть создана страница Модуль:Is surname disambiguation/doc

local p = {}

function p.main(frame)
	local getArgs = require('Модуль:Arguments').getArgs
	local args = getArgs(frame)
	if not args[1] then return '' end  -- Получить содержимое той страницы, на которой мы находимся, нельзя,
	                                   -- так что в отсутствие параметра использовать название текущей страницы мы не можем.
	local title = mw.title.new(args[1])
	local surnameDisambig = ''
	if title.exists then
		local fullContent = title:getContent()
		surnameDisambig =
			   mw.ustring.match(fullContent, '\{\{[сС]писок однофамильцев')
			or mw.ustring.match(fullContent, '\{\{[сС]писок т[ёе]зок')
			or mw.ustring.match(fullContent, '\{\{[сС]писок полных т[ёе]зок')
			or mw.ustring.match(fullContent, '\{\{[нН]еоднозначность[^}]*[оО]днофамильцы')
			or mw.ustring.match(fullContent, '\{\{[нН]еоднозначность[^}]*[фФ]амилии')
			or mw.ustring.match(fullContent, '\{\{[мМ]ногозначность[^}]*[оО]днофамильцы')
			or mw.ustring.match(fullContent, '\{\{[мМ]ногозначность[^}]*[фФ]амилии')
			or mw.ustring.match(fullContent, '\{\{[dD]isambig[^}]*[оО]днофамильцы')
			or mw.ustring.match(fullContent, '\{\{[dD]isambig[^}]*[фФ]амилии')
	end
	return surnameDisambig
end

return p