-- Ste1la Google Code-in, Names of Peoplelocal p =
p.getName = function(frame) local name = frame.args.name or "" local format = frame.args.format local givenName = "" local lastName = "" local obtain = 0 if name
0 then local exist local chineseList = for i = 1, #chineseList do if name:find(chineseList[i]) then exist = 1 end end if exist
0 then local dutchList = for i = 1, #dutchList do if name:find(dutchList[i]) then i, j = name:find(dutchList[i]) lastName = name:sub(i) givenName = name:sub(1, i - 1) obtain = 1 end end -- end --check if spanish if format
nil then lastName = l:reverse .. " " .. k:reverse end end givenName = name:sub(1, i - 1) obtain = 1 elseif name:find(" y ") then i, j, k = name:reverse:match("(%S+) (%S+) (%S+)") lastName = k:reverse .. " " .. j:reverse .. " " .. i:reverse i, j = name:find(lastName) givenName = name:sub(1, i - 2) obtain = 1 else givenName = name:match("%a+") i, j = name:find(givenName) lastName = name:sub(j + 2) obtain = 1 end end --check if thai if format
0 then i, j = name:reverse:find("%S+") lastName = name:reverse:sub(i, j) lastName = lastName:reverse givenName = name:reverse:sub(j + 2) givenName = givenName:reverse -- end out = "Given = " .. givenName .. " -- Family = " .. lastName return outend
return p