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
f505059b
Verified
Commit
f505059b
authored
Sep 13, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactoring] more record syntax refactoring
parent
cf6fbff6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
Annuaire.hs
src/Gargantext/API/Node/Corpus/Annuaire.hs
+10
-10
Export.hs
src/Gargantext/API/Node/Corpus/Export.hs
+7
-5
No files found.
src/Gargantext/API/Node/Corpus/Annuaire.hs
View file @
f505059b
...
@@ -74,18 +74,18 @@ addToAnnuaireWithForm :: FlowCmdM env err m
...
@@ -74,18 +74,18 @@ addToAnnuaireWithForm :: FlowCmdM env err m
->
AnnuaireWithForm
->
AnnuaireWithForm
->
(
JobLog
->
m
()
)
->
(
JobLog
->
m
()
)
->
m
JobLog
->
m
JobLog
addToAnnuaireWithForm
_cid
(
AnnuaireWithForm
ft
_d
_l
)
logStatus
=
do
addToAnnuaireWithForm
_cid
(
AnnuaireWithForm
{
_wf_filetype
}
)
logStatus
=
do
printDebug
"ft"
ft
printDebug
"ft"
_wf_filetype
logStatus
JobLog
{
_scst_succeeded
=
Just
1
logStatus
JobLog
{
_scst_succeeded
=
Just
1
,
_scst_failed
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
1
,
_scst_remaining
=
Just
1
,
_scst_events
=
Just
[]
,
_scst_events
=
Just
[]
}
}
pure
JobLog
{
_scst_succeeded
=
Just
2
pure
JobLog
{
_scst_succeeded
=
Just
2
,
_scst_failed
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
0
,
_scst_remaining
=
Just
0
,
_scst_events
=
Just
[]
,
_scst_events
=
Just
[]
}
}
src/Gargantext/API/Node/Corpus/Export.hs
View file @
f505059b
...
@@ -63,15 +63,17 @@ getCorpus cId lId nt' = do
...
@@ -63,15 +63,17 @@ getCorpus cId lId nt' = do
repo
<-
getRepo'
[
fromMaybe
(
panic
"[Gargantext.API.Node.Corpus.Export]"
)
lId
]
repo
<-
getRepo'
[
fromMaybe
(
panic
"[Gargantext.API.Node.Corpus.Export]"
)
lId
]
ngs
<-
getNodeNgrams
cId
lId
nt
repo
ngs
<-
getNodeNgrams
cId
lId
nt
repo
let
-- uniqId is hash computed already for each document imported in database
let
-- uniqId is hash computed already for each document imported in database
r
=
Map
.
intersectionWith
(
\
a
b
->
Document
a
(
Ngrams
(
Set
.
toList
b
)
(
hash
b
))
(
d_hash
a
b
)
r
=
Map
.
intersectionWith
)
ns
(
Map
.
map
(
Set
.
map
unNgramsTerm
)
ngs
)
(
\
a
b
->
Document
{
_d_document
=
a
,
_d_ngrams
=
Ngrams
(
Set
.
toList
b
)
(
hash
b
)
,
_d_hash
=
d_hash
a
b
}
)
ns
(
Map
.
map
(
Set
.
map
unNgramsTerm
)
ngs
)
where
where
d_hash
a
b
=
hash
[
fromMaybe
""
(
_hd_uniqId
$
_node_hyperdata
a
)
d_hash
a
b
=
hash
[
fromMaybe
""
(
_hd_uniqId
$
_node_hyperdata
a
)
,
hash
b
,
hash
b
]
]
pure
$
Corpus
(
Map
.
elems
r
)
(
hash
$
List
.
map
_d_hash
pure
$
Corpus
{
_c_corpus
=
Map
.
elems
r
$
Map
.
elems
r
,
_c_hash
=
hash
$
List
.
map
_d_hash
$
Map
.
elems
r
}
)
getNodeNgrams
::
HasNodeError
err
getNodeNgrams
::
HasNodeError
err
=>
CorpusId
=>
CorpusId
...
...
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