mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 00:24:09 +02:00
Normalize author names with run together initials
This commit is contained in:
parent
ea2a5c7537
commit
41815e218a
1 changed files with 6 additions and 2 deletions
|
|
@ -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…
Reference in a new issue