From f67d5379b22aa408d43cee547b693891f58afd3a Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Fri, 31 Jan 2025 09:54:22 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Corrige=20importa=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/pubmed.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packtools/sps/formats/pubmed.py b/packtools/sps/formats/pubmed.py index a1740866e..ee38e18cf 100644 --- a/packtools/sps/formats/pubmed.py +++ b/packtools/sps/formats/pubmed.py @@ -6,13 +6,13 @@ article_abstract, article_and_subarticles, article_authors, - article_citations, article_ids, article_titles, dates, front_articlemeta_issue, journal_meta, kwd_group, + references ) @@ -620,7 +620,7 @@ def xml_pubmed_citations(xml_pubmed, xml_tree): """ - refs = article_citations.ArticleCitations(xml_tree).article_citations + refs = references.ArticleReferences(xml_tree).article_references xml = xml_pubmed.find("./ReferenceList") for ref in refs: ref_el = ET.Element("Reference") From 25bac60cc4cd44b86266735a0b5117723dd4d29f Mon Sep 17 00:00:00 2001 From: Rossi-Luciano Date: Fri, 31 Jan 2025 09:55:35 -0300 Subject: [PATCH 2/2] =?UTF-8?q?Corrige=20a=20obten=C3=A7=C3=A3o=20de=20'ti?= =?UTF-8?q?tle'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/pubmed.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packtools/sps/formats/pubmed.py b/packtools/sps/formats/pubmed.py index ee38e18cf..989057cb0 100644 --- a/packtools/sps/formats/pubmed.py +++ b/packtools/sps/formats/pubmed.py @@ -169,9 +169,10 @@ def xml_pubmed_article_title_pipe(xml_pubmed, xml_tree): """ title = get_article_titles(xml_tree) - if title.get("en") is not None: + title_text = title.get("en", {}).get("text") + if title_text is not None: el = ET.Element("ArticleTitle") - el.text = title.get("en") + el.text = title_text xml_pubmed.append(el) @@ -183,9 +184,10 @@ def xml_pubmed_vernacular_title_pipe(xml_pubmed, xml_tree): """ main_lang = article_and_subarticles.ArticleAndSubArticles(xml_tree).main_lang title = get_article_titles(xml_tree) - if title.get(main_lang) is not None: + title_text = title.get(main_lang, {}).get("text") + if title_text is not None: el = ET.Element("VernacularTitle") - el.text = title.get(main_lang) + el.text = title_text xml_pubmed.append(el)