Module:HTMLParse: Difference between revisions

133 bytes added ,  19:43, 1 September 2019
if word end in 'y', make it end in 'ies' unless possessive
m (account for pluralizations ending in 's')
(if word end in 'y', make it end in 'ies' unless possessive)
Line 12: Line 12:
     elseif (string.sub(prefix, -1) == 's') then
     elseif (string.sub(prefix, -1) == 's') then
         return (htmlString .. apostrophe)  --return unmodified (ends with 's', like 'boots', so we shouldn't append another 's')
         return (htmlString .. apostrophe)  --return unmodified (ends with 's', like 'boots', so we shouldn't append another 's')
    elseif (string.sub(prefix, -1) == 'y') and apostrophe == '' then
        return (string.sub(prefix, 1, -1) ..  'ies' .. postfix)
     else
     else
         return (prefix .. apostrophe .. 's' .. postfix)
         return (prefix .. apostrophe .. 's' .. postfix)