fix(parser): preserve annotation parens for single-person inputs
Move paren extraction in parseReceivers() after the multi-separator check so single-person entries like "Clara de Gruyter(*1871)" keep their parens intact for split()'s annotation extraction. Multi-person entries like "Hedi und Tutu (Gruber)" still use parens as shared last-name override. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,18 @@ class PersonNameParserTest {
|
||||
.containsExactly("Eugenie de Gruyter");
|
||||
}
|
||||
|
||||
@Test
|
||||
void singlePerson_annotationParenPreserved() {
|
||||
assertThat(PersonNameParser.parseReceivers("Clara de Gruyter(*1871)"))
|
||||
.containsExactly("Clara de Gruyter(*1871)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void singlePerson_nicknameParenPreserved() {
|
||||
assertThat(PersonNameParser.parseReceivers("Gertrud D.(Tuttu)"))
|
||||
.containsExactly("Gertrud D.(Tuttu)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void gebAnnotation_noDot_multiWord_stripped() {
|
||||
assertThat(PersonNameParser.parseReceivers("Ella Dieckmann, geb de Gruyter"))
|
||||
|
||||
Reference in New Issue
Block a user