Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
21ff436a
Commit
21ff436a
authored
Nov 30, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Social List with new created ngrams (or category) that do not exist in the corpus
parent
f3f8a296
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
11 deletions
+29
-11
Scores.hs
src/Gargantext/Core/Text/List/Social/Scores.hs
+29
-11
No files found.
src/Gargantext/Core/Text/List/Social/Scores.hs
View file @
21ff436a
...
...
@@ -57,17 +57,35 @@ toFlowListScores k flc_origin = foldl' (toFlowListScores_Level1 k flc_origin) me
toFlowListScores_Level2
k''
ngramsRepo
flc_origin''
flc_dest'
t
=
case
Map
.
lookup
t
ngramsRepo
of
Nothing
->
over
flc_cont
(
Map
.
union
$
Map
.
singleton
t
mempty
)
flc_dest'
Just
nre
->
over
flc_cont
(
Map
.
delete
t
)
$
over
flc_scores
(
(
Map
.
alter
(
addParent
k''
nre
(
Set
.
fromList
Just
nre
->
updateScoresParent
k''
ngramsRepo
nre
flc_origin''
$
updateScores
k''
t
nre
setText
flc_dest'
where
setText
=
Set
.
fromList
$
Map
.
keys
$
view
flc_cont
flc_origin''
)
)
t
)
.
(
Map
.
alter
(
addList
$
_nre_list
nre
)
t
)
)
flc_dest'
updateScoresParent
::
KeepAllParents
->
Map
Text
NgramsRepoElement
->
NgramsRepoElement
->
FlowCont
Text
FlowListScores
->
FlowCont
Text
FlowListScores
->
FlowCont
Text
FlowListScores
updateScoresParent
keep
@
(
KeepAllParents
k'''
)
ngramsRepo
nre
flc_origin''
flc_dest''
=
case
k'''
of
False
->
flc_dest''
True
->
case
view
nre_parent
nre
of
Nothing
->
flc_dest''
Just
(
NgramsTerm
parent
)
->
toFlowListScores_Level2
keep
ngramsRepo
flc_origin''
flc_dest''
parent
------------------------------------------------------------------------
updateScores
::
KeepAllParents
->
Text
->
NgramsRepoElement
->
Set
Text
->
FlowCont
Text
FlowListScores
->
FlowCont
Text
FlowListScores
updateScores
k
t
nre
setText
mtf
=
over
flc_cont
(
Map
.
delete
t
)
$
over
flc_scores
((
Map
.
alter
(
addParent
k
nre
setText
)
t
)
.
(
Map
.
alter
(
addList
$
view
nre_list
nre
)
t
)
)
mtf
------------------------------------------------------------------------
-- | Main addFunctions to groupResolution the FlowListScores
...
...
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