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
147
Issues
147
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
2abc5056
Commit
2abc5056
authored
Nov 22, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NGRAMS][TABLE] grouping parent/children.
parent
23378ee6
Pipeline
#12
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Ngrams.hs
src/Gargantext/Database/Ngrams.hs
+8
-7
No files found.
src/Gargantext/Database/Ngrams.hs
View file @
2abc5056
...
...
@@ -240,13 +240,14 @@ type ListIdUser = Int
type
ListIdMaster
=
Int
type
MapChildren
=
Map
Text
(
Set
Text
)
type
MapParent
=
Map
Text
Text
getNgramsGroup
::
DPS
.
Connection
->
ListIdUser
->
ListIdMaster
->
IO
(
Map
Text
(
Set
Text
))
getNgramsGroup
conn
lu
lm
=
fromListWith
(
<>
)
<$>
map
(
\
(
a
,
b
)
->
(
a
,
DS
.
singleton
b
))
<$>
getNgramsGroup'
conn
lu
lm
type
MapParent
=
Map
Text
(
Set
Text
)
getNgramsGroup
::
DPS
.
Connection
->
ListIdUser
->
ListIdMaster
->
IO
(
MapParent
,
MapChildren
)
getNgramsGroup
conn
lu
lm
=
do
groups
<-
getNgramsGroup'
conn
lu
lm
let
mapChildren
=
fromListWith
(
<>
)
$
map
(
\
(
a
,
b
)
->
(
a
,
DS
.
singleton
b
))
groups
let
mapParent
=
fromListWith
(
<>
)
$
map
(
\
(
a
,
b
)
->
(
b
,
DS
.
singleton
a
))
groups
pure
(
mapParent
,
mapChildren
)
getNgramsGroup'
::
DPS
.
Connection
->
ListIdUser
->
ListIdMaster
->
IO
[(
Text
,
Text
)]
getNgramsGroup'
conn
lu
lm
=
DPS
.
query
conn
querySelectNgramsGroup
(
lu
,
lm
)
...
...
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