-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1271: Authors with compound first names are parsed properly #1282
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -580,4 +580,29 @@ public void testRemoveStartAndEndBraces() { | |
public void createCorrectInitials() { | ||
Assert.assertEquals("J. G.", AuthorList.parse("Hornberg, Johann Gottfried").getAuthor(0).getFirstAbbr()); | ||
} | ||
|
||
@Test | ||
public void parseNameWithBracesAroundFirstName() throws Exception { | ||
//TODO: Be more intelligent and abbreviate the first name correctly | ||
Author expected = new Author("Tse-tung", "{Tse-tung}.", null, "Mao", null); | ||
Assert.assertEquals(new AuthorList(expected), AuthorList.parse("{Tse-tung} Mao")); | ||
} | ||
|
||
@Test | ||
public void parseNameWithBracesAroundLastName() throws Exception { | ||
Author expected = new Author("Hans", "H.", null, "van den Bergen", null); | ||
Assert.assertEquals(new AuthorList(expected), AuthorList.parse("{van den Bergen}, Hans")); | ||
} | ||
|
||
@Test | ||
public void parseNameWithHyphenInFirstName() throws Exception { | ||
Author expected = new Author("Tse-tung", "T.-t.", null, "Mao", null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the correct abbreviation or should one deal with parts without capitals in a special way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking again, maybe it is better to just leave it like this and work on the TODO above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I understand this Java code, but, for the record, the regular abbreviation of Tse-tung is T. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it depends a bit on the convention / citation style which abbreviation is "correct". In the end I decided to leave it like that because it is not a big deal. @mlep thanks for reporting this issue in the first place. I think the author formatting has still some problems with not-so-common-cases. |
||
Assert.assertEquals(new AuthorList(expected), AuthorList.parse("Tse-tung Mao")); | ||
} | ||
|
||
@Test | ||
public void parseNameWithHyphenInLastName() throws Exception { | ||
Author expected = new Author("Firstname", "F.", null, "Bailey-Jones", null); | ||
Assert.assertEquals(new AuthorList(expected), AuthorList.parse("Firstname Bailey-Jones")); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!