Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nonfiling character ¬ in Allegro data import (RPB-218) #96

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/rpb/Decode.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public final class Decode extends DefaultObjectPipe<String, StreamReceiver> {

@Override
public void process(final String obj) {
currentRecord = obj;
LOG.debug("Process record: " + obj);
final String[] vals = obj.split("\\[/\\]");
recordId = getId(obj, vals);
LOG.debug("Process record: " + obj);
currentRecord = obj.replace("¬", ""); // Nonfiling character
final String[] vals = currentRecord.split("\\[/\\]");
recordId = getId(currentRecord, vals);
getReceiver().startRecord(recordId);
processFields(vals);
getReceiver().endRecord();
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
} ],
"title" : "The Rhenish minstrel [Elektronische Ressource] : A Series of Ballads, traditional and legendary, of the Rhine",
"extent" : "[1], [21] Kunstbl. ; s/w ; 24 x 28 cm",
"note" : [ "In Fraktur ; HT010123631 Dt. Ausg. u.d.T.: Stolterfoth, Adelheid ¬von¬: Rheinischer Sagenkreis" ],
"note" : [ "In Fraktur ; HT010123631 Dt. Ausg. u.d.T.: Stolterfoth, Adelheid von: Rheinischer Sagenkreis" ],
"responsibilityStatement" : [ "by Adelheid von Stolterfoth. Embellished with twenty-one lithographic sketches, by Dielmann, from the designs of A. Rethel" ],
"publication" : [ {
"location" : [ "Frankfort o/M." ],
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-38.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982375",
"label" : "¬Die¬ Zeitschrift : der Südwestrundfunk und seine Programme. Rheinland-Pfalz"
"label" : "Die Zeitschrift : der Südwestrundfunk und seine Programme. Rheinland-Pfalz"
} ],
"numbering" : "1998,1(Sept.) - 2001,9(Sept.)"
} ],
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-4.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
} ],
"title" : "The Rhenish minstrel [Elektronische Ressource] : A Series of Ballads, traditional and legendary, of the Rhine",
"extent" : "[3] Bl., 19 S., [1] Bl., 65 S., [21] Bl. : zahlr. Ill. ; quer 4-o",
"note" : [ "In Fraktur. Titelbl., Inhaltsverz., und 19 S. Erläuterungen in Engl., Text dt. ; HT010123631 Dt. Ausg. u.d.T.: Stolterfoth, Adelheid ¬von¬: Rheinischer Sagenkreis" ],
"note" : [ "In Fraktur. Titelbl., Inhaltsverz., und 19 S. Erläuterungen in Engl., Text dt. ; HT010123631 Dt. Ausg. u.d.T.: Stolterfoth, Adelheid von: Rheinischer Sagenkreis" ],
"responsibilityStatement" : [ "by Adelheid von Stolterfoth. Embellished with twenty-one lithographic sketches, by Dielmann, from the designs of A. Rethel" ],
"publication" : [ {
"location" : [ "Frankfort o/M." ],
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-42.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982377",
"label" : "¬Der¬ Rasenspieler : das Journal zur Saison ..."
"label" : "Der Rasenspieler : das Journal zur Saison ..."
} ],
"numbering" : "Nachgewiesen 1998/99(1998) - 2000/01; 2001/02 - 2002/03"
} ],
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-44.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982378",
"label" : "¬'s¬ Derfsche : Ebertsheim-Rodenbach, das Dorf im Grünen"
"label" : "'s Derfsche : Ebertsheim-Rodenbach, das Dorf im Grünen"
} ],
"numbering" : "1998,Apr."
} ],
Expand Down
46 changes: 23 additions & 23 deletions conf/output/test-output-strapi.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions conf/rpb-titel-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ call_macro("move_here", field: "title")
if is_array("title")
copy_field("title.$last", "title")
end
replace_all("title","¬","")
replace_all("title", "\\s\\+", "")

# ------- "extent" -------
Expand Down Expand Up @@ -308,7 +307,6 @@ call_macro("contributions", from: "corporateBody")
move_field("bibliographicCitation.value", "_temp")
remove_field("bibliographicCitation")
move_field("_temp", "bibliographicCitation")
replace_all("bibliographicCitation","¬","")

# fulltextOnline and link to external description/ToC

Expand Down
12 changes: 12 additions & 0 deletions test/rpb/DecodeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ public void processRecordWithMultipleTitles() {
});
}

@Test
public void processRecordWithNonfilingCharacters() {
test("[/]#00 929t124030b6[/]#20 ¬Der¬ Rhein - Rheinfelden bis Koblenz[/]", () -> {
final InOrder ordered = inOrder(receiver);
ordered.verify(receiver).startRecord("929t124030b6");
ordered.verify(receiver).literal("f00_", "929t124030b6");
ordered.verify(receiver).literal("f20_", "Der Rhein - Rheinfelden bis Koblenz");
ordered.verify(receiver).endRecord();
ordered.verifyNoMoreInteractions();
});
}

@Test
public void processError() {
exception.expect(MetafactureException.class);
Expand Down
Loading