Module:Grammar: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 39: Line 39:


parsedtext = string.gsub(frame.args[1], "=([^=]+)=", function(f)
parsedtext = string.gsub(frame.args[1], "=([^=]+)=", function(f)
local bmakeplural = false
  for a, b, c in string.gmatch(f, "(%w*)[:%.]?(['%w]*)(:?%w*)") do
  for a, b, c in string.gmatch(f, "(%w*)[:%.]?(['%w]*)(:?%w*)") do
   if b == nil or b == "" then
   if b == nil or b == "" then
       if a == "article" then
       if a == "article" then
         return "a "
         return "a "
      elseif a == "pluralize" then
        bmakeplural = true
        return ""
       else
       else
         return "="..a.."="
         return "="..a.."="
Line 78: Line 82:
   else
   else
       returnstring = f
       returnstring = f
  end
-- If pluralize is true, pluralize result
  if bmakeplural then
      bmakeplural = false
      returnstring = conjugate.pluralize(returnstring)
   end
   end