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
cfa1a656
Commit
cfa1a656
authored
Oct 22, 2020
by
qlobbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the ancestors
parent
7d722d28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
PhyloExport.hs
src/Gargantext/Core/Viz/Phylo/PhyloExport.hs
+4
-2
PhyloMaker.hs
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
+1
-2
No files found.
src/Gargantext/Core/Viz/Phylo/PhyloExport.hs
View file @
cfa1a656
...
...
@@ -601,8 +601,10 @@ toHorizon phylo =
mapGroups
::
[[
PhyloGroup
]]
mapGroups
=
map
(
\
prd
->
let
groups
=
getGroupsFromLevelPeriods
level
[
prd
]
phylo
childs
=
getPreviousChildIds
level
frame
prd
periods
phylo
heads
=
filter
(
\
g
->
null
(
g
^.
phylo_groupPeriodParents
)
&&
(
notElem
(
getGroupId
g
)
childs
))
groups
childs
=
getPreviousChildIds
level
frame
prd
periods
phylo
-- maybe add a better filter for non isolated ancestors
heads
=
filter
(
\
g
->
(
not
.
null
)
$
(
g
^.
phylo_groupPeriodChilds
))
$
filter
(
\
g
->
null
(
g
^.
phylo_groupPeriodParents
)
&&
(
notElem
(
getGroupId
g
)
childs
))
groups
noHeads
=
groups
\\
heads
nbDocs
=
sum
$
elems
$
filterDocs
(
phylo
^.
phylo_timeDocs
)
[
prd
]
diago
=
reduceDiagos
$
filterDiago
(
phylo
^.
phylo_timeCooc
)
[
prd
]
...
...
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
View file @
cfa1a656
...
...
@@ -290,8 +290,7 @@ docsToLastTermFreq :: Int -> [Document] -> Vector Ngrams -> Map Int Double
docsToLastTermFreq
n
docs
fdt
=
let
last
=
take
n
$
reverse
$
sort
$
map
date
docs
nbDocs
=
fromIntegral
$
length
$
filter
(
\
d
->
elem
(
date
d
)
last
)
docs
freqs
=
map
(
\
x
->
truncate'
(
x
/
nbDocs
)
4
)
-- $ map (/(nbDocs))
freqs
=
map
(
/
(
nbDocs
))
$
fromList
$
map
(
\
lst
->
(
head'
"docsToLastTermFreq"
lst
,
fromIntegral
$
length
lst
))
$
group
$
sort
$
concat
$
map
(
\
d
->
nub
$
ngramsToIdx
(
text
d
)
fdt
)
$
filter
(
\
d
->
elem
(
date
d
)
last
)
docs
...
...
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