Skip to content

Commit

Permalink
Ignore some title-initial strings when sorting journals list (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Jan 23, 2024
1 parent f3711ab commit 1e6cd68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/nwbib/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public static Promise<Result> journals() {
}).collect(Collectors.toList());
Collections.sort(journals, (map1, map2) -> {
return Collator.getInstance(Locale.GERMANY).compare(//
map1.get(label), map2.get(label));
sortValue(map1, label), sortValue(map2, label));
});
return ok(browse_register.render(Json.toJson(journals).toString(),
"Zeitschriften", "Zeitschriftenliste filtern"));
Expand All @@ -350,6 +350,10 @@ public static Promise<Result> journals() {
});
}

private static String sortValue(Map<String, String> map, final String key) {
return map.get(key).replaceAll("^(Der|Die|Das|\\.\\.\\.)\\s", "");
}

private static String journalLabelFor(JsonNode doc) {
String other = "otherTitleInformation";
String responsibility = "responsibilityStatement";
Expand Down

0 comments on commit 1e6cd68

Please sign in to comment.