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
1690d344
Commit
1690d344
authored
Oct 09, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Social list over before integration to flow list
parent
05a7f4cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
Social.hs
src/Gargantext/Core/Text/List/Social.hs
+28
-7
No files found.
src/Gargantext/Core/Text/List/Social.hs
View file @
1690d344
...
...
@@ -24,6 +24,7 @@ import Gargantext.Database.Query.Tree.Root (getRootId)
import
Gargantext.Prelude
-- filterList imports
import
Data.Maybe
(
fromMaybe
)
import
Data.Map
(
Map
)
import
Data.Set
(
Set
)
import
Data.Text
(
Text
)
...
...
@@ -37,19 +38,39 @@ import qualified Data.Map as Map
import
qualified
Data.Set
as
Set
{-
flowSocialList
::
(
RepoCmdM
env
err
m
,
CmdM
env
err
m
,
HasNodeError
err
,
HasTreeError
err
)
=>
NodeMode ->
User -> NgramsType -> Set Text
-> m (Map
(Maybe ListType)
(Set Text))
flowSocialList
mode
user nt ngrams' = do
=>
User
->
NgramsType
->
Set
Text
->
m
(
Map
ListType
(
Set
Text
))
flowSocialList
user
nt
ngrams'
=
do
privateMapList
<-
flowSocialListByMode
Private
user
nt
ngrams'
sharedMapList <- flowSocialListByMode Shared user nt (fromMaybe Set.empty $
-- TODO publicMapList
-}
sharedMapList
<-
flowSocialListByMode
Shared
user
nt
(
termsByList
CandidateTerm
privateMapList
)
-- TODO publicMapList
pure
$
Map
.
fromList
[
(
MapTerm
,
termsByList
MapTerm
privateMapList
<>
termsByList
MapTerm
sharedMapList
)
,
(
StopTerm
,
termsByList
StopTerm
privateMapList
<>
termsByList
StopTerm
sharedMapList
)
,
(
CandidateTerm
,
termsByList
CandidateTerm
sharedMapList
)
]
termsByList
::
ListType
->
(
Map
(
Maybe
ListType
)
(
Set
Text
))
->
Set
Text
termsByList
CandidateTerm
m
=
fromMaybe
Set
.
empty
$
(
<>
)
<$>
Map
.
lookup
Nothing
m
<*>
Map
.
lookup
(
Just
CandidateTerm
)
m
termsByList
l
m
=
fromMaybe
Set
.
empty
$
Map
.
lookup
(
Just
l
)
m
flowSocialListByMode
::
(
RepoCmdM
env
err
m
,
CmdM
env
err
m
...
...
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