mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Normalize author names with run together initials
This commit is contained in:
parent
ea2a5c7537
commit
41815e218a
@ -109,8 +109,12 @@ def get_cached_cover_urls(mi):
|
||||
yield (p, url)
|
||||
|
||||
def cap_author_token(token):
|
||||
if lower(token) in ('von', 'de', 'el', 'van', 'le'):
|
||||
return lower(token)
|
||||
lt = lower(token)
|
||||
if lt in ('von', 'de', 'el', 'van', 'le'):
|
||||
return lt
|
||||
if re.match(r'([a-z]\.){2,}$', lt) is not None:
|
||||
parts = token.split('.')
|
||||
return '. '.join(map(capitalize, parts)).strip()
|
||||
return capitalize(token)
|
||||
|
||||
def fixauthors(authors):
|
||||
|
Loading…
x
Reference in New Issue
Block a user