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
6160cc34
Commit
6160cc34
authored
Oct 29, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] SocialList clean again
parent
7fef5813
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
38 deletions
+0
-38
Group.hs
src/Gargantext/Core/Text/List/Social/Group.hs
+0
-38
No files found.
src/Gargantext/Core/Text/List/Social/Group.hs
View file @
6160cc34
...
...
@@ -104,41 +104,3 @@ toMapTextParent ts = foldl' (toMapTextParent' ts)
------------------------------------------------------------------------
toList
::
Map
Text
NgramsRepoElement
->
(
Text
,
NgramsRepoElement
)
->
[(
Text
,
ListType
)]
toList
m
(
t
,
nre
@
(
NgramsRepoElement
_
_
_
_
(
MSet
children
)))
=
List
.
zip
terms
(
List
.
cycle
[
lt'
])
where
terms
=
[
t
]
-- <> maybe [] (\n -> [unNgramsTerm n]) root
-- <> maybe [] (\n -> [unNgramsTerm n]) parent
<>
(
map
unNgramsTerm
$
Map
.
keys
children
)
lt'
=
listOf
m
nre
listOf
::
Map
Text
NgramsRepoElement
->
NgramsRepoElement
->
ListType
listOf
m
ng
=
case
_nre_parent
ng
of
Nothing
->
_nre_list
ng
Just
p
->
case
Map
.
lookup
(
unNgramsTerm
p
)
m
of
Just
ng'
->
listOf
m
ng'
Nothing
->
CandidateTerm
-- panic "[G.C.T.L.Social.listOf] Nothing: Should Not happen"
------------------------------------------------------------------------
countList
::
Text
->
Map
Text
ListType
->
Map
Text
(
Map
ListType
Int
)
->
Map
Text
(
Map
ListType
Int
)
countList
t
m
input
=
case
Map
.
lookup
t
m
of
Nothing
->
input
Just
l
->
Map
.
alter
addList
t
input
where
addList
Nothing
=
Just
$
addCountList
l
Map
.
empty
addList
(
Just
lm
)
=
Just
$
addCountList
l
lm
addCountList
::
ListType
->
Map
ListType
Int
->
Map
ListType
Int
addCountList
l
m
=
Map
.
alter
(
plus
l
)
l
m
where
plus
CandidateTerm
Nothing
=
Just
1
plus
CandidateTerm
(
Just
x
)
=
Just
$
x
+
1
plus
_
Nothing
=
Just
3
plus
_
(
Just
x
)
=
Just
$
x
+
3
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