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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
dcaef593
Commit
dcaef593
authored
Apr 06, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Async] Corpus New addToCorpusWithForm
parent
b8eb0898
Pipeline
#801
canceled with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
New.hs
src/Gargantext/API/Corpus/New.hs
+22
-22
No files found.
src/Gargantext/API/Corpus/New.hs
View file @
dcaef593
...
@@ -244,8 +244,14 @@ addToCorpusWithForm :: FlowCmdM env err m
...
@@ -244,8 +244,14 @@ addToCorpusWithForm :: FlowCmdM env err m
->
WithForm
->
WithForm
->
(
ScraperStatus
->
m
()
)
->
(
ScraperStatus
->
m
()
)
->
m
ScraperStatus
->
m
ScraperStatus
addToCorpusWithForm
cid
form
logStatus
=
do
addToCorpusWithForm
cid
(
WithForm
ft
d
l
_n
)
logStatus
=
do
let
parse
=
case
ft
of
CSV_HAL
->
Parser
.
parseFormat
Parser
.
CsvHal
CSV
->
Parser
.
parseFormat
Parser
.
CsvGargV3
WOS
->
Parser
.
parseFormat
Parser
.
WOS
PresseRIS
->
Parser
.
parseFormat
Parser
.
RisPresse
logStatus
ScraperStatus
{
_scst_succeeded
=
Just
1
logStatus
ScraperStatus
{
_scst_succeeded
=
Just
1
,
_scst_failed
=
Just
0
,
_scst_failed
=
Just
0
...
@@ -253,33 +259,27 @@ addToCorpusWithForm cid form logStatus = do
...
@@ -253,33 +259,27 @@ addToCorpusWithForm cid form logStatus = do
,
_scst_events
=
Just
[]
,
_scst_events
=
Just
[]
}
}
_
<-
asyncFlowCorpus
cid
form
printDebug
"Parsing corpus: "
cid
pure
ScraperStatus
{
_scst_succeeded
=
Just
2
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
0
,
_scst_events
=
Just
[]
}
asyncFlowCorpus
::
FlowCmdM
env
err
m
=>
CorpusId
->
WithForm
->
m
()
asyncFlowCorpus
cid
(
WithForm
ft
d
l
_n
)
=
do
let
parse
=
case
ft
of
CSV_HAL
->
Parser
.
parseFormat
Parser
.
CsvHal
CSV
->
Parser
.
parseFormat
Parser
.
CsvGargV3
WOS
->
Parser
.
parseFormat
Parser
.
WOS
PresseRIS
->
Parser
.
parseFormat
Parser
.
RisPresse
-- TODO granularity of the logStatus
docs
<-
liftIO
$
splitEvery
500
docs
<-
liftIO
$
splitEvery
500
<$>
take
1000000
<$>
take
1000000
<$>
parse
(
cs
d
)
<$>
parse
(
cs
d
)
printDebug
"Parsing corpus finished : "
cid
printDebug
"Starting extraction : "
cid
-- TODO granularity of the logStatus
_cid'
<-
flowCorpus
"user1"
_cid'
<-
flowCorpus
"user1"
(
Right
[
cid
])
(
Right
[
cid
])
(
Multi
$
fromMaybe
EN
l
)
(
Multi
$
fromMaybe
EN
l
)
(
map
(
map
toHyperdataDocument
)
docs
)
(
map
(
map
toHyperdataDocument
)
docs
)
pure
()
printDebug
"Extraction finished : "
cid
pure
ScraperStatus
{
_scst_succeeded
=
Just
2
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
0
,
_scst_events
=
Just
[]
}
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