This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
localp={}localwords=mw.loadData('Module:A or an/words')locallcVChars='aeiouà-æè-ïò-öø-üāăąēĕėęěĩīĭįıijōŏőœũūŭůűų'localucVvChars='AEFHILMNORSXÀ-ÆÈ-ÏÒ-ÖØĀĂĄĒĔĖĘĚĨĪĬĮıIJŌŎŐŒÑĤĦĹĻĽĿŁŃŅŇŊŔŖŘŚŜŞ'localfunctionfindWord(s,t)fori,vinipairs(t)doifmw.ustring.find(s,'^'..v..'$')thenreturntrueendendendfunctionp._main(args)locals=args[1]andmw.text.trim(args[1])localpron='a'localret=''ifsands~=''thenlocalorigStr=ss=mw.ustring.gsub(s,'</?[A-Za-z][^>]->','')-- Remove HTML tagss=mw.ustring.gsub(s,'%[%[[^%|]+%|(..-)%]%]','%1')-- Remove wikilinkss=mw.ustring.gsub(mw.ustring.gsub(s,'%[%[',''),'%]%]','')s=mw.ustring.gsub(s,'^["%$\'%(<%[%{¢-¥₠-₿]+','')-- Strip some symbols at the beginnings=mw.ustring.match(s,'^%.?[0-9%u%l]+')ors-- Extract the first wordifmw.ustring.find(s,'^[0-9]')then-- It begins with a numbers=mw.ustring.match(s,'^[0-9]+')-- Extract the numberiffindWord(s,words.vNums)then-- '18' etc.pron='an'endelseifmw.ustring.match(s,'^[0-9%u]+$')then-- It looks like an acronymifmw.ustring.find(s,'^['..ucVvChars..']')andnotfindWord(s,words.cvAcronyms)-- Exclude 'NASA' etc.orfindWord(s,words.vvAcronyms)-- 'UNRWA' etc.thenpron='an'endelses=mw.ustring.lower(s)-- Uncapitalizeifmw.ustring.find(s,'^['..lcVChars..']')then-- It begins with a vowelifnotfindWord(s,words.vcWords)-- Exclude 'euro' etc.orfindWord(s,words.vvWords)-- But not 'Euler' etc.thenpron='an'endelseifargs.varietyandmw.ustring.lower(args.variety)=='us'-- 'herb' etc.andfindWord(s,words.cvWordsUS)orfindWord(s,words.cvWords)-- 'hour' etc.thenpron='an'endendret=pron..' '..origStrendreturnretendfunctionp.main(frame)returnp._main(frame:getParent().args)endreturnp