-- Condição: entrada pelo autor, pelo contribuidor OU pelo título
local agents={}
if #creator >= 1 and #contributor >= 1 then
local newagents={}
if string.match( creator, '^(.*,.*),') then ▼
if #creator >= string.match(1 creator,or '^(.*,.*),')#contributor -- Assis, Machado>= de,1 1839-1908then
if stringtable.matchinsert(agents, creator, '^(.*)%s%(') then
creator = string.match( creator, '^(.*)%s%(') -- Tolkien, J. R. R. (John Ronald Reuel), 1892-1973 ▼
for str ifin string. matchgmatch( contributor, '"([^ (.*,.*;]+) ,'") thendo▼
table.insert(agents, str)
▲ if string.match( contributor, '^(.*,.*),') then
contributor = string.match( contributor, '^(.*,.*),') -- Assis, Machado de, 1839-1908 ▼
end
for k, v in pairs(agents) do
if string.match( contributor, '^(.*)%s%(') then
contributor =if string.match( contributorv, '^(.*)%s%(') -- Tolkien, J. R. R. (John Ronald Reuel*),') 1892-1973then
▲ contributorv = string.match( contributorv, '^(.*,.*),') -- Assis, Machado de, 1839-1908
table.insert(newagents, v)
end
agent = creator .. '; ' .. contributor
agent = frame:callParserFunction{ name = '#regex', args = { agent, '/(^.*?,)|(;.*?,)/', '<span style="text-transform: uppercase;">$1$2</span>' } } ▼
for k, v in pairs(agents) do
reference = agent .. '. <b>' .. title .. '</b>. ' ▼
▲ if string.match( creatorv, '^( .*,.*) ,%s%(') then
▲ creatorv = string.match( creatorv, '^(.*)%s%(') -- Tolkien, J. R. R. (John Ronald Reuel), 1892-1973
elseif #creator >= 1 and #contributor <= 1 then
if string table.matchinsert( creatornewagents, '^(.*,.*v),') then
creator = string.match( creator, '^(.*,.*),') -- Assis, Machado de, 1839-1908
end
if string.match( creator, '^(.*)%s%(') then
agentstr = table.concat(newagents, "; ")
creator = string.match( creator, '^(.*)%s%(') -- Tolkien, J. R. R. (John Ronald Reuel), 1892-1973
▲ agentagentstr = frame:callParserFunction{ name = '#regex', args = { agent, '/(^.*?,)|(;.*?,)/', '<span style="text-transform: uppercase;">$1$2</span>' } }
end
▲ reference = agentagentstr .. '. <b>' .. title .. '</b>. '
creator = frame:callParserFunction{ name = '#regex', args = { creator, '/(^.*?,)|(;.*?,)/', '<span style="text-transform: uppercase;">$1$2</span>' } }
reference = creator .. '. <b>' .. title .. '</b>. '
elseif #contributor >= 1 and #creator <= 1 then
contributor = frame:callParserFunction{ name = '#arraymap', args = { contributor, ';','@@@@', '{{#regex:@@@@|/(^.*?,){{!}}(;.*?,)/|<span style="text-transform: uppercase;">$1$2</span>}}', '; '} }
reference = contributor .. '. <b>' .. title .. '</b>. '
else
|