Module:A or an: Difference between revisions

Content deleted Content added
'UNRWA' etc.
mNo edit summary
 
Line 29:
if mw.ustring.find(s, '^[0-9]') then -- It begins with a number
s = mw.ustring.match(s, '^[0-9]+') -- Extract the number
if findWord(s, words['.vNums']) then -- '18' etc.
pron = 'an'
end
elseif mw.ustring.match(s, '^[0-9%u]+$') then -- It looks like an acronym
if mw.ustring.find(s, '^[' .. ucVvChars .. ']')
and not findWord(s, words['.cvAcronyms']) -- Exclude 'NASA' etc.
or findWord(s, words['.vvAcronyms']) -- 'UNRWA' etc.
then
pron = 'an'
Line 42:
s = mw.ustring.lower(s) -- Uncapitalize
if mw.ustring.find(s, '^['.. lcVChars .. ']') then -- It begins with a vowel
if not findWord(s, words['.vcWords']) -- Exclude 'euro' etc.
or findWord(s, words['.vvWords']) -- But not 'Euler' etc.
then
pron = 'an'
end
elseif args.variety and mw.ustring.lower(args.variety) == 'us' -- 'herb' etc.
and findWord(s, words['.cvWordsUS'])
or findWord(s, words['.cvWords']) -- 'hour' etc.
then
pron = 'an'