მოდული:Disambiguation
შეგიძლიათ შექმნათ დოკუმენტაცია ამ მოდულისათვის: მოდული:Disambiguation/ინფო
local p = {}
local mRedirect = require('მოდული:Redirect')
p.isDisambiguation = function(content)
-- false if there is no content
if content == nil then
return false
end
-- redirects are not disambiguation pages
if mRedirect.getTargetFromText(content) ~= nil then
return false
end
-- check for magic word
if string.find(content, "__DISAMBIG__", 1, true) ~= nil then
return true
end
return false
end
p._isDisambiguationPage = function(page)
-- Look "(disambiguation)" in the title
if string.find(page, "(მრავალმნიშვნელოვანი)",0,true) ~= nil then
return true;
end
-- Look for disamiguation template in page content
local title = mw.title.new(page)
if not title then return false end
local content = title:getContent()
return p.isDisambiguation(content)
end
return p