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
141
Issues
141
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
137eca93
Commit
137eca93
authored
Nov 10, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] SocialList with Functional Dependency
parent
701ef9ac
Pipeline
#1203
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
Group.hs
src/Gargantext/Core/Text/Group.hs
+12
-16
No files found.
src/Gargantext/Core/Text/Group.hs
View file @
137eca93
...
...
@@ -9,9 +9,11 @@ Portability : POSIX
-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FunctionalDependencies #-}
module
Gargantext.Core.Text.Group
where
...
...
@@ -117,7 +119,7 @@ grouping (GroupedText lt1 label1 score1 group1 s1 stem1 nodes1)
nodes
=
Set
.
union
nodes1
nodes2
------------------------------------------------------------------------
toGroupedText_FlowListScores
::
(
FlowList
a
toGroupedText_FlowListScores
::
(
FlowList
a
b
,
Ord
a
)
=>
[
a
]
...
...
@@ -126,8 +128,7 @@ toGroupedText_FlowListScores :: ( FlowList a
toGroupedText_FlowListScores
=
undefined
toGroupedText_FlowListScores'
::
(
FlowList
a
,
b
~
GroupFamily
a
toGroupedText_FlowListScores'
::
(
FlowList
a
b
)
=>
[
a
]
->
Map
Text
FlowListScores
...
...
@@ -144,24 +145,19 @@ toGroupedText_FlowListScores' ms mf = foldl' fun_group start ms
updateWith
scores
current
Nothing
=
Just
$
createGroupWith
scores
current
updateWith
scores
current
(
Just
x
)
=
Just
$
updateGroupWith
scores
current
x
type
FlowList
a
=
(
HasNgrams
a
,
HasGroup
a
)
type
FlowList
a
b
=
(
HasNgrams
a
,
HasGroup
a
b
)
class
HasNgrams
a
where
hasNgrams
::
a
->
Text
class
HasGroup
a
where
createGroupWith
::
(
b
~
GroupFamily
a
)
=>
FlowListScores
->
a
->
GroupedText
b
updateGroupWith
::
(
b
~
GroupFamily
a
)
=>
FlowListScores
->
a
class
HasGroup
a
b
|
a
->
b
where
createGroupWith
::
FlowListScores
->
a
->
GroupedText
b
updateGroupWith
::
FlowListScores
->
a
->
GroupedText
b
->
GroupedText
b
-- | Check if functional dependency is better
type
family
GroupFamily
a
type
instance
GroupFamily
(
Text
,
Set
NodeId
)
=
Int
------------------------------------------
instance
HasGroup
(
Text
,
Set
NodeId
)
where
instance
HasGroup
(
Text
,
Set
NodeId
)
Int
where
createGroupWith
fs
(
t
,
ns
)
=
GroupedText
(
mapMax
$
fs
^.
flc_lists
)
t
(
Set
.
size
ns
)
...
...
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