diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-05-21 19:50:14 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-05-21 19:50:14 -0700 |
commit | d55af6140a4d820be01751af3de2dcc6b15cc423 (patch) | |
tree | cb880a92ccb1ab8cf24f5e1c177144c1f83f26a9 /fatcat_scholar/schema.py | |
parent | b0e77aebf00ec93d0a8bc5e948cad014c32e74d1 (diff) | |
download | fatcat-scholar-d55af6140a4d820be01751af3de2dcc6b15cc423.tar.gz fatcat-scholar-d55af6140a4d820be01751af3de2dcc6b15cc423.zip |
be more inclusive of author names
Diffstat (limited to 'fatcat_scholar/schema.py')
-rw-r--r-- | fatcat_scholar/schema.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fatcat_scholar/schema.py b/fatcat_scholar/schema.py index 74c80c8..c987a17 100644 --- a/fatcat_scholar/schema.py +++ b/fatcat_scholar/schema.py @@ -197,10 +197,10 @@ def scrub_text(raw: str, mimetype: str = None) -> str: def contrib_name(contrib: ReleaseContrib) -> str: # TODO: support more cultural normals for name presentation - if contrib.given_name and contrib.surname: - return f"{contrib.given_name} {contrib.surname}" - elif contrib.raw_name: + if contrib.raw_name: return contrib.raw_name + elif contrib.given_name and contrib.surname: + return f"{contrib.given_name} {contrib.surname}" elif contrib.surname: return contrib.surname else: @@ -291,7 +291,7 @@ def es_biblio_from_release(release: ReleaseEntity) -> ScholarBiblio: issns=issns, # TODO; these filters sort of meh. refactor to be above? - contrib_names=list(filter(lambda x: bool(x), [contrib_name(c) for c in release.contribs if c.index])), + contrib_names=list(filter(lambda x: bool(x), [contrib_name(c) for c in release.contribs])), contrib_count = len([c for c in release.contribs if c.index]), affiliations=list(filter(lambda x: bool(x), [contrib_affiliation(c) for c in release.contribs if c.index])), ) |