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
f03449b1
Commit
f03449b1
authored
Oct 16, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SocialList] some fixes, still testing
parent
af817f81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
List.hs
src/Gargantext/Core/Text/List.hs
+9
-7
No files found.
src/Gargantext/Core/Text/List.hs
View file @
f03449b1
...
...
@@ -57,11 +57,12 @@ buildNgramsLists :: ( RepoCmdM env err m
->
m
(
Map
NgramsType
[
NgramsElement
])
buildNgramsLists
user
gp
uCid
mCid
=
do
ngTerms
<-
buildNgramsTermsList
user
uCid
mCid
gp
othersTerms
<-
mapM
(
buildNgramsOthersList
user
uCid
(
ngramsGroup
GroupIdentity
))
[(
Authors
,
5
),
(
Sources
,
7
),
(
Institutes
,
9
)]
pure
$
Map
.
unions
$
othersTerms
<>
[
ngTerms
]
{- othersTerms <- mapM (buildNgramsOthersList user uCid (ngramsGroup GroupIdentity))
[(Authors, MapListSize 5), (Sources, MapListSize 7), (Institutes, MapListSize 9)]
-}
pure
$
Map
.
unions
$
{-othersTerms <>-}
[
ngTerms
]
type
MapListSize
=
Int
data
MapListSize
=
MapListSize
Int
buildNgramsOthersList
::
(
HasNodeError
err
,
CmdM
env
err
m
...
...
@@ -73,15 +74,16 @@ buildNgramsOthersList ::( HasNodeError err
->
(
Text
->
Text
)
->
(
NgramsType
,
MapListSize
)
->
m
(
Map
NgramsType
[
NgramsElement
])
buildNgramsOthersList
user
uCid
groupIt
(
nt
,
mapListSize
)
=
do
buildNgramsOthersList
user
uCid
groupIt
(
nt
,
MapListSize
mapListSize
)
=
do
ngs
<-
groupNodesByNgramsWith
groupIt
<$>
getNodesByNgramsUser
uCid
nt
let
grouped
=
toGroupedText
groupIt
(
Set
.
size
.
snd
)
fst
snd
(
Map
.
toList
ngs
)
socialLists
<-
flowSocialList
user
NgramsTerms
(
Set
.
fromList
$
Map
.
keys
ngs
)
socialLists
<-
flowSocialList
user
nt
(
Set
.
fromList
$
Map
.
keys
ngs
)
let
let
groupedWithList
=
map
(
addListType
(
invertForw
socialLists
))
grouped
(
stopTerms
,
tailTerms
)
=
Map
.
partition
(
\
t
->
t
^.
gt_listType
==
Just
StopTerm
)
groupedWithList
(
graphTerms
,
tailTerms'
)
=
Map
.
partition
(
\
t
->
t
^.
gt_listType
==
Just
MapTerm
)
tailTerms
...
...
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