From d55af6140a4d820be01751af3de2dcc6b15cc423 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 21 May 2020 19:50:14 -0700 Subject: be more inclusive of author names --- fatcat_scholar/schema.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fatcat_scholar') 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])), ) -- cgit v1.2.3