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
Sem resumo de edição
(34 revisões intermediárias por 2 usuários não estão sendo mostradas)
title = "Field data string",
args = {"001", "0", "", property = "Control field data", fullpagename = target}
} or ""
local f003 =
frame:expandTemplate {
title = "Field data string",
args = {"003", "0", "", property = "Control field data", fullpagename = target}
} or ""
a = "Internamente, este registro é identificado pelo código"
b = "para sistemas externos, o código é"
end
local modificationDate =
mw.smw.ask("[[" .. target .. "]]|?Modification date#-F[l, d \\d\\e F \\d\\e Y]|headers=hide|mainlabel=-") or ""
if type(modificationDate) == "table" then
for _, row in pairs(modificationDate) do
table.insert(infos, info)
-- Campo 008
local invalidCode = '<strong class="error">código inválido para o local de publicação.</strong>'
local pubPlaceTbl = {
["acb"] = "Acre",
["sp "] = "Espanha",
["gw "] = "Alemanha",
["xx "] = '<strong class="error">não foi identificado um local de publicação no campo 008.</strong>',
["vp "] = "há vários locais de publicação",
["esp"] = invalidCode,
frame:expandTemplate {
title = "Field data string",
args = {"008", "15", "3", property = "Control field data", fullpagename = target} or ""
}
if string.match(f008pubPlace, "^[A-Z]") then
elseif pubPlaceTbl[f008pubPlace] then
a = "O item possui a seguinte origem:"
info = string.format("* %s %s.", a, tostring(pubPlaceTbl[f008pubPlace]))
table.insert(infos, info)
else
a = "O item possui a seguinte origem:"
info = string.format("* %s %s.", a, f008pubPlace)
table.insert(infos, info)
end
invalidCode = '<strong class="error">código inválido para o idioma (campo 008 ou subcampo $h do campo 041).</strong>'
local langTbl = {
["por"] = "português",
title = "Field data string",
args = {"008", "35", "3", property = "Control field data", fullpagename = target}
} or ""
if string.match(f008lang, "^[A-Z]") then
a = "O uso de maiúsculas não é permitido no campo 008, idioma"
if f041 ~= "" then
if f041:sub(1, 1) == "1" then
local f041h = frame:expandTemplate {title = "Select", args = {"041", "h", target}} or ""
f041h = langTbl[f041h] or f041h
info = string.format("%s (traduzido do %s).", info, f041h)
end
end
-- Testa se existe(m) ISBN(s) inválido(s)
local f020 =
mw.text.trim(frame:expandTemplate {title = "Field data string", args = {"090020", "0", "0", fullpagename = target}}) or
""
if f020 ~= "" then
end
-- Testa se existe(m) hifen(s) ou x minúsculo no ISBN
local f020 = mw.smw.ask("[[" .. target .. "#020]]|?Field data#|headers=hide|mainlabel=-") or ""
if type(f020) == "table" then
for _, row in pairs(f020) do
for _, data in pairs(row) do
f020if = mw.text.trim(table.concattype(data)) == "table" then
f020 = mw.text.trim(table.concat(data))
else
f020 = mw.text.trim(data)
end
end
end
elseif string.match(f020, "x") then
a = 'O ISBN não pode conter um x minúsculo. Apenas números e "X" maiúsculo'
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
elseif string.match(f020, "%(") then
a = 'O campo de ISBN só pode conter números e "X" maiúsculo. Use o subcampo $q para outros dados (sem parênteses)'
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
table.insert(infos, info)
end
local f041a = frame:expandTemplate {title = "Select", args = {"041", "a", target}} or false""
if string.match(f041a, "^[A-Z]") then
a = "O uso de maiúsculas não é permitido nos códigos de idioma (campo 041)"
end
-- Testa (conta) se existe mais de um ponto de acesso principal
local f100existance = frame:expandTemplate {title = "Exist", args = {"100", target}} or ""
if accessPointPresence > 1 or f100existance == "multiple" then
a = "Foi registrado <b>mais de um ponto de acesso principal</b>. Isso não é permitido"
info = "O ponto de acesso principal foi dado a uma <b>pessoa</b>"
if f100:sub(1, 1) == "0" then
a = "'e a entrada começa pelo seu <bstrong class="error">primeiro nome</bstrong>"'
info = string.format("* %s %s.", info, a)
table.insert(infos, info)
end
-- Testa se existe ', ' no subcampo $a (Nome, Sobrenome)
local f100a = frame:expandTemplate {title = "Select", args = {"100", "a", target}} or ""
if f100a ~= "" then
if not string.match(f100a, ".-,.") then
end
end
local f100q = frame:expandTemplate {title = "Select", args = {"100", "q", target}} or ""
if f100q ~= "" then
if not string.match(f100q, "^%(") then
end
end
local f100d = frame:expandTemplate {title = "Select", args = {"100", "d", target}} or ""
if f100d ~= "" then
if string.match(f100, "%$d %d%d%d%d$") then
table.insert(infos, info)
else
local f130a = frame:expandTemplate {title = "Select", args = {"130", "a", target}} or ""
a = ucfirst(f130a:sub(f130:sub(1, 1)))
info = string.format('* %s, ele será alfabetado como "<b>%s</b>".', info, a)
else
local f240a =
string.gsub(mw.text.trim(frame:expandTemplate {title = "Select", args = {"240", "a", target}}), "[/:=.]$", "") or ""
a = "O título uniforme será alfabetado como"
b = ucfirst(f240a:sub(f240:sub(2, 2) + 1))
elseif f245ind1 == "1" then
a = "O título recebeu um <b>ponto de acesso secundário</b>"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
elseif f245ind1 == "#" then
end
-- Testa se foi preenchido o segundo indicador do 245, se foi, mostra como será a alfabetação, removendo a pontuação final do subcampo $a ('/',':','='' ou '.')
local f245a = frame:expandTemplate {title = "Select", args = {"245", "a", target}} or ""
if f245:sub(2, 2) == "#" then
a = "Está faltando o segundo indicador do campo 245"
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
if string.match(f250a, "%-$") then
a = "Nunca inclua hifens de separação de áreas do AACR2 em registros MARC 21. Reveja a pontuação (campo 250)"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
table.insert(infos, info)
end
if string.match(f300b, "il%.?, col") then
a = "'Ilustrações coloridas' (il. color.) é uma expressão só, remova a vírgula"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
end
-- Testa se o subcampo $b termina em ":"
if not string.match(f300, ":%s%$b") then
a = 'A pontuação que precede o subcampo $b, no campo 300, deve ser sempre " : "'
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 ""
end
else
a = "NãoEstá foifaltando detectado umo subcampo $c nodo campo 300"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
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
if string.match(f500, "inclui") then
a = "Verifique o uso de maiúsculas no início de frase ('inclui')"
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:sub(6), ".*%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
if string.match(f504, "Inclui índice%.?$") then
a = "'Inclui índice', somente, deve estar no campo 500"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
end
-- Testa se os assuntos começam com letra minúscula
if string.match(f650, "%$[axzy]%s[a-zà-üz]") then
a = "Os assuntos principais e suas subdivisões devem começar com letra maiúscula"
info = string.format('* <strong class="error">%s.</strong>', a)
info = "Um ponto de acesso secundário foi dado a uma <b>pessoa</b>"
if f700:sub(1, 1) == "0" then
a = "'e a entrada começa pelo seu <bstrong class="error">primeiro nome</bstrong>"'
info = string.format("* %s %s.", info, a)
table.insert(infos, info)
end
-- testa se existe "," no subcampo $a (Nome, Sobrenome)
local f700a = frame:expandTemplate {title = "Select", args = {"700", "a", target}} or ""
if f700a ~= "" then
if not string.match(f700a, ".-,.") then
end
end
local f700q = frame:expandTemplate {title = "Select", args = {"700", "q", target}} or ""
if f700q ~= "" then
if not string.match(f700q, "^%(") then
if f711:sub(2, 2) ~= "#" then
a = "O segundo indicador do campo 711 foi preenchido, porém, ele não deve ser preenchido"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
end
end
local f740 =
mw.text.trim(frame:expandTemplate {title = "Field data string", args = {"740", "0", "0", fullpagename = target}}) or
""
if f740 ~= "" then
if f740:sub(1, 1) == "#" then
a = "O primeiro indicador do campo 740 precisa ser preenchido"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
local f830v = frame:expandTemplate {title = "Select", args = {"830", "v", target}} or ""
if f830v ~= "" then
if not string.match(f830vf830, ";%s?%$v") then
a = "É necessária a pontuação que precede a numeração da série (830, $v)"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
end
end
if f490 == "" then
a = "Foi informado um ponto de acesso secundário para a série (campo 830), porém, um campo 490 não foi detectado"
info = string.format('* <strong class="error">%s.</strong>', a)
table.insert(infos, info)
end
end
local isoRecord =
frame:callParserFunction {
name = "#ask:[[-Has subobject::" .. "B000004"target .. "]][[Field data::+]]",
args = {
"?Field data",

Menu de navegação