Commit 07424229 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[PHYLO] step -> period.

parent 25bc7c97
...@@ -35,12 +35,12 @@ import Gargantext.Utils.Prefix (unPrefix) ...@@ -35,12 +35,12 @@ import Gargantext.Utils.Prefix (unPrefix)
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- | Phylo datatype descriptor of a phylomemy -- | Phylo datatype descriptor of a phylomemy
-- Period : time Segment of the whole phylomemy in UTCTime format (start,end) -- Duration : time Segment of the whole phylomemy in UTCTime format (start,end)
-- Ngrams : list of all (possible) terms contained in the phylomemy (with their id) -- Ngrams : list of all (possible) terms contained in the phylomemy (with their id)
-- Steps : list of all steps to build the phylomemy -- Steps : list of all steps to build the phylomemy
data Phylo = Phylo { _phyloPeriod :: (Start, End) data Phylo = Phylo { _phyloDuration :: (Start, End)
, _phyloNgrams :: [Ngram] , _phyloNgrams :: [Ngram]
, _phyloSteps :: [PhyloStep] , _phyloPeriods :: [PhyloPeriod]
} deriving (Generic) } deriving (Generic)
type Start = UTCTime type Start = UTCTime
...@@ -52,38 +52,37 @@ type NgramId = Int ...@@ -52,38 +52,37 @@ type NgramId = Int
-- | PhyloStep : steps of phylomemy on temporal axis -- | PhyloStep : steps of phylomemy on temporal axis
-- Period: tuple (start date, end date) of the step of the phylomemy -- Period: tuple (start date, end date) of the step of the phylomemy
-- Levels: levels of granularity -- Levels: levels of granularity
data PhyloStep = PhyloStep { _phyloStepPeriod :: (Start, End) data PhyloPeriod = PhyloPeriod { _phyloPeriodDuration :: (Start, End)
, _phyloStepLevels :: [PhyloLevel] , _phyloPeriodLevels :: [PhyloLevel]
} deriving (Generic) } deriving (Generic)
-- | PhyloLevel : levels of phylomemy on level axis -- | PhyloLevel : levels of phylomemy on level axis
-- Levels description: -- Levels description:
-- Level 0: Ngram equals itself (by identity) == _phyloNgrams -- Level -1: Ngram equals itself (by identity) == _phyloNgrams
-- Level 1: Group gathers synonyms (by stems + by qualitative expert meaning) -- Level 0: Group of synonyms (by stems + by qualitative expert meaning)
-- Level 2: Group is Frequent Item Set (by statistics) -- Level 1: First level of clustering
-- Level 3: Group is a cluster or community (by statistics) -- Level N: Nth level of clustering
type PhyloLevel = [PhyloGroup] type PhyloLevel = [PhyloGroup]
-- | PhyloGroup : group of ngrams at each level and step -- | PhyloGroup : group of ngrams at each level and step
-- Label: maybe has a label as text -- Label : maybe has a label as text
-- Ngrams: set of terms that build the group -- Ngrams: set of terms that build the group
-- Temporal Parents|Childs: directed and weighted link to Parents|Childs (Temporal axis) -- Temporal Parents|Childs: directed and weighted link to Parents|Childs (Temporal axis)
-- Granularity Parents|Childs: directed and weighted link to Parents|Childs (Granularity axis) -- Granularity Parents|Childs: directed and weighted link to Parents|Childs (Granularity axis)
data PhyloGroup = PhyloGroup { _phyloGroupLabel :: Maybe Text data PhyloGroup = PhyloGroup { _phyloGroupLabel :: Maybe Text
, _phyloGroupNgrams :: [NgramId] , _phyloGroupNgrams :: [NgramId]
, _phyloGroupTemporalParents :: [Edge] , _phyloGroupPeriodParents :: [Edge]
, _phyloGroupTemporalChilds :: [Edge] , _phyloGroupPeriodChilds :: [Edge]
, _phyloGroupGranularityParents :: [Edge] , _phyloGroupLevelParents :: [Edge]
, _phyloGroupGranularityChilds :: [Edge] , _phyloGroupLevelChilds :: [Edge]
} deriving (Generic) } deriving (Generic)
type Edge = (NgramId, Weight) type Edge = (NgramId, Weight)
type Weight = Double type Weight = Double
-- | JSON instances -- | JSON instances
$(deriveJSON (unPrefix "_phylo") ''Phylo) $(deriveJSON (unPrefix "_phylo" ) ''Phylo )
$(deriveJSON (unPrefix "_phyloStep") ''PhyloStep) $(deriveJSON (unPrefix "_phyloPeriod" ) ''PhyloPeriod )
$(deriveJSON (unPrefix "_phyloGroup") ''PhyloGroup) $(deriveJSON (unPrefix "_phyloGroup" ) ''PhyloGroup )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment