The site was updated to MediaWiki 1.43. If anything looks broken or there are glitches, report on the talk page or Discord in #wiki-support.
Module:Pronoun
Documentation for this module may be created at Module:Pronoun/doc
local p = {}
-- A function to check if the verb ends in 's' and should change based on pronoun
local function adjustVerb(pronoun, verb)
if pronoun == "he" or pronoun == "she" or pronoun == "it" then
-- Add 's' for singular third-person, if it doesn't already end with 's'
if not verb:match("s$") then
verb = verb .. "s"
end
elseif pronoun == "they" then
-- Remove 's' for 'they', consider special cases like 'goes' -> 'go'
if verb:match("es$") then
-- Remove 'es' for verbs that end in 'es', like 'goes'
verb = verb:sub(1, -3)
elseif verb:match("s$") then
-- Remove 's' for regular verbs
verb = verb:sub(1, -2)
end
end
return verb
end
function p.main(frame)
local pronoun = frame.args[1]
local verb = frame.args[2]
verb = adjustVerb(pronoun, verb) -- Adjust the verb based on the pronoun
return pronoun .. " " .. verb
end
return p