Skip to content

Commit 20116f8

Browse files
author
mgeipel
committed
fixed #93
1 parent 4531372 commit 20116f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/org/culturegraph/mf/stream/converter/bib/PicaDecoder.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public final class PicaDecoder
5353
+ SUB_DELIMITER + "0(.*?)" + FIELD_DELIMITER;
5454
private static final Pattern ID_PATTERN = Pattern
5555
.compile(ID_PATTERN_STRING);
56+
private static boolean appendControlSubField = true;
5657

5758
/**
5859
* For each field in the stream the method calls:
@@ -74,6 +75,10 @@ public void process(final String record) {
7475
process(record, getReceiver());
7576
}
7677

78+
public static void setAppendControlSubField(final boolean appendControlSubField) {
79+
PicaDecoder.appendControlSubField = appendControlSubField;
80+
}
81+
7782
public static String extractIdFromRecord(final String record) {
7883
final Matcher idMatcher = ID_PATTERN.matcher(record);
7984
if (idMatcher.find()) {
@@ -96,7 +101,7 @@ public static void process(final String rawRecord, final StreamReceiver receiver
96101
if (subfields.length > 1) {
97102
final String fieldName;
98103
final int firstSubfield;
99-
if (subfields[1].charAt(0) == 'S') {
104+
if (subfields[1].charAt(0) == 'S' && appendControlSubField ) {
100105
fieldName = subfields[0].trim() + subfields[1].charAt(1);
101106
firstSubfield = 2;
102107
} else {

0 commit comments

Comments
 (0)