Skip to content

Commit

Permalink
#110 Parse text inside journal-title nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-herrmann committed Jun 2, 2024
1 parent f0bc9d2 commit d255a2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pubmed_parser/pubmed_oa_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def parse_pubmed_xml(path, include_path=False, nxml=False):

journal_node = tree.findall(".//journal-title")
if journal_node is not None:
journal = " ".join([j.text for j in journal_node])
journal = " ".join(["".join(node.itertext()) for node in journal_node])
else:
journal = ""

Expand Down
1 change: 1 addition & 0 deletions tests/test_pubmed_oa_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def test_parse_pubmed_xml():
assert parsed_xml.get("doi") == "10.1371/journal.pone.0046493"
assert parsed_xml.get("subjects") == "Research Article; Biology; Biochemistry; Enzymes; Enzyme Metabolism; Lipids; Fatty Acids; Glycerides; Lipid Metabolism; Neutral Lipids; Metabolism; Lipid Metabolism; Proteins; Globular Proteins; Protein Classes; Recombinant Proteins; Biotechnology; Microbiology; Bacterial Pathogens; Bacteriology; Emerging Infectious Diseases; Host-Pathogen Interaction; Microbial Growth and Development; Microbial Metabolism; Microbial Pathogens; Microbial Physiology; Proteomics; Sequence Analysis; Spectrometric Identification of Proteins" # noqa
assert "Competing Interests: " in parsed_xml.get("coi_statement")
assert parsed_xml.get("journal") == "PLoS ONE"


def test_parse_pubmed_paragraph():
Expand Down

0 comments on commit d255a2f

Please sign in to comment.