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
147
Issues
147
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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)
,
_phyloPeriods
::
[
PhyloPeriod
]
}
deriving
(
Generic
)
type
Start
=
UTCTime
type
End
=
UTCTime
type
Start
=
UTCTime
-- TODO: format EPOCH unix integer
type
End
=
UTCTime
-- TODO: format EPOCH unix integer
type
Ngram
=
(
NgramId
,
Text
)
type
NgramId
=
Int
...
...
@@ -52,24 +52,30 @@ 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
{
_phyloPeriod
Duration
::
(
Start
,
End
)
data
PhyloPeriod
=
PhyloPeriod
{
_phyloPeriod
Id
::
PhyloPeriodId
,
_phyloPeriodLevels
::
[
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 0: Group of synonyms (by stems + by qualitative expert meaning)
-- Level 1: First 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
-- Label : maybe has a label as text
-- Ngrams: set of terms that build the group
-- 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)
data
PhyloGroup
=
PhyloGroup
{
_phyloGroupId
::
GroupId
data
PhyloGroup
=
PhyloGroup
{
_phyloGroupId
::
Phylo
GroupId
,
_phyloGroupLabel
::
Maybe
Text
,
_phyloGroupNgrams
::
[
NgramId
]
...
...
@@ -80,11 +86,12 @@ data PhyloGroup = PhyloGroup { _phyloGroupId :: GroupId
,
_phyloGroupLevelChilds
::
[
Edge
]
}
deriving
(
Generic
)
type
PhyloGroupId
=
(
PhyloPeriodId
,
PhyloLevelId
,
Int
)
type
Edge
=
(
PhyloGroupId
,
Weight
)
type
Weight
=
Double
type
PhyloGroupId
=
Int
-- | JSON instances
$
(
deriveJSON
(
unPrefix
"_phylo"
)
''
P
hylo
)
$
(
deriveJSON
(
unPrefix
"_phyloPeriod"
)
''
P
hyloPeriod
)
$
(
deriveJSON
(
unPrefix
"_phyloLevel"
)
''
P
hyloLevel
)
$
(
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