Content deleted Content added
Testing |
Testing |
||
(34 intermediate revisions by the same user not shown) | |||
Line 232:
familyNames = {}
}
if(not(p.isOnlyName(fullNameTable))) then
table.remove(fullNameTable)
end
local connectors = {"de", "del", "y"}▼
table.insert(name.givenNames, fullNameTable[1])
table.remove(fullNameTable, 1)
function getPositionOfConecctors(fullNameTable)
for d, actualName in ipairs(fullNameTable)do
▲ local firstSurname = 0
▲ local lastSurname = 0
for x, connector in ipairs(connectors) do
if(connector == actualName) then
Line 255:
end
end
end
end
Line 262 ⟶ 261:
end
local positions = getPositionOfConecctors(fullNameTable)
if(positions[1]
if(
table.insert(name.familyNames,
-- 1st maybe is a given name
local isGiven = true
local terminations = {"ez", "es", "is", "iz"}
for c, termination in ipairs(terminations) do
local finalLetters = string.sub(fullNameTable[1], -2, -1)
if (finalLetters == termination) then
isGiven = false
end▼
if(isGiven)then
else
table.insert(name.
end
else
if(
▲ table.insert(name.familyNames, fullNameTable[2])
-- Maybe a second surname is behind
elseif(positions[1]==2)then
-- 1st maybe is a given name
local terminations = {"ez", "es", "is", "iz"}
local finalLetters = string.sub(fullNameTable[1], -2, -1)
if (finalLetters == termination) then
isGiven = false
if(isGiven)then
table.insert(name.givenNames, fullNameTable[1])
table.insert(name.familyNames, fullNameTable[1])
table.insert(name.familyNames, table.concat(fullNameTable, " ", positions[1]))
else
if(positions[1]==2)then
table.insert(name.givenNames, fullNameTable[ end▼
▲ table.insert(name.familyNames, fullNameTable[3])
table.insert(name.familyNames, table.concat(fullNameTable, " ", positions[1], positions[2]-1))
table.insert(name.familyNames, table.concat(fullNameTable, " ", positions[2]))
end
end
▲ -- table.insert(name.givenNames, fullNameTable[1])
▲ -- table.insert(name.givenNames, fullNameTable[2])
▲ -- table.insert(name.familyNames, fullNameTable[3])
▲ -- table.insert(name.familyNames, fullNameTable[4])
▲ --end
return name
end
Line 416 ⟶ 447:
end
return isJustName
▲end
▲ local commonSurnames = {
▲ }},
▲ }},
▲ }},
▲ }}
▲ }
▲ for d, specificLanguageTable in ipairs(commonSurnames) do
▲ if(surname == name) then
▲ end
▲ end
▲ end
end
return p
|