Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
569d42d8
Commit
569d42d8
authored
Mar 04, 2015
by
Mathieu Rodic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUGFIX] If PubMed abstract is made of many parts, all of them are concatenated now
parent
35eede53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
PubmedFileParser.py
parsing/FileParsers/PubmedFileParser.py
+6
-2
No files found.
parsing/FileParsers/PubmedFileParser.py
View file @
569d42d8
...
...
@@ -3,6 +3,8 @@ from lxml import etree
from
.FileParser
import
FileParser
from
..NgramsExtractors
import
*
from
collections
import
defaultdict
class
PubmedFileParser
(
FileParser
):
def
_parse
(
self
,
file
):
...
...
@@ -13,7 +15,7 @@ class PubmedFileParser(FileParser):
# parse all the articles, one by one
for
xml_article
in
xml_articles
:
# extract data from the document
metadata
=
{}
metadata
=
defaultdict
(
str
)
metadata_path
=
{
"journal"
:
'MedlineCitation/Article/Journal/Title'
,
"title"
:
'MedlineCitation/Article/ArticleTitle'
,
...
...
@@ -34,7 +36,9 @@ class PubmedFileParser(FileParser):
for
xml_author
in
xml_node
])
else
:
metadata
[
key
]
=
xml_node
.
text
if
metadata
[
key
]:
metadata
[
key
]
+=
'
\n
'
metadata
[
key
]
+=
xml_node
.
text
except
:
pass
yield
metadata
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment