Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
gargantext
haskell-gargantext
Commits
d593b35f
Commit
d593b35f
authored
May 28, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Types] Phylo
parent
f31e0a3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
Phylo.hs
src/Gargantext/Core/Types/Phylo.hs
+19
-19
No files found.
src/Gargantext/Core/Types/Phylo.hs
View file @
d593b35f
...
...
@@ -39,9 +39,9 @@ import Gargantext.Core.Utils.Prefix (unPrefix)
-- 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)
-- Steps : list of all steps to build the phylomemy
data
Phylo
=
Phylo
{
_phyloDuration
::
(
Start
,
End
)
,
_phyloNgrams
::
[
Ngram
]
,
_phyloPeriods
::
[
PhyloPeriod
]
data
Phylo
=
Phylo
{
_phylo
_
Duration
::
(
Start
,
End
)
,
_phylo
_
Ngrams
::
[
Ngram
]
,
_phylo
_
Periods
::
[
PhyloPeriod
]
}
deriving
(
Generic
)
-- | UTCTime in seconds since UNIX epoch
...
...
@@ -54,20 +54,20 @@ type NgramId = Int
-- | PhyloStep : steps of phylomemy on temporal axis
-- Period: tuple (start date, end date) of the step of the phylomemy
-- Levels: levels of granularity
data
PhyloPeriod
=
PhyloPeriod
{
_phyloPeriodId
::
PhyloPeriodId
,
_phyloPeriodLevels
::
[
PhyloLevel
]
data
PhyloPeriod
=
PhyloPeriod
{
_phylo
_
PeriodId
::
PhyloPeriodId
,
_phylo
_
PeriodLevels
::
[
PhyloLevel
]
}
deriving
(
Generic
)
type
PhyloPeriodId
=
(
Start
,
End
)
-- | PhyloLevel : levels of phylomemy on level axis
-- Levels description:
-- Level -1: Ngram equals itself (by identity) == _phyloNgrams
-- Level -1: Ngram equals itself (by identity) == _phylo
_
Ngrams
-- Level 0: Group of synonyms (by stems + by qualitative expert meaning)
-- Level 1: First level of clustering
-- Level N: Nth level of clustering
data
PhyloLevel
=
PhyloLevel
{
_phyloLevelId
::
PhyloLevelId
,
_phyloLevelGroups
::
[
PhyloGroup
]
data
PhyloLevel
=
PhyloLevel
{
_phylo
_
LevelId
::
PhyloLevelId
,
_phylo
_
LevelGroups
::
[
PhyloGroup
]
}
deriving
(
Generic
)
type
PhyloLevelId
=
(
PhyloPeriodId
,
Int
)
...
...
@@ -77,15 +77,15 @@ type PhyloLevelId = (PhyloPeriodId, Int)
-- Ngrams: set of terms that build the group
-- Period Parents|Childs: weighted link to Parents|Childs (Temporal Period axis)
-- Level Parents|Childs: weighted link to Parents|Childs (Level Granularity axis)
data
PhyloGroup
=
PhyloGroup
{
_phyloGroupId
::
PhyloGroupId
,
_phyloGroupLabel
::
Maybe
Text
,
_phyloGroupNgrams
::
[
NgramId
]
data
PhyloGroup
=
PhyloGroup
{
_phylo
_
GroupId
::
PhyloGroupId
,
_phylo
_
GroupLabel
::
Maybe
Text
,
_phylo
_
GroupNgrams
::
[
NgramId
]
,
_phyloGroupPeriodParents
::
[
Edge
]
,
_phyloGroupPeriodChilds
::
[
Edge
]
,
_phylo
_
GroupPeriodParents
::
[
Edge
]
,
_phylo
_
GroupPeriodChilds
::
[
Edge
]
,
_phyloGroupLevelParents
::
[
Edge
]
,
_phyloGroupLevelChilds
::
[
Edge
]
,
_phylo
_
GroupLevelParents
::
[
Edge
]
,
_phylo
_
GroupLevelChilds
::
[
Edge
]
}
deriving
(
Generic
)
type
PhyloGroupId
=
(
PhyloLevelId
,
Int
)
...
...
@@ -93,7 +93,7 @@ type Edge = (PhyloGroupId, Weight)
type
Weight
=
Double
-- | JSON instances
$
(
deriveJSON
(
unPrefix
"_phylo"
)
''
P
hylo
)
$
(
deriveJSON
(
unPrefix
"_phyloPeriod"
)
''
P
hyloPeriod
)
$
(
deriveJSON
(
unPrefix
"_phyloLevel"
)
''
P
hyloLevel
)
$
(
deriveJSON
(
unPrefix
"_phyloGroup"
)
''
P
hyloGroup
)
$
(
deriveJSON
(
unPrefix
"_phylo
_
"
)
''
P
hylo
)
$
(
deriveJSON
(
unPrefix
"_phylo
_
Period"
)
''
P
hyloPeriod
)
$
(
deriveJSON
(
unPrefix
"_phylo
_
Level"
)
''
P
hyloLevel
)
$
(
deriveJSON
(
unPrefix
"_phylo
_
Group"
)
''
P
hyloGroup
)
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