Skip to content

Commit

Permalink
Allow unlimited alternative entries for authormap, add D.C for DC.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoering committed Jun 27, 2024
1 parent cfe79f2 commit 744fb28
Show file tree
Hide file tree
Showing 2 changed files with 4,964 additions and 4,959 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ public static AuthorshipNormalizer createWithoutAuthormap() {
private static AuthorshipNormalizer createWithAuthormap() {
Map<String, String> map = new HashMap<>();
Resources.tabRows(AUTHOR_MAP_FILENAME).forEach(row -> {
map.put(row[0], row[2]);
map.put(row[1], row[2]);
var value = row[0];
for (int i = 1; i < row.length; i++) {
map.put(row[i], value);
}
});
return new AuthorshipNormalizer(map);
}
Expand All @@ -64,6 +66,9 @@ public AuthorshipNormalizer(Map<String, String> authors) {
String key = normalize(entry.getKey());
String val = normalize(entry.getValue());
if (key != null && val != null) {
if (map.containsKey(key) && !map.get(key).equals(val)) {
LOG.warn("Authormap contains duplicate key {} for {} - verbatim={} - previous standard value={}", key, val, entry.getKey(), map.get(key));
}
map.put(key, val);
}
}
Expand Down
Loading

0 comments on commit 744fb28

Please sign in to comment.