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
145
Issues
145
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
b9b19dee
Commit
b9b19dee
authored
Nov 10, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] SocialLists clean
parent
e10c2ed4
Pipeline
#1205
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
Group.hs
src/Gargantext/Core/Text/Group.hs
+8
-13
Group.hs
src/Gargantext/Core/Text/List/Social/Group.hs
+4
-2
No files found.
src/Gargantext/Core/Text/Group.hs
View file @
b9b19dee
...
...
@@ -27,7 +27,7 @@ import Gargantext.Core.Text (size)
import
Gargantext.Core.Types
(
ListType
(
..
))
-- (MasterCorpusId, UserCorpusId)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
-- import Gargantext.Core.Text.List.Learn (Model(..))
import
Gargantext.Core.Text.List.Social.Group
(
FlowListScores
(
..
),
flc_lists
)
import
Gargantext.Core.Text.List.Social.Group
(
FlowListScores
(
..
),
flc_lists
,
mapMax
)
import
Gargantext.Core.Text.Terms.Mono.Stem
(
stem
)
import
Gargantext.Prelude
import
qualified
Data.Set
as
Set
...
...
@@ -86,11 +86,10 @@ mergeMapParent = undefined
-}
------------------------------------------------------------------------
data
GroupedTextParams
a
b
=
GroupedTextParams
{
_gt_fun_stem
::
Text
->
Text
,
_gt_fun_score
::
a
->
b
,
_gt_fun_texts
::
a
->
Set
Text
GroupedTextParams
{
_gt_fun_stem
::
Text
->
Text
,
_gt_fun_score
::
a
->
b
,
_gt_fun_texts
::
a
->
Set
Text
,
_gt_fun_nodeIds
::
a
->
Set
NodeId
}
...
...
@@ -136,7 +135,7 @@ toGroupedText_FlowListScores :: ( FlowList a b
->
Map
Text
(
GroupedText
b
)
toGroupedText_FlowListScores
=
undefined
toGroupedText_FlowListScores'
::
(
FlowList
a
b
)
toGroupedText_FlowListScores'
::
(
FlowList
a
b
,
Ord
b
)
=>
[
a
]
->
Map
Text
FlowListScores
->
(
[
a
]
...
...
@@ -159,13 +158,8 @@ class HasNgrams a where
class
HasGroup
a
b
|
a
->
b
where
createGroupWith
::
FlowListScores
->
a
->
GroupedText
b
updateGroupWith
::
FlowListScores
->
a
->
GroupedText
b
->
GroupedText
b
updateGroupWith
::
FlowListScores
->
a
->
GroupedText
b
->
GroupedText
b
------------------------------------------
mapMax
::
Map
a
b
->
Maybe
a
mapMax
m
=
(
fst
.
fst
)
<$>
Map
.
maxViewWithKey
m
------------------------------------------------------------------------
type
Stem
=
Text
type
Label
=
Text
...
...
@@ -206,8 +200,9 @@ instance HasGroup (Text, Set NodeId) Int where
updateGroupWith
fs
(
t
,
ns
)
g
=
set
gt_listType
(
mapMax
$
fs
^.
flc_lists
)
$
set
gt_nodes
(
Set
.
union
ns
$
g
^.
gt_nodes
)
g
------------------------------------------------------------------------
------------------------------------------------------------------------
-- | To be removed
addListType
::
Map
Text
ListType
->
GroupedText
a
->
GroupedText
a
addListType
m
g
=
set
gt_listType
(
hasListType
m
g
)
g
where
...
...
src/Gargantext/Core/Text/List/Social/Group.hs
View file @
b9b19dee
...
...
@@ -59,9 +59,11 @@ hasParent :: Text
->
Maybe
Parent
hasParent
t
m
=
case
Map
.
lookup
t
m
of
Nothing
->
Nothing
Just
m'
->
(
fst
.
fst
)
<$>
Map
.
maxViewWithKey
m'
Just
m'
->
mapMax
m'
------------------------------------------------------------------------
mapMax
::
Map
a
b
->
Maybe
a
mapMax
m
=
(
fst
.
fst
)
<$>
Map
.
maxViewWithKey
m
------------------------------------------------------------------------
data
FlowListScores
=
FlowListScores
{
_flc_parents
::
Map
Parent
Int
...
...
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