Module:A or an/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 18:
end
 
local function get_word_from_acronymget_article_from_acronym(text)
if mw.ustring.find(text, '^[' .. ucVvChars .. ']')
and not findWord(text, words.cvAcronyms) -- Exclude 'NASA' etc.
Line 28:
end
 
local function get_number_wordget_article_from_number_word(text)
text = mw.ustring.match(text, '^[0-9]+') -- Extract the number
if findWord(text, words.vNums) then -- '18' etc.
Line 55:
 
if mw.ustring.find(text, '^[0-9]') then -- It begins with a number
article = get_number_wordget_article_from_number_word(text)
elseif mw.ustring.match(text, '^[0-9%u]+$') then -- It looks like an acronym
article = get_word_from_acronymget_article_from_acronym(text)
else
text = mw.ustring.lower(text) -- Uncapitalize
Line 73:
end
end
ret = article .. ' ' .. origStroriginal_text
end