Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
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
Changes
1
Hide 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
->
WithForm
->
(
ScraperStatus
->
m
()
)
->
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
,
_scst_failed
=
Just
0
...
...
@@ -253,33 +259,27 @@ addToCorpusWithForm cid form logStatus = do
,
_scst_events
=
Just
[]
}
_
<-
asyncFlowCorpus
cid
form
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
printDebug
"Parsing corpus: "
cid
-- TODO granularity of the logStatus
docs
<-
liftIO
$
splitEvery
500
<$>
take
1000000
<$>
parse
(
cs
d
)
printDebug
"Parsing corpus finished : "
cid
printDebug
"Starting extraction : "
cid
-- TODO granularity of the logStatus
_cid'
<-
flowCorpus
"user1"
(
Right
[
cid
])
(
Multi
$
fromMaybe
EN
l
)
(
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