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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
b454d924
Commit
b454d924
authored
Mar 30, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PHYLO] adding ids (Period/Level/Group).
parent
1aae8a6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
Phylo.hs
src/Gargantext/Types/Phylo.hs
+13
-6
No files found.
src/Gargantext/Types/Phylo.hs
View file @
b454d924
...
@@ -43,8 +43,8 @@ data Phylo = Phylo { _phyloDuration :: (Start, End)
...
@@ -43,8 +43,8 @@ data Phylo = Phylo { _phyloDuration :: (Start, End)
,
_phyloPeriods
::
[
PhyloPeriod
]
,
_phyloPeriods
::
[
PhyloPeriod
]
}
deriving
(
Generic
)
}
deriving
(
Generic
)
type
Start
=
UTCTime
type
Start
=
UTCTime
-- TODO: format EPOCH unix integer
type
End
=
UTCTime
type
End
=
UTCTime
-- TODO: format EPOCH unix integer
type
Ngram
=
(
NgramId
,
Text
)
type
Ngram
=
(
NgramId
,
Text
)
type
NgramId
=
Int
type
NgramId
=
Int
...
@@ -52,24 +52,30 @@ type NgramId = Int
...
@@ -52,24 +52,30 @@ 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
PhyloPeriod
=
PhyloPeriod
{
_phyloPeriod
Duration
::
(
Start
,
End
)
data
PhyloPeriod
=
PhyloPeriod
{
_phyloPeriod
Id
::
PhyloPeriodId
,
_phyloPeriodLevels
::
[
PhyloLevel
]
,
_phyloPeriodLevels
::
[
PhyloLevel
]
}
deriving
(
Generic
)
}
deriving
(
Generic
)
type
PhyloPeriodId
=
(
Start
,
End
)
-- | PhyloLevel : levels of phylomemy on level axis
-- | PhyloLevel : levels of phylomemy on level axis
-- Levels description:
-- Levels description:
-- Level -1: Ngram equals itself (by identity) == _phyloNgrams
-- Level -1: Ngram equals itself (by identity) == _phyloNgrams
-- Level 0: Group of synonyms (by stems + by qualitative expert meaning)
-- Level 0: Group of synonyms (by stems + by qualitative expert meaning)
-- Level 1: First level of clustering
-- Level 1: First level of clustering
-- Level N: Nth level of clustering
-- Level N: Nth level of clustering
type
PhyloLevel
=
[
PhyloGroup
]
data
PhyloLevel
=
PhyloLevel
{
_phyloLevelId
::
PhyloLevelId
,
_phyloLevelGroups
::
[
PhyloGroup
]
}
deriving
(
Generic
)
type
PhyloLevelId
=
(
PhyloPeriodId
,
Int
)
-- | 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
-- Period Parents|Childs: directed and weighted link to Parents|Childs (Temporal Period axis)
-- Period Parents|Childs: directed and weighted link to Parents|Childs (Temporal Period axis)
-- Level Parents|Childs: directed and weighted link to Parents|Childs (Level Granularity axis)
-- Level Parents|Childs: directed and weighted link to Parents|Childs (Level Granularity axis)
data
PhyloGroup
=
PhyloGroup
{
_phyloGroupId
::
GroupId
data
PhyloGroup
=
PhyloGroup
{
_phyloGroupId
::
Phylo
GroupId
,
_phyloGroupLabel
::
Maybe
Text
,
_phyloGroupLabel
::
Maybe
Text
,
_phyloGroupNgrams
::
[
NgramId
]
,
_phyloGroupNgrams
::
[
NgramId
]
...
@@ -80,11 +86,12 @@ data PhyloGroup = PhyloGroup { _phyloGroupId :: GroupId
...
@@ -80,11 +86,12 @@ data PhyloGroup = PhyloGroup { _phyloGroupId :: GroupId
,
_phyloGroupLevelChilds
::
[
Edge
]
,
_phyloGroupLevelChilds
::
[
Edge
]
}
deriving
(
Generic
)
}
deriving
(
Generic
)
type
PhyloGroupId
=
(
PhyloPeriodId
,
PhyloLevelId
,
Int
)
type
Edge
=
(
PhyloGroupId
,
Weight
)
type
Edge
=
(
PhyloGroupId
,
Weight
)
type
Weight
=
Double
type
Weight
=
Double
type
PhyloGroupId
=
Int
-- | JSON instances
-- | JSON instances
$
(
deriveJSON
(
unPrefix
"_phylo"
)
''
P
hylo
)
$
(
deriveJSON
(
unPrefix
"_phylo"
)
''
P
hylo
)
$
(
deriveJSON
(
unPrefix
"_phyloPeriod"
)
''
P
hyloPeriod
)
$
(
deriveJSON
(
unPrefix
"_phyloPeriod"
)
''
P
hyloPeriod
)
$
(
deriveJSON
(
unPrefix
"_phyloLevel"
)
''
P
hyloLevel
)
$
(
deriveJSON
(
unPrefix
"_phyloGroup"
)
''
P
hyloGroup
)
$
(
deriveJSON
(
unPrefix
"_phyloGroup"
)
''
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