Content deleted Content added
No edit summary |
No edit summary |
||
Line 1:
local p = {}
-- Normalizes the input to ensure consistent processing
local function normalizeInput(input)
if not input then return "" end
return input:lower()
end
-- Adjusts the verb based on the pronoun and the verb tense
local function adjustVerb(pronoun, verb)
pronoun = normalizeInput(pronoun) -- Normalize the pronoun to handle case sensitivity
-- Handle continuous tense (verbs ending in 'ing')
if verb:sub(-3) == "ing" then
Line 16 ⟶ 23:
if verb == "go" then
verb = "goes"
elseif not verb:match("s$") then -- Add 's' if it doesn't already end with one
verb = verb .. "s"
end
elseif pronoun == "they" and verb:match("es$") then
verb = verb:sub(1, -3) -- Remove 'es' for verbs that end in 'es', like 'goes' -> 'go'
elseif pronoun == "they" and verb:match("s$") then
verb = verb:sub(1, -2) -- Remove 's' for regular verbs
end
return pronoun .. " " .. verb
|