summaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/schema.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-06-29 20:35:32 -0700
committerBryan Newbold <bnewbold@archive.org>2020-06-29 20:35:32 -0700
commit06adf39b0ab38e08d1977127606b784d1a9aca4f (patch)
treea9d3fd4bcdbff89c3849a4cc0a7467d121df293e /fatcat_scholar/schema.py
parenta0babf64426da4b5c19da224f17c9c8f683ed57d (diff)
downloadfatcat-scholar-06adf39b0ab38e08d1977127606b784d1a9aca4f.tar.gz
fatcat-scholar-06adf39b0ab38e08d1977127606b784d1a9aca4f.zip
include GROBID-extracted abstracts in search documents
Diffstat (limited to 'fatcat_scholar/schema.py')
-rw-r--r--fatcat_scholar/schema.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/fatcat_scholar/schema.py b/fatcat_scholar/schema.py
index cf88011..35cf9a1 100644
--- a/fatcat_scholar/schema.py
+++ b/fatcat_scholar/schema.py
@@ -255,6 +255,14 @@ def contrib_affiliation(contrib: ReleaseContrib) -> Optional[str]:
return None
+def es_abstracts_from_grobid(tei_dict: dict) -> List[ScholarAbstract]:
+
+ if tei_dict.get("abstract"):
+ return [ScholarAbstract(lang_code=tei_dict.get("lang"), body=scrub_text(tei_dict["abstract"]))]
+ else:
+ return []
+
+
def es_abstracts_from_release(release: ReleaseEntity) -> List[ScholarAbstract]:
d = dict()