View source for Module:Detect singular
From iWiki
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local p = {}
local getArgs = require('Module:Arguments').getArgs
local yesNo = require('Module:Yesno')
local getPlain = require('Module:Text').Text().getPlain
-- function to determine whether "sub" occurs in "s"
local function plainFind(s, sub)
return mw.ustring.find(s, sub, 1, true)
end
-- function to count the number of times "pattern" (a regex) occurs in "s"
local function countMatches(s, pattern)
local _, count = mw.ustring.gsub(s, pattern, '')
return count
end
local singular = 1
local likelyPlural = 2
local plural = 3
000
1:0
Template used on this page:
Return to Module:Detect singular.