Ad placeholder

Module:ParseList: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 22: Line 22:
-- pluralize in a listing.
-- pluralize in a listing.
local specialPlurals = {
local specialPlurals = {
-- Classes
Thief = "Thieves",
thief = "thieves",
-- Weapons
-- Weapons
Quarterstaff = "Quarterstaves",
Quarterstaff = "Quarterstaves",
quarterstaff = "quarterstaves",
quarterstaff = "quarterstaves",
Staff = "Staves",
staff = "staves",
-- Races
-- Races
Elf = "Elves",
elf = "elves",
["Half-Elf"] = "Half-Elves",
["half-elf"] = "half-elves",
["High Half-Elf"] = "High Half-Elves",
["high half-elf"] = "high half-elves",
Dwarf = "Dwarves",
dwarf = "dwarves",
Gith = "Gith",
Gith = "Gith",
gith = "gith",
gith = "gith",
Line 59: Line 50:
return sp
return sp
end
end
if str:sub(-1) == "y" then
local lastLetter = str:sub(-1)
if lastLetter == "y" then
return str:sub(1, -2) .. "ies"
return str:sub(1, -2) .. "ies"
elseif lastLetter == "f" then
return str:sub(1, -2) .. "ves"
end
end
return str .. "s"
return str .. "s"

Navigation menu