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
157
Issues
157
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
8fb8da94
Commit
8fb8da94
authored
Jan 26, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPEC] Tree improved, more generic and closer from the actual Gargantext (Python) objects.
parent
85311942
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
65 deletions
+64
-65
Main.hs
src/Data/Gargantext/Types/Main.hs
+64
-65
No files found.
src/Data/Gargantext/Types/Main.hs
View file @
8fb8da94
...
...
@@ -4,6 +4,7 @@
module
Data.Gargantext.Types.Main
where
import
Data.Monoid
((
<>
))
import
Protolude
(
fromMaybe
)
--import Data.ByteString (ByteString())
...
...
@@ -50,28 +51,26 @@ userTree = NodeT NodeUser [projectTree]
projectTree
::
Tree
NodeType
NodeType
projectTree
=
NodeT
Project
[
corpusTree
]
-- | Corpus Tree
simplified
-- | Corpus Tree
corpusTree
::
Tree
NodeType
NodeType
corpusTree
=
NodeT
Corpus
[
LeafT
Document
,
LeafT
Favorites
,
LeafT
List
,
LeafT
Score
]
corpusTree
=
NodeT
Corpus
(
[
LeafT
Document
]
<>
[
LeafT
Lists
]
<>
[
LeafT
Metrics
]
<>
[
LeafT
Favorites
]
)
-- | TODO add Symbolic Node / Document
-- TODO make instances of Nodes
data
NodeType
=
NodeUser
|
Folder
|
Project
|
Corpus
|
Document
data
NodeType
=
NodeUser
|
Project
|
Corpus
|
Document
|
DocumentCopy
|
Favorites
|
NodeSwap
|
List
|
StopList
|
MainList
|
MapList
|
GroupList
|
Score
|
Occurrences
|
Cooccurrences
|
Specclusion
|
Genclusion
|
Cvalue
|
Tficf
|
TfidfCorpus
|
TfidfGlobal
|
TirankLocal
|
TirankGlobal
|
Lists
|
Metrics
deriving
(
Show
,
Eq
)
data
Lists
=
StopList
|
MainList
|
MapList
|
GroupList
data
Metrics
=
Occurrences
|
Cooccurrences
|
Specclusion
|
Genclusion
|
Cvalue
|
TfidfCorpus
|
TfidfGlobal
|
TirankLocal
|
TirankGlobal
...
...
@@ -114,56 +113,56 @@ type MapList = List
type
GroupList
=
List
-- | Then a Node can be a Score which as some synonyms
type
Score
=
Node
HyperdataScore
type
Occurrences
=
Score
type
Cooccurrences
=
Score
type
Specclusion
=
Score
type
Genclusion
=
Score
type
Cvalue
=
Score
type
Tficf
=
Score
-- TODO All these Tfidf* will be replaced with TFICF
type
TfidfCorpus
=
Tficf
type
TfidfGlobal
=
Tficf
type
TirankLocal
=
Tficf
type
TirankGlobal
=
Tficf
-- | Then a Node can be either a Graph or a Phylo or a Notebook
type
Graph
=
Node
HyperdataGraph
type
Phylo
=
Node
HyperdataPhylo
type
Notebook
=
Node
HyperdataNotebook
nodeTypes
::
[(
NodeType
,
NodeTypeId
)]
nodeTypes
=
[
--(NodeUser , 1)
--type Score = Node HyperdataScore
--type Occurrences = Score
--type Cooccurrences = Score
--type Specclusion = Score
--type Genclusion = Score
--type Cvalue = Score
--type Tficf = Score
---- TODO All these Tfidf* will be replaced with TFICF
--type TfidfCorpus = Tficf
--type TfidfGlobal = Tficf
--type TirankLocal = Tficf
--type TirankGlobal = Tficf
--
---- | Then a Node can be either a Graph or a Phylo or a Notebook
--type Graph = Node HyperdataGraph
--type Phylo = Node HyperdataPhylo
--type Notebook = Node HyperdataNotebook
--nodeTypes :: [(NodeType, NodeTypeId)]
--nodeTypes = [
-- --(NodeUser , 1)
----
-- (Project , 2)
-- , (NodeSwap , 19)
-- , (Corpus , 3)
-- , (Document , 4)
-------- Lists
-- , (StopList , 5)
-- , (GroupList , 6)
-- , (MainList , 7)
-- , (MapList , 8)
---- Scores
-- , (Occurrences , 10)
-- , (Cooccurrences , 9)
--
-- , (Specclusion , 11)
-- , (Genclusion , 18)
-- , (Cvalue , 12)
--
-- , (TfidfCorpus , 13)
-- , (TfidfGlobal , 14)
--
-- , (TirankLocal , 16)
-- , (TirankGlobal , 17)
--
(
Project
,
2
)
,
(
NodeSwap
,
19
)
,
(
Corpus
,
3
)
,
(
Document
,
4
)
------ Lists
,
(
StopList
,
5
)
,
(
GroupList
,
6
)
,
(
MainList
,
7
)
,
(
MapList
,
8
)
-- Scores
,
(
Occurrences
,
10
)
,
(
Cooccurrences
,
9
)
,
(
Specclusion
,
11
)
,
(
Genclusion
,
18
)
,
(
Cvalue
,
12
)
,
(
TfidfCorpus
,
13
)
,
(
TfidfGlobal
,
14
)
,
(
TirankLocal
,
16
)
,
(
TirankGlobal
,
17
)
-- Node management
,
(
Favorites
,
15
)
]
---- Node management
-- , (Favorites , 15)
--
nodeTypeId
::
NodeType
->
NodeTypeId
nodeTypeId
tn
=
fromMaybe
(
error
(
"Typename "
++
show
tn
++
" does not exist"
))
(
lookup
tn
nodeTypes
)
-- ]
----
--nodeTypeId :: NodeType -> NodeTypeId
--nodeTypeId tn = fromMaybe (error ("Typename " ++ show tn ++ " does not exist")) (lookup tn nodeTypes)
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