Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Melvintong1516/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 = {} p.givenname = function(frame) local name = frame.args.name local nameformat = frame.args.nameformat or "en" if nameformat == "en" then local enposofblank1, enposofblank2 = string.find(name, "(%s)%a+(%s)") if enposofbalnk1 == nil then enposofblank1 = string.find(name, "(%s)%a+") end if enposofblank2 ~= nil then local givenname = string.sub(name, 1, enposofblank2) return givenname else local givenname = string.sub(name, 1, enposofblank1) return givenname end end if nameformat == "de" then local deposofblank1 = string.find(name, "(%s)%a+") local givenname = string.sub(name, 1, deposofblank1) return givenname end end p.famname = function(frame) local name = frame.args.name local nameformat = frame.args.nameformat or "en" if nameformat == "en" then local enposofblank1, enposofblank2= string.find(name, "(%s)%a+(%s)") if enposofblank2 ~= nil then local enendspace = string.find(name, "(%s)%a+", -enposofblank1) if enendspace ~= nil and enendspace ~= enposofblank2 then local famname = string.sub(name, enposofblank2, enendspace) return famname else local famname = string.sub(name, enposofblank2) return famname end else if enposofblank1 == nil then enposofblank1 = string.find(name, "(%s)%a+") local famname = string.sub(name, enposofblank1) return famname end end end if nameformat == "de" then local deposofblank1, deposofblank2 = string.find(name, "(%s)van(%s)" or "(%s)den(%s)" or "(%s)Broek(%s)" or "(%s)de(%s)" or "(%s)de Jesús(%s)" or "(%s)%a+(%s)") if deposofblank1 == nil then deposofblank1 = string.find(name, "(%s)%a+") end if deposofblank2 ~= nil then if string.find(string.sub(name, deposofblank1), string.sub(name, deposofblank2)) == string.sub(name, deposofblank1, deposofblank2) then famname = string.sub(name, deposofblank1) return famname else local famname = string.sub(name, deposofblank2) return famname end else local famname = string.sub(name, deposofblank1) return famname end end end p.test = function(frame) local name = frame.args.name local nameformat = frame.args.nameformat or "en" if nameformat == "de" then local deposofblank1, deposofblank2= string.find(name, "(%s)%a+(%s)") if deposofblank2 ~= nil then local deendspace = string.find(name, "(%s)%a+í%a%s%a+)", -deposofblank2) if deendspace ~= nil then local famname = string.sub(name, deendspace) return famname .. "endspace" else local famname = string.sub(name, deposofblank2) return famname .. "2" end else if deposofblank1 == nil then deposofblank1 = string.find(name, "(%s)%a+") local famname = string.sub(name, deposofblank1) return famname .. "1" end end end 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/Melvintong1516/Names/doc
(
edit
)