Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Nathan fraignt/Names
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local dutchWordsArray = {"van", "der", "de", "den"} local dutchWordsArray_idx = {} for i,v in ipairs(dutchWordsArray) do dutchWordsArray_idx[v] = i end local spanishAccentsArray = {"ó","á","é","í","ú", "ñ"} local spanishAccentsArray_idx = {} for i,v in ipairs(spanishAccentsArray) do spanishAccentsArray_idx[v] = i end -- This is by no means a complete list. local chineseNamesArray = {"Chen", "Ching", "Li", "Chan", "Cheung", "Tsi-ang", "Cho", "Chiu", "Choi, Chow", "Fok", "Fu", "Hui", "Ho", "Kao", "Kwok", "Kwong", "Kwan", "Lau", "Lam", "Ma", "Ng", "Siu", "Tam", "Tang", "To"} local chineseNamesArray_idx = {} for i,v in ipairs(chineseNamesArray) do chineseNamesArray_idx[v] = i end -- es, nl, zh, us p.getNames = function(frame) local getFormat = function(nf_name) -- Spanje local test = "" for letter in string.gmatch(nf_name, "%a") do if spanishAccentsArray_idx[letter] then return "es" end -- test = test .. "-" .. letter test = test .. letter end -- Dutch for word in string.gmatch(nf_name, "%w+" ) do if dutchWordsArray_idx[word] then return "nl" end end -- Chinese for word in string.gmatch(nf_name, "%w+" ) do if chineseNamesArray_idx[word] then return "zh" end end -- Default: US return test end local nf_name = frame.args.name or "" local format = frame.args.format or getFormat(nf_name) return format end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/Nathan fraignt/Names/doc
(
edit
)