From 94cffbdfbf9a3564038da90b6a69c65a5c590b34 Mon Sep 17 00:00:00 2001 From: Nils Herrmann Date: Thu, 24 Oct 2024 18:21:28 +0200 Subject: [PATCH] # 158 Stringify descendants in medline parser --- pubmed_parser/medline_parser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pubmed_parser/medline_parser.py b/pubmed_parser/medline_parser.py index 52968ee..5659f5d 100644 --- a/pubmed_parser/medline_parser.py +++ b/pubmed_parser/medline_parser.py @@ -7,7 +7,7 @@ from itertools import chain from lxml import etree from collections import defaultdict -from pubmed_parser.utils import read_xml, stringify_children, stringify_descendants, month_or_day_formater +from pubmed_parser.utils import read_xml, stringify_descendants, month_or_day_formater __all__ = ["parse_medline_xml", "parse_grant_id", "split_mesh"] @@ -622,15 +622,15 @@ def parse_article_info( if section != "UNASSIGNED": abstract_list.append("\n") abstract_list.append(abstract.attrib.get(category, "")) - section_text = stringify_children(abstract).strip() + section_text = stringify_descendants(abstract).strip() abstract_list.append(section_text) abstract = "\n".join(abstract_list).strip() else: abstract = ( - stringify_children(article.find("Abstract/AbstractText")).strip() or "" + stringify_descendants(article.find("Abstract/AbstractText")).strip() or "" ) elif article.find("Abstract") is not None: - abstract = stringify_children(article.find("Abstract")).strip() or "" + abstract = stringify_descendants(article.find("Abstract")).strip() or "" else: abstract = ""