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
5b112d21
Commit
5b112d21
authored
Nov 13, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FLOW][DB] completed (todo: many types declared at many places, cleaning it.)
parent
3b01b815
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+4
-4
Main.hs
src/Gargantext/Core/Types/Main.hs
+1
-1
Flow.hs
src/Gargantext/Database/Flow.hs
+5
-4
No files found.
src/Gargantext/API/Ngrams.hs
View file @
5b112d21
...
...
@@ -141,7 +141,7 @@ instance Arbitrary NgramsPatch where
--
data
NgramsIdPatch
=
data
NgramsIdPatch
=
NgramsIdPatch
{
_nip_ngramsId
::
NgramsElement
,
_nip_ngramsPatch
::
NgramsPatch
}
...
...
@@ -211,11 +211,11 @@ type NgramsIdPatchsBack = NgramsIdPatchs
defaultList
::
Connection
->
CorpusId
->
IO
ListId
defaultList
c
cId
=
view
node_id
<$>
maybe
(
panic
errorMessage
)
identity
<$>
head
defaultList
c
cId
=
view
node_id
<$>
maybe
(
panic
noListFound
)
identity
<$>
head
<$>
getListsWithParentId
c
cId
where
errorMessage
=
"Gargantext.API.Ngrams.defaultList: no list found"
noListFound
=
"Gargantext.API.Ngrams.defaultList: no list found"
toLists
::
ListId
->
NgramsIdPatchs
->
[(
ListId
,
NgramsId
,
ListTypeId
)]
toLists
lId
np
=
map
(
toList
lId
)
(
_nip_ngramsIdPatchs
np
)
...
...
src/Gargantext/Core/Types/Main.hs
View file @
5b112d21
...
...
@@ -80,7 +80,7 @@ corpusTree nId t = TreeN (NodeTree ("Corpus " <> t) NodeCorpus nId) ( [ leafT
-- TODO multiple ListType declaration, remove it
data
ListType
=
Stop
|
Candidate
|
Map
deriving
(
Generic
)
deriving
(
Generic
,
Eq
,
Ord
)
instance
ToJSON
ListType
instance
FromJSON
ListType
...
...
src/Gargantext/Database/Flow.hs
View file @
5b112d21
...
...
@@ -22,7 +22,7 @@ authors
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module
Gargantext.Database.Flow
module
Gargantext.Database.Flow
(
flowDatabase
)
where
import
System.FilePath
(
FilePath
)
import
Data.Maybe
(
Maybe
(
..
),
catMaybes
)
...
...
@@ -48,8 +48,8 @@ type UserId = Int
type
RootId
=
Int
type
CorpusId
=
Int
flow
::
FilePath
->
CorpusName
->
IO
[
Int
]
flow
fp
cName
=
do
flow
Database
::
FilePath
->
CorpusName
->
IO
[
Int
]
flow
Database
fp
cName
=
do
-- Corus Flow
(
masterUserId
,
_
,
corpusId
)
<-
subFlow
"gargantua"
"Big Corpus"
...
...
@@ -209,8 +209,9 @@ insertGroups lId ngrs =
]
------------------------------------------------------------------------
-- TODO: verify NgramsT lost here
ngrams2list
::
Map
(
NgramsT
NgramsIndexed
)
(
Map
NodeId
Int
)
->
Map
ListType
NgramsIndexed
ngrams2list
=
undefined
ngrams2list
=
DM
.
fromList
.
zip
(
repeat
Candidate
)
.
map
(
\
(
NgramsT
t
ng
)
->
ng
)
.
DM
.
keys
-- | TODO: weight of the list could be a probability
insertLists
::
ListId
->
Map
ListType
NgramsIndexed
->
Cmd
Int
...
...
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