-- Extracting names from names for GCI! :)local dutchSeparation = local chineseSeperation = local arabicSeperation = local spanishSeperation = local spanishLetters = local suffix = local formats =
local divideWords = function(text) wordTable = for word in string.gmatch(text, "%S+") do wordTable[#wordTable+1] = word end for i=1, #suffix do if string.match(wordTable[#wordTable], suffix[i]) then if #wordTable[#wordTable] < 4 then wordTable[#wordTable] = nil end end end return wordTableend
local identifyFormat = function(wordList, fullname) local nameFormat = nil for i=1, #formats do for z=1, #formats[i][2] do for x=1, #wordList do if string.lower(wordList[x])
"de" then for b=1, #spanishLetters do if string.match(fullname, spanishLetters[b]) then return end end for b=1, #wordList do if wordList[b][#wordList[b]]
'a' or wordList[b][#wordList[b]]
'i' then return end end return else return end end end end end return end
local nameSeparation = function(wordList, lastCount) local names = for i=1, #wordList do if i < lastCount then names["first"] = names["first"] .. " " .. wordList[i] else names["last"] = names["last"] .. " " .. wordList[i] end end return namesend
local formatName = function(wordList, nameFormat, providedFormat) local names = if not(providedFormat
"nl" or nameFormat[1]
"zh" then for i=1, #wordList do if i
"es" then if not(nameFormat[2]
"std" then names = nameSeparation(wordList, #wordList) end return namesend
local returnNameString = function(names) return "Given = " .. names["first"] .. " -- Family = " .. names["last"]end
local p =
p.getNames = function(frame) local fullname = frame.args.name local provFormat = frame.args.format or "" local wordList = divideWords(fullname) local nameFormat = identifyFormat(wordList, fullname) local names = formatName(wordList, nameFormat, provFormat) local nameString = returnNameString(names) return nameStringend
return p