aboutsummaryrefslogtreecommitdiffstats
path: root/mapreduce
diff options
context:
space:
mode:
Diffstat (limited to 'mapreduce')
-rwxr-xr-xmapreduce/extraction_cdx_grobid.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mapreduce/extraction_cdx_grobid.py b/mapreduce/extraction_cdx_grobid.py
index 6659f61..e87da40 100755
--- a/mapreduce/extraction_cdx_grobid.py
+++ b/mapreduce/extraction_cdx_grobid.py
@@ -152,6 +152,12 @@ class MRExtractCdxGrobid(MRJob):
return info, dict(status="error", reason="non-200 GROBID HTTP status",
extra=grobid_response.text)
+ # 4 MByte XML size limit
+ if len(grobid_response.content) > 4000000:
+ info['grobid0:status'] = dict(description=grobid_response.text)
+ return info, dict(status="oversize", reason="TEI response was too large",
+ extra=grobid_response.text)
+
info['grobid0:status'] = {'status': 'success'}
info['grobid0:tei_xml'] = grobid_response.content