Module:Pronoun: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Tag: Reverted
Line 6:
end
 
-- Special cases for verb conjugation that don't follow the regular 's' or 'es' pattern, including 'has' to 'have'
local specialCases = {
go = "goes",
Line 30:
local pronoun = originalPronoun:lower() -- Use lowercase for logic
local verb = originalVerb:lower() -- Use lowercase for logic
 
local result = ""
-- Continuous tense (verbs ending in 'ing')
Line 36:
result = applyContinuousVerb(originalPronoun, originalVerb)
else
-- Simple present tense for singular third-person
if pronoun == "he" or pronoun == "she" or pronoun == "it" then
verb =if specialCases[verb] or verb -- Apply special case if existsthen
if not verb:match("s$") then= specialCases[verb]
elseif ifnot verb:match("ess$") then
verb = verb .. (needsEsEnding(verb) and "es" or "s")
end
elseif pronoun == "they" then
verb = specialCases[verb] or verb -- Check if there's a special plural case
-- Directly handling the 'has' to 'have' conversion
if verb:match("es$") ==or verb:match("hass$") then
verb = "have"verb:sub(1, -3) -- Assuming 'es' ending for simplicity, adjust as needed
else
-- Adjusting back from special cases if needed
verb = specialCases[verb] or verb
-- Remove 'es' or 's' if present
if verb:match("es$") then
verb = verb:sub(1, -3)
elseif verb:match("s$") then
verb = verb:sub(1, -2)
end
end
end
Line 60 ⟶ 51:
end
 
-- Preserve the original caseAdjust for title case and uppercase inputsinput
if isAllCaps(originalPronoun) and isAllCaps(originalVerb) then
result = result:upper()
else
elseif originalPronoun == "They" and verb == "go" then
-- SpecificReapply the original case tofor the verb ensureif "Theyno Go"conjugation remainschange properlywas casedneeded
if verb == originalVerb:lower() then
result = originalPronoun .. " " .. (verb == "go" and "Go" or verb)
verb = verb:sub(1, -3)originalVerb
end
result = originalPronoun .. " " .. (verb == "go" and "Go" or verb)
end