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
a7057221
Commit
a7057221
authored
Jun 16, 2020
by
qlobbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
e5935d9c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
PhyloExport.hs
src/Gargantext/Viz/Phylo/PhyloExport.hs
+1
-1
PhyloMaker.hs
src/Gargantext/Viz/Phylo/PhyloMaker.hs
+1
-1
TemporalMatching.hs
src/Gargantext/Viz/Phylo/TemporalMatching.hs
+9
-1
Tools.hs
src/Gargantext/Viz/Phylo/Tools.hs
+0
-1
No files found.
src/Gargantext/Viz/Phylo/PhyloExport.hs
View file @
a7057221
...
...
@@ -160,7 +160,7 @@ toDotEdge source target lbl edgeType = edge source target
mergePointers
::
[
PhyloGroup
]
->
Map
(
PhyloGroupId
,
PhyloGroupId
)
Double
mergePointers
groups
=
let
toChilds
=
fromList
$
concat
$
map
(
\
g
->
map
(
\
(
target
,
w
)
->
((
getGroupId
g
,
target
),
w
))
$
g
^.
phylo_groupPeriodChilds
)
groups
toParents
=
fromList
$
concat
$
map
(
\
g
->
map
(
\
(
target
,
w
)
->
((
target
,
getGroupId
g
),
w
))
$
g
^.
phylo_groupPeriodParents
)
groups
toParents
=
fromList
$
concat
$
map
(
\
g
->
map
(
\
(
target
,
w
)
->
((
getGroupId
g
,
target
),
w
))
$
g
^.
phylo_groupPeriodParents
)
groups
in
unionWith
(
\
w
w'
->
max
w
w'
)
toChilds
toParents
...
...
src/Gargantext/Viz/Phylo/PhyloMaker.hs
View file @
a7057221
...
...
@@ -206,7 +206,7 @@ toPhyloClique phylo phyloDocs = case (clique $ getConfig phylo) of
$
foldl
sumCooc
empty
$
map
listToMatrix
$
map
(
\
d
->
ngramsToIdx
(
text
d
)
(
getRoots
phylo
))
docs
in
(
prd
,
map
(
\
cl
->
PhyloClique
cl
0
prd
)
$
getMaxCliques
0
cooc
))
in
(
prd
,
map
(
\
cl
->
PhyloClique
cl
0
prd
)
$
getMaxCliques
0
.1
cooc
))
$
toList
phyloDocs
mcl'
=
mcl
`
using
`
parList
rdeepseq
in
fromList
mcl'
...
...
src/Gargantext/Viz/Phylo/TemporalMatching.hs
View file @
a7057221
...
...
@@ -144,6 +144,13 @@ reduceDiagos :: Map Date Cooc -> Map Int Double
reduceDiagos
diagos
=
mapKeys
(
\
(
k
,
_
)
->
k
)
$
foldl
(
\
acc
diago
->
unionWith
(
+
)
acc
diago
)
empty
(
elems
diagos
)
filterPointersByPeriod
::
[
Pointer
]
->
[
Pointer
]
filterPointersByPeriod
pts
=
let
pts'
=
sortOn
(
fst
.
fst
.
fst
)
pts
inf
=
(
fst
.
fst
.
fst
)
$
head'
"filterPointersByPeriod"
pts'
sup
=
(
fst
.
fst
.
fst
)
$
last'
"filterPointersByPeriod"
pts'
in
nub
$
filter
(
\
pt
->
((
fst
.
fst
.
fst
)
pt
==
inf
)
||
((
fst
.
fst
.
fst
)
pt
==
sup
))
pts'
phyloGroupMatching
::
[[(
PhyloGroupId
,[
Int
])]]
->
Filiation
->
Proximity
->
Map
Date
Double
->
Map
Date
Cooc
->
Double
->
[
Pointer
]
->
(
PhyloGroupId
,[
Int
])
->
[
Pointer
]
...
...
@@ -152,7 +159,8 @@ phyloGroupMatching candidates fil proxi docs diagos thr oldPointers (id,ngrams)
-- | let's find new pointers
then
if
null
nextPointers
then
[]
else
head'
"phyloGroupMatching"
else
filterPointersByPeriod
$
head'
"phyloGroupMatching"
-- | Keep only the best set of pointers grouped by proximity
$
groupBy
(
\
pt
pt'
->
snd
pt
==
snd
pt'
)
$
reverse
$
sortOn
snd
$
head'
"pointers"
nextPointers
...
...
src/Gargantext/Viz/Phylo/Tools.hs
View file @
a7057221
...
...
@@ -116,7 +116,6 @@ listToEqualCombi l = [(x,y) | x <- l, y <- l, x == y]
listToPairs
::
Eq
a
=>
[
a
]
->
[(
a
,
a
)]
listToPairs
l
=
(
listToEqualCombi
l
)
++
(
listToUnDirectedCombi
l
)
-- | To get all combinations of a list and apply a function to the resulting list of pairs
listToDirectedCombiWith
::
Eq
a
=>
forall
b
.
(
a
->
b
)
->
[
a
]
->
[(
b
,
b
)]
listToDirectedCombiWith
f
l
=
[(
f
x
,
f
y
)
|
x
<-
l
,
y
<-
l
,
x
/=
y
]
...
...
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