Module:DetectSin
Appearance
local p = {}
-- Function to convert input based on character type
function p.processInput(frame)
local s = frame.args['s'] or ''
local artEnabled = frame.args['art'] == 'yes' -- Check if art is enabled
local ret = ''
-- If art is enabled, wrap the input with [[ and ]]
local art = artEnabled and "[[" .. s .. "]]" or s
-- Check if input contains English letters using a pattern
if mw.ustring.find(s, "[A-Za-z]") then
ret = frame:expandTemplate{ title = 'Country with of', args = {s} }
else
ret = frame:expandTemplate{ title = 'ConvertToAe', args = {s} }
end
-- If art is enabled, wrap the final output with [[ and ]]
if artEnabled then
ret = "[[" .. s .. "|" .. ret .. "]]"
end
return ret
end
return p