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
1bfd14e8
Commit
1bfd14e8
authored
Nov 25, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Cont can be empty now.
parent
ccda3cd4
Pipeline
#1243
failed with stage
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
List.hs
src/Gargantext/Core/Text/List.hs
+3
-4
Prelude.hs
src/Gargantext/Core/Text/List/Social/Prelude.hs
+4
-8
Scores.hs
src/Gargantext/Core/Text/List/Social/Scores.hs
+10
-4
No files found.
src/Gargantext/Core/Text/List.hs
View file @
1bfd14e8
...
@@ -15,7 +15,6 @@ Portability : POSIX
...
@@ -15,7 +15,6 @@ Portability : POSIX
module
Gargantext.Core.Text.List
module
Gargantext.Core.Text.List
where
where
import
Control.Lens
((
^.
),
view
,
over
)
import
Control.Lens
((
^.
),
view
,
over
)
import
Data.Map
(
Map
)
import
Data.Map
(
Map
)
import
Data.Maybe
(
catMaybes
)
import
Data.Maybe
(
catMaybes
)
...
@@ -94,12 +93,12 @@ buildNgramsOthersList user uCid groupIt (nt, MapListSize mapListSize) = do
...
@@ -94,12 +93,12 @@ buildNgramsOthersList user uCid groupIt (nt, MapListSize mapListSize) = do
$
List
.
zip
(
Map
.
keys
ngs'
)
$
List
.
zip
(
Map
.
keys
ngs'
)
(
List
.
cycle
[
mempty
])
(
List
.
cycle
[
mempty
])
)
)
{-
{-
printDebug "flowSocialList'"
printDebug "flowSocialList'"
$ Map.filter (not . ((==) Map.empty) . (view fls_parents))
$ Map.filter (not . ((==) Map.empty) . (view fls_parents))
$ view flc_scores socialLists'
$ view flc_scores socialLists'
-}
-}
let
let
groupedWithList
=
toGroupedTreeText
groupIt
socialLists'
ngs'
groupedWithList
=
toGroupedTreeText
groupIt
socialLists'
ngs'
...
@@ -153,7 +152,7 @@ buildNgramsTermsList user uCid mCid groupParams = do
...
@@ -153,7 +152,7 @@ buildNgramsTermsList user uCid mCid groupParams = do
(
stopTerms
,
candidateTerms
)
=
Map
.
partition
((
==
Just
StopTerm
)
.
viewListType
)
groupedWithList
(
stopTerms
,
candidateTerms
)
=
Map
.
partition
((
==
Just
StopTerm
)
.
viewListType
)
groupedWithList
(
groupedMono
,
groupedMult
)
=
Map
.
partition
(
\
t
->
t
^.
gt_size
<
2
)
candidateTerms
(
groupedMono
,
groupedMult
)
=
Map
.
partition
(
\
t
->
t
^.
gt_size
<
2
)
candidateTerms
-- (groupedMono, groupedMult) = Map.partitionWithKey (\t
-> t ^. gt_size
< 2) candidateTerms
-- (groupedMono, groupedMult) = Map.partitionWithKey (\t
_v -> size t
< 2) candidateTerms
-- printDebug "\n * stopTerms * \n" stopTerms
-- printDebug "\n * stopTerms * \n" stopTerms
-- splitting monterms and multiterms to take proportional candidates
-- splitting monterms and multiterms to take proportional candidates
...
...
src/Gargantext/Core/Text/List/Social/Prelude.hs
View file @
1bfd14e8
...
@@ -46,12 +46,8 @@ instance (Ord a, Eq b) => Monoid (FlowCont a b) where
...
@@ -46,12 +46,8 @@ instance (Ord a, Eq b) => Monoid (FlowCont a b) where
instance
(
Eq
a
,
Ord
a
,
Eq
b
)
=>
Semigroup
(
FlowCont
a
b
)
where
instance
(
Eq
a
,
Ord
a
,
Eq
b
)
=>
Semigroup
(
FlowCont
a
b
)
where
(
<>
)
(
FlowCont
m1
s1
)
(
<>
)
(
FlowCont
m1
s1
)
(
FlowCont
m2
s2
)
(
FlowCont
m2
s2
)
=
FlowCont
m
s
=
FlowCont
(
m1
<>
m2
)
where
(
s1
<>
s2
)
m
=
Map
.
union
m1
m2
s
|
s1
==
mempty
=
s2
|
s2
==
mempty
=
s1
|
otherwise
=
Map
.
intersection
s1
s2
makeLenses
''
F
lowCont
makeLenses
''
F
lowCont
...
...
src/Gargantext/Core/Text/List/Social/Scores.hs
View file @
1bfd14e8
...
@@ -56,9 +56,15 @@ toFlowListScores k flc_origin = foldl' (toFlowListScores_Level1 k flc_origin) me
...
@@ -56,9 +56,15 @@ toFlowListScores k flc_origin = foldl' (toFlowListScores_Level1 k flc_origin) me
->
FlowCont
Text
FlowListScores
->
FlowCont
Text
FlowListScores
toFlowListScores_Level2
k''
ngramsRepo
flc_origin''
flc_dest'
t
=
toFlowListScores_Level2
k''
ngramsRepo
flc_origin''
flc_dest'
t
=
case
Map
.
lookup
t
ngramsRepo
of
case
Map
.
lookup
t
ngramsRepo
of
Nothing
->
over
flc_cont
(
Map
.
union
(
Map
.
singleton
t
mempty
))
flc_dest'
Nothing
->
over
flc_cont
(
Map
.
union
$
Map
.
singleton
t
mempty
)
flc_dest'
Just
nre
->
over
flc_scores
Just
nre
->
over
flc_cont
(
Map
.
delete
t
)
(
(
Map
.
alter
(
addParent
k''
nre
(
Set
.
fromList
$
Map
.
keys
$
view
flc_cont
flc_origin''
))
t
)
$
over
flc_scores
(
(
Map
.
alter
(
addParent
k''
nre
(
Set
.
fromList
$
Map
.
keys
$
view
flc_cont
flc_origin''
)
)
t
)
.
(
Map
.
alter
(
addList
$
_nre_list
nre
)
t
)
.
(
Map
.
alter
(
addList
$
_nre_list
nre
)
t
)
)
flc_dest'
)
flc_dest'
...
...
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