local c =
local remove_accents = require('Module:Latin')._removeaccents
local category = function(category, chr) return '' .. category .. ', ' .. remove_accents(chr) .. ''end
local p =
p.core = function(title, frame) if title.exists then if title.isRedirect then char_from = mw.ustring.sub(title.fullText, 1, 1) char_to = mw.ustring.sub(title.redirectTarget.fullText, 1, 1) if mw.ustring.find(frame:preprocess(title.redirectTarget:getContent ), c.disambig_magic_word, 1, true ) then return (frame:expandTemplate .. category(c.cat_ambiguous_from, char_from) .. category(c.cat_ambiguous_to, char_to) ) else return (frame:expandTemplate .. category(c.cat_unambiguous_from, char_from) .. category(c.cat_unambiguous_to, char_to) ) end else return error(c.err_not_redirect) end else return frame:expandTemplate endend
p.main = function(frame) return p.core(mw.title.getCurrentTitle, frame)end
return p