Module:Sandbox/Ajuanca/Names: Difference between revisions

Content deleted Content added
Testing
Testing
 
(4 intermediate revisions by the same user not shown)
Line 261:
end
local positions = getPositionOfConecctors(fullNameTable)
if true(positions[1]==0) then
elseifif(#fullNameTable==31)then
table.insert(name.familyNames, lastSurname)
table.insert(name.givenNamesfamilyNames, firstSurnamefullNameTable[1])
elseif(#fullNameTable==2)then
return name
-- 1st maybe is a given name
end
local isGiven = true
if(positions[1]~=0) then
local terminations = {"ez", "es", "is", "iz"}
if(positions[1] ~= 1) then
for xc, articletermination in ipairs(articlesterminations) do
local finalLetters = string.sub(fullNameTable[1], -2, -1)
if (finalLetters == termination) then
isGiven = false
end
end
if(isGiven)then
table.insert(name.familyNamesgivenNames, fullNameTable[21])
else
table.insert(name.familyNames, fullNameTable[21])
end
table.insert(name.familyNames, lastSurnamefullNameTable[2])
else
table.insert(name.givenNames, fullNameTable[1])
table.insert(name.familyNames, fullNameTable[32])
table.insert(name.familyNames, fullNameTable[#fullNameTable3])
end
else
if(positions[2]~= 0)then
if(positions[12]~==0) then
table.insert(name.familyNames, table.concat(fullNameTable, " ", (positions[1]), positions[2]-1 ))
if(positions[1] ~= =1) then
table.insert(name.familyNames, table.concat(fullNameTable, " ", positions[2]))
-- Maybe a second surname is behind
else
table.insert(name.familyNames, table.concat(fullNameTable, " ", positions[21]))
ifelseif(positions[1] ~= =2) then
table.insert(name.familyNames, fullNameTable[2])
-- 1st maybe is a given name
end
local articlesisGiven = {"el", "la", "los", "las"}true
local terminations = {"ez", "es", "is", "iz"}
for x, article in ipairs(articles) do
for c, termination in ipairs(terminations) do
if(article == fullNameTable[#fullNameTable-1]) then
table.insert(name.familyNames,local finalLetters table= string.concatsub(fullNameTable[1], " "-2, positions[-1]))
if (finalLetters == termination) then
isGiven = false
end
end
if(isGiven)then
table.insert(name.givenNames, fullNameTable[1])
else
table.insert(name.familyNames, table.concat(fullNameTable, " ", positions[1], #fullNameTable-1))
table.insert(name.familyNames, fullNameTable[#fullNameTable])
end
table.insert(name.familyNames, table.concat(fullNameTable, " ", positions[1]))
end
endelse
if(positions[21]~= 0=2)then
else
if table.insert(#name.givenNames, fullNameTable==2[1]) then
end
table.insert(name.familyNames, fullNameTable[2])
table.insert(name.familyNames, table.concat(fullNameTable, " ", (positions[1]), positions[2]-1 ))
elseif(#fullNameTable==3)then
table.insert(name.givenNamesfamilyNames, table.concat(fullNameTable, " ", positions[2]))
table.insert(name.familyNames, fullNameTable[3])
end
end