aboutsummaryrefslogtreecommitdiffstats
path: root/grobid_tei_xml
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-10-21 14:00:31 -0700
committerBryan Newbold <bnewbold@archive.org>2021-10-21 14:00:31 -0700
commite1679f1044b94d9ec2a9d3b67c8e12581e2f313c (patch)
tree8294dfcf3de91580b425ed58e3d04a329a00f401 /grobid_tei_xml
parent45870aa17b5dec6d63df8b7a2eb7839feac9afec (diff)
downloadgrobid_tei_xml-e1679f1044b94d9ec2a9d3b67c8e12581e2f313c.tar.gz
grobid_tei_xml-e1679f1044b94d9ec2a9d3b67c8e12581e2f313c.zip
get tests to start passing
Diffstat (limited to 'grobid_tei_xml')
-rw-r--r--grobid_tei_xml/__init__.py0
-rwxr-xr-xgrobid_tei_xml/grobid2json.py2
2 files changed, 1 insertions, 1 deletions
diff --git a/grobid_tei_xml/__init__.py b/grobid_tei_xml/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/grobid_tei_xml/__init__.py
diff --git a/grobid_tei_xml/grobid2json.py b/grobid_tei_xml/grobid2json.py
index 5c44953..ac0710c 100755
--- a/grobid_tei_xml/grobid2json.py
+++ b/grobid_tei_xml/grobid2json.py
@@ -45,7 +45,7 @@ def all_authors(elem: Optional[ET.Element], ns: str = ns) -> List[Dict[str, Any]
continue
given_name = pn.findtext("./{%s}forename" % ns) or None
surname = pn.findtext("./{%s}surname" % ns) or None
- full_name = " ".join(pn.itertext())
+ full_name = " ".join([t.strip() for t in pn.itertext() if t.strip()]).strip()
obj: Dict[str, Any] = dict(name=full_name)
if given_name:
obj["given_name"] = given_name