Skip to content

Commit

Permalink
Merge pull request #137 from grlee77/author_fix
Browse files Browse the repository at this point in the history
ENH: update name_key in authors.py to handle apostrophes
  • Loading branch information
rgommers committed Dec 9, 2015
2 parents a5058b8 + cba0288 commit a6c8e38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

NAME_MAP = {
u('Helder'): u('Helder Oliveira'),
u('Kai'): u('Kai Wohlfahrt'),
}


Expand Down Expand Up @@ -87,13 +88,14 @@ def analyze_line(line, names, disp=False):

# Sort
def name_key(fullname):
m = re.search(u(' [a-z ]*[A-Za-z-]+$'), fullname)
m = re.search(u(' [a-z ]*[A-Za-z-\']+$'), fullname)
if m:
forename = fullname[:m.start()].strip()
surname = fullname[m.start():].strip()
else:
forename = ""
surname = fullname.strip()
surname = surname.replace('\'', '')
if surname.startswith(u('van der ')):
surname = surname[8:]
if surname.startswith(u('de ')):
Expand Down

0 comments on commit a6c8e38

Please sign in to comment.