Content deleted Content added
No edit summary |
No edit summary |
||
(17 intermediate revisions by the same user not shown) | |||
Line 1:
local p = {}
--
local function
return verb:match("[oschx]$") or verb:match("sh$") or verb:match("ss$")
end
if verb:sub(-3) == "ing" then▼
if pronoun == "he" or pronoun == "she" or pronoun == "it" then▼
-- Special cases for verb conjugation that don't follow the regular 's' or 'es' pattern
return pronoun .. " is " .. verb▼
local specialCases = {
elseif pronoun == "they" then▼
return pronoun .. " are " .. verb▼
["do"] =
}
-- Determines if the string is fully uppercase
local function isAllCaps(s)
return s:upper() == s
end
-- Correctly applies 'is' or 'are' for continuous verbs based on pronoun, retaining input case
local function applyContinuousVerb(pronoun, verb)
if pronoun:lower() == "they" then
else
end
end
if verb == "go" then▼
-- Adjusts the verb based on the pronoun, verb tense, and input capitalization
▲ verb = "goes"
local function adjustVerb(originalPronoun, originalVerb)
local pronoun = originalPronoun:lower() -- Use lowercase for logic
elseif not verb:match("s$") then▼
local verb = originalVerb and originalVerb:lower() or "" -- Use lowercase for logic, check for nil
verb = verb .. "s"▼
local result = ""
-- Check if a verb is provided
if verb == "" then
result = originalPronoun
else
-- Handle verb logic
▲ if verb:sub(-3) == "ing" then
result = applyContinuousVerb(originalPronoun, originalVerb)
else
-- Simple present tense for singular third-person
▲ if pronoun == "he" or pronoun == "she" or pronoun == "it" then
verb = specialCases[verb] or verb -- Apply special case if exists
verb = verb .. (needsEsEnding(verb) and "es" or "s")
end
▲ elseif pronoun == "they" then
if verb == "has" then
verb = "have"
else
verb = specialCases[verb] or verb
verb = verb:sub(1, -3)
verb = verb:sub(1, -2)
end
end
end
end
▲ elseif pronoun == "they" and verb:match("es$") then
▲ verb = verb:sub(1, -3)
-- Preserve the original case without converting everything to uppercase
▲ elseif pronoun == "they" and verb:match("s$") then
if isAllCaps(originalPronoun) and isAllCaps(originalVerb) then
▲ verb = verb:sub(1, -2)
result = result:upper() -- Only convert to uppercase if both inputs were uppercase
end
end
return result
end
function p.main(frame)
local
local
return adjustVerb(
end
|