2 Module : Gargantext.Viz.Phylo.Tools
3 Description : Phylomemy tools
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
11 - functions to build a Phylo
12 - functions to filter the cliques
13 - functions to manage a Phylo
15 Group Functions (TODO list)
16 - cohesion sur un groupe
17 - distance au dernier branchement
20 Futre Idea: temporal zoom on Phylo
21 phyloZoomOut :: (PeriodGrain, Phylo) -> [(PeriodGrain, Phylo)]
22 (from smallest granularity, it increases (zoom out) the periods of the Phylo)
23 Moral idea: viz from out to in
27 {-# LANGUAGE NoImplicitPrelude #-}
28 {-# LANGUAGE FlexibleContexts #-}
29 {-# LANGUAGE OverloadedStrings #-}
31 module Gargantext.Viz.Phylo.Tools where
35 import qualified Data.Map as Map
36 import Gargantext.Prelude
37 import Gargantext.Viz.Phylo
38 import Gargantext.Viz.Phylo.Example
43 -- (Indicative and schematic function)
44 -- buildPhylo :: Support -> MinSize
45 -- -> Map Clique Support -> Phylo
46 -- buildPhylo s m mcs = level2Phylo
49 -- . Map.map clique2cluster
50 -- . filterCliques s m
52 level2Phylo :: PhyloLevel -> Phylo -> Phylo
53 level2Phylo = undefined
55 groups2level :: [PhyloGroup] -> PhyloLevel
56 groups2level = undefined
58 -- clusters2group :: [Cluster Ngrams] -> PhyloGroup
59 -- clusters2group = undefined
61 -- clique2cluster :: Clique -> Cluster Ngrams
62 -- clique2cluster = undefined
64 -- | Filtering the cliques before bulding the Phylo
65 -- (Support and MinSize as parameter of the finale function to build a phylo)
66 -- idea: log of Corpus size (of docs)
67 filterCliques :: Support -> MinSize
68 -> Map Clique Support -> [Clique]
69 filterCliques s ms = maximalCliques
70 . filterWithSizeSet ms
74 -- | Hapaxify / Threshold
77 filterWithSupport :: Support -> Map Clique Support -> Map Clique Support
78 filterWithSupport s = Map.filter (>s)
80 filterWithSizeSet :: MinSize -> [Clique] -> [Clique]
81 filterWithSizeSet = undefined
83 -- | filtre les cliques de ngrams compris dans une clique plus grande
85 maximalCliques :: [Clique] -> [Clique]
86 maximalCliques = undefined
93 -- | PhyloLevel Management
94 viewGroups :: (Start,End) -> PhyloLevel -> Phylo -> [PhyloGroup]
95 viewGroups = undefined
97 viewLevels :: (Start,End) -> Phylo -> [PhyloLevel]
98 viewLevels = undefined
100 -- | tous les terme des champs, tous les parents et les enfants
101 setGroup :: PhyloGroup -> PhyloGroup -> PhyloGroup
103 --removeTerms :: recalculer les cliques pour ces termes