Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
145
Issues
145
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
0301f5d5
Commit
0301f5d5
authored
Dec 07, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] PubMed parser
parent
39874d24
Pipeline
#1279
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
Pubmed.hs
src/Gargantext/Core/Text/Corpus/API/Pubmed.hs
+15
-3
No files found.
src/Gargantext/Core/Text/Corpus/API/Pubmed.hs
View file @
0301f5d5
...
...
@@ -32,7 +32,8 @@ type Limit = PubMed.Limit
-- | TODO put default pubmed query in gargantext.ini
-- by default: 10K docs
get
::
Query
->
Maybe
Limit
->
IO
[
HyperdataDocument
]
get
q
_l
=
either
(
\
e
->
panic
$
"CRAWL: PubMed"
<>
e
)
(
map
(
toDoc
EN
))
<$>
PubMed
.
getMetadataWith
q
(
Just
10000
)
get
q
_l
=
either
(
\
e
->
panic
$
"CRAWL: PubMed"
<>
e
)
(
map
(
toDoc
EN
))
<$>
PubMed
.
getMetadataWith
q
(
Just
10000
)
toDoc
::
Lang
->
PubMedDoc
.
PubMed
->
HyperdataDocument
toDoc
l
(
PubMedDoc
.
PubMed
(
PubMedDoc
.
PubMedArticle
t
j
as
aus
)
...
...
@@ -45,7 +46,7 @@ toDoc l (PubMedDoc.PubMed (PubMedDoc.PubMedArticle t j as aus)
Nothing
t
(
authors
aus
)
Nothing
(
institutes
aus
)
j
(
abstract
as
)
(
Just
$
Text
.
pack
$
show
a
)
...
...
@@ -60,7 +61,18 @@ toDoc l (PubMedDoc.PubMed (PubMedDoc.PubMedArticle t j as aus)
authors
::
Maybe
[
PubMedDoc
.
Author
]
->
Maybe
Text
authors
aus'
=
case
aus'
of
Nothing
->
Nothing
Just
au
->
Just
$
(
Text
.
intercalate
", "
)
$
catMaybes
$
map
PubMedDoc
.
foreName
au
Just
au
->
Just
$
(
Text
.
intercalate
", "
)
$
catMaybes
$
map
(
\
n
->
PubMedDoc
.
foreName
n
<>
Just
" "
<>
PubMedDoc
.
lastName
n
)
au
institutes
::
Maybe
[
PubMedDoc
.
Author
]
->
Maybe
Text
institutes
aus'
=
case
aus'
of
Nothing
->
Nothing
Just
au
->
Just
$
(
Text
.
intercalate
", "
)
$
(
map
(
Text
.
replace
", "
" - "
))
$
catMaybes
$
map
PubMedDoc
.
affiliation
au
abstract
::
Maybe
[
Text
]
->
Maybe
Text
abstract
as'
=
fmap
(
Text
.
intercalate
", "
)
as'
...
...
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