feat(parser): normalize dot-compressed names in split()

Inserts spaces after dots when the cleaned name has no spaces but
contains dots, so the existing last-space fallback handles names
like "E.Rockstroh" and "Dr.Fr.Zarncke" correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-07 17:34:56 +02:00
parent 59475efbcb
commit 0b57717586
2 changed files with 41 additions and 0 deletions

View File

@@ -123,6 +123,11 @@ public class PersonNameParser {
String cleaned = GEB_PATTERN.matcher(rawName).replaceAll("").trim();
// Normalize dot-compressed names: "Dr.Fr.Zarncke" -> "Dr. Fr. Zarncke"
if (!cleaned.contains(" ") && cleaned.contains(".")) {
cleaned = cleaned.replace(".", ". ").trim();
}
String lastName = findKnownLastName(cleaned);
if (lastName != null) {
String firstName = cleaned.substring(0, cleaned.length() - lastName.length()).trim();