Módulo:BibRules: mudanças entre as edições

Ir para navegação Ir para pesquisar
sem sumário de edição
imported>Jaideraf
Sem resumo de edição
imported>Jaideraf
Sem resumo de edição
} or 0
accessPointPresence = tonumber( accessPointPresence )
-- A seguir, testaTesta se há subcampo $b e se há espaço no subcampo $c do campo 090
test = frame:expandTemplate {title = 'Exist', args = {'090', target}} or false
if test ~= '' then
table.insert(infos, info)
end
-- A seguir, testaTesta se não foi esquecida a letra do tíulo na notação de Cutter, caso haja um ponto de acesso 1XX
if accessPointPresence >= 1 and string.match(test, '[0-9]$') then
a = 'Falta a letra do título na notação de Cutter'
end
end
-- A seguir, testaTesta (conta) se existe mais de um ponto de acesso principal
local f100existance = frame:expandTemplate {title = 'Exist', args = {'100', target}}
if accessPointPresence > 1 or f100existance == 'multiple' then
end
-- Testa se existe espaço antes de "ed." (subcampo $a do 250)
local f250 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'250', '0', '0', fullpagename = target}} ) or ''
if f250 ~= '' then
local f250a = frame:expandTemplate {title = 'Select', args = {'250', 'a', target}} or ''
if string.match( f250a, '%d%.?ed%.' ) then
a = 'Inclua um espaço antes da indicação "ed." (subcampo $a do campo 250)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
-- Testa se existe 260, se existir, verifica a pontuação final dos subcampos $a, $b e $c do campo 260
local f260 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'260', '0', '0', fullpagename = target}} ) or ''
if f260 ~= '' then
local f260a = frame:expandTemplate {title = 'Select', args = {'260', 'a', target}} or ''
if f260a ~= '' then
if string.match( f260a, '[a-zA-ZÀ-ü%],]%s?$' ) then
a = 'Normalmente, o final do subcampo $a do campo 260 requer a seguinte pontuação " : "'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
else
a = 'Está faltando o subcampo $a do campo 260'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
local f260b = frame:expandTemplate {title = 'Select', args = {'260', 'b', target}} or ''
if f260b ~= '' then
if string.match( f260b, '[a-zA-Z.]$' ) then
a = 'Normalmente, o final do subcampo $b do campo 260 requer uma das seguintes pontuações ", " ou " : ". Reveja a pontuação'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
else
a = 'Está faltando o subcampo $b do campo 260'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
local f260c = frame:expandTemplate {title = 'Select', args = {'260', 'c', target}} or ''
if f260c ~= '' then
-- Testa se o subcampo $c é precedido ou não por ","
if string.match( f260, '[a-zA-ZÀ-ü%]][;:]%s?%$c' ) then
a = 'O ano de publicação deve sempre ser precedido de uma vírgula. Reveja a pontuação (campo 260)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
if string.match( f260c, '[a-zA-ZÀ-ü0-9%]]$' ) then
a = 'Nossa política de catalogação define que o subcampo $c do campo 260 deve terminar com um ponto'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
else
a = 'Está faltando o subcampo $c do campo 260'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
-- Testa se existe espaço entre o número e a indicaçação de extensão do texto
local f300 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'300', '0', '0', fullpagename = target}} ) or ''
if f300 ~= '' then
local f300a = frame:expandTemplate {title = 'Select', args = {'300', 'a', target}} or ''
if f300a ~= '' then
if string.match( f300a, '%d[a-z]%.' ) then
a = 'Inclua um espaço entre o número e a indicação "p.", "f." ou "v." (subcampo $a do campo 300)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
-- Testa se existe espaço entre "p." e ";"
if string.match( f300a, '%.[:;]' ) then
a = 'Inclua um espaço entre a indicação "p.", "f." ou "v." e a pontuação final (subcampo $a do campo 300)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
-- Testa se existe "il." no subcampo $a (deve estar no subcampo $b)
if string.match( f300a, 'il%.' ) then
a = 'Ilustrações e outros detalhes físicos devem ir no subcampo $b do campo 300, antecedidos de " : "'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
local f300b = frame:expandTemplate {title = 'Select', args = {'300', 'b', target}} or ''
if f300b ~= '' then
-- Testa se existe ".;" no subcampo $b do campo 300
if string.match( f300b, '%.;' ) then
a = 'Inclua um espaço entre o ponto e o ponto e vírgula (campo 300, subcampo $b)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
if string.match( f300b, 'il,' ) then
a = 'Falta um ponto na abreviatura para ilustrações (il.)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
local f300c = frame:expandTemplate {title = 'Select', args = {'300', 'c', target}} or ''
if f300c ~= '' then
-- Testa se a sintaxe das dimensões está correta
if string.match( f300c, '%d[a-z]' ) then
a = 'Atenção, a sintaxe correta para a dimensão é: "NN cm" ou, menos frequentemente, "NN x NN cm" (subcampo $c do campo 300)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
else
a = 'Não foi detectado um subcampo $c no campo 300'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
-- Testa se a pontuação antes da dimensão é ".", "," ou ":"
if string.match( f300, '[.,:]%s?%$c' ) then
a = 'A pontuação que precede a dimensão (300 $c) deve ser " ; "'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
-- Testa se o subcampo $c termina em "-"
if string.match( f300, '%-$' ) then
a = 'Nunca inclua hifens de separação de áreas do AACR2 em registros MARC 21. Reveja a pontuação (campo 300)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
local f440 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'440', '0', '0', fullpagename = target}} ) or ''
if f440 ~= '' then
a = 'O campo 440 é obsoleto. Mova seu conteúdo para o campo 490'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
-- Testa se existem indicadores, parênteses no subcampo $a do campo 490 e se existe ";" antes da numeração da série
local f490 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'490', '0', '0', fullpagename = target}} ) or ''
if f490 ~= '' then
if f490:sub(2, 2) ~= '#' then
a = 'O segundo indicador do campo 490 foi preenchido, porém, ele não deve ser preenchido'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
local f490a = frame:expandTemplate {title = 'Select', args = {'490', 'a', target}} or ''
if f490a ~= '' then
if string.match( f490a, '^%(' ) then
a = 'Segundo as orientações do MARC 21, não inclua os parênteses no campo 490 ou 830'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
local f490v = frame:expandTemplate {title = 'Select', args = {'490', 'v', target}} or ''
if f490v ~= '' then
if not string.match( f490, ';%s?%$v' ) then
a = 'É necessária a pontuação que precede a numeração da série (490, $v)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
-- Testa a consistência entre o indicador do 490 e a presença do campo 830
local f830 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'830', '0', '0', fullpagename = target}} ) or ''
if f490:sub(1, 1) == '#' then
a = 'Está faltando o primeiro indicador do campo 490'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
elseif f490:sub(1, 1) == '1' then
if f830 == '' then
a = 'Foi especificado um ponto de acesso secundário para a série (490, primeiro indicador com valor 1), porém, um campo 830 não foi informado'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
elseif f490:sub(1, 1) == '0' then
if f830 ~= '' then
a = 'O primeiro indicador do campo 490 indica que não foi gerado um ponto de acesso para a série, porém, um campo 830 foi informado'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
else
a = 'O primeiro indicador do campo 490 foi preenchido incorretamente'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
-- Testa se a nota 500 acaba com "."
local f500 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'500', '0', '0', fullpagename = target}} ) or ''
if f500 ~= '' then
if string.match( f500, '[a-zA-ZÀ-ü0-9:;-]$' ) then
a = 'Nossa política de catalogação define que as notas devem terminar com um ponto (500)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
-- Testa se a nota 504 acaba com "." e se existe uso de maiúsculas no meio da nota
local f504 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'504', '0', '0', fullpagename = target}} ) or ''
if f504 ~= '' then
if string.match( f504, '[a-zA-ZÀ-ü0-9]$' ) then
a = 'Nossa política de catalogação define que as notas devem terminar com um ponto (504)'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
-- Testa se existe uso de maiúsculas no meio da nota 504
if string.match( f504, '.*%s[A-Z]' ) then
a = 'Verifique o uso de maiúsculas na nota do campo 504'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
local f600 = mw.text.trim( frame:expandTemplate {title = 'Field data string', args = {'600', '0', '0', fullpagename = target}} ) or ''
-- a seguir, testa os indicadores dos campos 6XX
if f600 ~= '' then
if f600:sub(1, 1) == '#' then
a = 'Está faltando o primeiro indicador do campo 600'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
if f600:sub(2, 2) ~= '4' then
a = 'Nossa política de catalogação define que o segundo indicador do campo 600 deve ser sempre "4"'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
-- Testa se existe "," no subcampo $a (Nome, Sobrenome)
local f600a = frame:expandTemplate {title = 'Select', args = {'600', 'a', target}} or ''
if f600a ~= '' then
if not string.match( f600a, '.*,.' ) then
a = 'Em pontos de acesso, o nome pessoal deve ser invertido (Nome, Sobrenome). Verifique o campo 600'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
if string.match( f600a, '[a-zÀ-ü],[A-ZÀ-ü]' ) then
a = 'Falta espaço após a vírgula. Verifique o campo 600'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
local f600q = frame:expandTemplate {title = 'Select', args = {'600', 'q', target}} or ''
if f600q ~= '' then
if not string.match( f600q, '^%(' ) then
a = 'O subcampo $q do campo 600 necessita parênteses'
info = string.format( '* <strong class="error">%s.</strong>', a )
table.insert(infos, info)
end
end
end
 
 
 
Usuário anônimo

Menu de navegação