Module:Sandbox/Ajuanca/Names: Difference between revisions

Content deleted Content added
Implementing ru name
Testing
Line 233:
}
if(p.isOnlyName(fullNameTable)) then
table.remove(fullNameTable, n+1)
local connectors = {"de", "del", "el", "la", "los", "las", "y"}
end
local shouldJoinNext = false
local prepositionsconnectors = {"de", "del", "el", "la", "los", "las", "y"}
local connectorsprepositions = {"de", "del", "el", "la", "los", "las", "y"}
for n, name in ipairs(fullNameTable) do
local firstSurname = 0
for k, connector in ipairs(connectors) do
local lastSurname = 0
if (name == connector) then
for nd, nameactualName in ipairs(fullNameTable) do
-- Join the surname till there's only one left or
if(shouldJoinNext and d==#fullNameTable-1 >= n) then
-- there is another preposition.
table.insert(name.familyNames, actualName)
fullNameTable[n] = fullNameTable[n] .. fullNameTable[n+1]
else
table.remove(fullNameTable, n+1)
for kx, connector in ipairs(connectors) do
shouldJoinNext = true
if(connector == actualName) then
else
firstSurname = d
if(shouldJoinNext and #fullNameTable-1 >= n) then
for kz, preposition in ipairs(prepositions) do
fullNameTable[n] = fullNameTable[n] .. fullNameTable[n+1]
if (nameconnector == connectoractualName) then
table.remove(fullNameTable, n+1)
-- This means the two surnames are compound.
for k, preposition in ipairs(prepositions) do
if(prepositionlastSurname == fullNameTable[n+1]) thenz
table.insert(name.familyNames, table.concat(fullNameTable, " ", d, z-1))
shouldJoinNext = false
table.insert(name.familyNames, table.concat(fullNameTable, " ", z))
end
end
if(lastSurname==0) then
-- This means only one is compound or just one is given.
for article in ipairs(articles)do
if(article==name and d+1 == #fullNameTable) then
table.insert(name.familyNames, table.concat(fullNameTable, " ", d))
else
table.insert(name.familyNames, table.concat(fullNameTable, " ", d, #fullNameTable-1))
end
end
Line 256 ⟶ 266:
end
end
table.insert(name.givenNames, actualName)
end
end