Skip to content

Commit

Permalink
issue #75: add tag VIT
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 19, 2020
1 parent 1d2580b commit b513020
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@ private void initialize() {
"s", "Contains the string ‘Supplement’ if the Newspaper Audit database Item Description field contained ‘supp’. Otherwise blank", "NR"
);

getSubfield("b").setMqTag("barcode");
getSubfield("c").setMqTag("status");
getSubfield("d").setMqTag("description");
getSubfield("b")
.setValidator(new RegexValidator("^.*[^\\.]$"))
.setMqTag("barcode");
getSubfield("c")
.setValidator(new RegexValidator("^.*[^\\.]$"))
.setMqTag("status");
getSubfield("d")
.setValidator(new RegexValidator("^.*[^\\.]$"))
.setMqTag("description");
getSubfield("e")
.setValidator(new RegexValidator("^(1[5-9]|20)\\d\\d$"))
.setMqTag("fromYear");
Expand All @@ -73,7 +79,12 @@ private void initialize() {
.setValidator(
new RegexValidator("^(0[1-9]|[1-2][0-9]|3[01])(/(0[1-9]|[1-2][0-9]|3[01]))?$"))
.setMqTag("fromToDay");
getSubfield("o").setMqTag("opacNote");
getSubfield("s").setMqTag("isSupplement");
getSubfield("o")
.setValidator(new RegexValidator("^.*[^\\.]$"))
.setMqTag("opacNote");
// TODO: in the PDF it is not well formatted
getSubfield("s")
.setValidator(new RegexValidator("^(Supplement|)$"))
.setMqTag("isSupplement");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public void testValidFields() {
validField("j", "11/12");
validField("k", "11");
validField("k", "11/12");
validField("s", "Supplement");
validField("s", "");
}

@Test
Expand All @@ -37,5 +39,6 @@ public void testInvalidFields() {
invalidField("j", "13");
invalidField("j", "01/13");
invalidField("k", "01/32");
invalidField("s", "Supplement.");
}
}

0 comments on commit b513020

Please sign in to comment.