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
195
Issues
195
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
64941d62
Unverified
Commit
64941d62
authored
May 07, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix type errors
parent
1a3ab28f
Pipeline
#372
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+14
-10
Node.hs
src/Gargantext/API/Node.hs
+1
-1
No files found.
src/Gargantext/API/Ngrams.hs
View file @
64941d62
...
@@ -84,7 +84,7 @@ import qualified Gargantext.Database.Schema.Ngrams as Ngrams
...
@@ -84,7 +84,7 @@ import qualified Gargantext.Database.Schema.Ngrams as Ngrams
-- import Gargantext.Database.Schema.NodeNgram hiding (Action)
-- import Gargantext.Database.Schema.NodeNgram hiding (Action)
import
Gargantext.Prelude
import
Gargantext.Prelude
-- import Gargantext.Core.Types (ListTypeId, listTypeId)
-- import Gargantext.Core.Types (ListTypeId, listTypeId)
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
ListId
,
CorpusId
,
DocId
,
Limit
,
Offset
,
HasInvalidError
,
assertValid
)
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
ListId
,
DocId
,
Limit
,
Offset
,
HasInvalidError
,
assertValid
)
import
Servant
hiding
(
Patch
)
import
Servant
hiding
(
Patch
)
import
System.FileLock
(
FileLock
)
import
System.FileLock
(
FileLock
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck
(
elements
)
...
@@ -787,15 +787,16 @@ putListNgrams listId ngramsType nes = do
...
@@ -787,15 +787,16 @@ putListNgrams listId ngramsType nes = do
where
where
m
=
Map
.
fromList
$
(
\
n
->
(
n
^.
ne_ngrams
,
ngramsElementToRepo
n
))
<$>
nes
m
=
Map
.
fromList
$
(
\
n
->
(
n
^.
ne_ngrams
,
ngramsElementToRepo
n
))
<$>
nes
tableNgramsPost
tabType
listId
=
putListNgrams
listId
tabType
tableNgramsPost
::
RepoCmdM
env
err
m
=>
TabType
->
NodeId
->
[
NgramsElement
]
->
m
()
tableNgramsPost
tabType
listId
=
putListNgrams
listId
(
ngramsTypeFromTabType
tabType
)
-- Apply the given patch to the DB and returns the patch to be applied on the
-- Apply the given patch to the DB and returns the patch to be applied on the
-- client.
-- client.
tableNgramsPut
::
(
HasInvalidError
err
,
RepoCmdM
env
err
m
)
tableNgramsPut
::
(
HasInvalidError
err
,
RepoCmdM
env
err
m
)
=>
CorpusId
->
TabType
->
ListId
=>
TabType
->
ListId
->
Versioned
NgramsTablePatch
->
Versioned
NgramsTablePatch
->
m
(
Versioned
NgramsTablePatch
)
->
m
(
Versioned
NgramsTablePatch
)
tableNgramsPut
_corpusId
tabType
listId
(
Versioned
p_version
p_table
)
tableNgramsPut
tabType
listId
(
Versioned
p_version
p_table
)
|
p_table
==
mempty
=
do
|
p_table
==
mempty
=
do
let
ngramsType
=
ngramsTypeFromTabType
tabType
let
ngramsType
=
ngramsTypeFromTabType
tabType
...
@@ -927,7 +928,6 @@ getTableNgrams nId tabType listId limit_ offset
...
@@ -927,7 +928,6 @@ getTableNgrams nId tabType listId limit_ offset
type
QueryParamR
=
QueryParam'
'[
R
equired
,
Strict
]
type
QueryParamR
=
QueryParam'
'[
R
equired
,
Strict
]
type
TableNgramsApiGet
=
Summary
" Table Ngrams API Get"
type
TableNgramsApiGet
=
Summary
" Table Ngrams API Get"
:>
QueryParamR
"docId"
DocId
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParamR
"list"
ListId
:>
QueryParamR
"list"
ListId
:>
QueryParamR
"limit"
Limit
:>
QueryParamR
"limit"
Limit
...
@@ -986,11 +986,15 @@ type ApiNgramsTableDoc = TableNgramsApiGet
...
@@ -986,11 +986,15 @@ type ApiNgramsTableDoc = TableNgramsApiGet
:<|>
TableNgramsApiPut
:<|>
TableNgramsApiPut
:<|>
TableNgramsApiPost
:<|>
TableNgramsApiPost
apiNgramsTableDoc
::
(
RepoCmdM
env
err
m
,
HasNodeError
err
,
HasConnection
env
)
apiNgramsTableDoc
::
(
RepoCmdM
env
err
m
=>
ServerT
ApiNgramsTableDoc
m
,
HasNodeError
err
apiNgramsTableDoc
=
getTableNgramsDoc
,
HasInvalidError
err
:<|>
tableNgramsPut
,
HasConnection
env
:<|>
tableNgramsPost
)
=>
DocId
->
ServerT
ApiNgramsTableDoc
m
apiNgramsTableDoc
dId
=
getTableNgramsDoc
dId
:<|>
tableNgramsPut
:<|>
tableNgramsPost
-- > add new ngrams in database (TODO AD)
-- > add new ngrams in database (TODO AD)
-- > index all the corpus accordingly (TODO AD)
-- > index all the corpus accordingly (TODO AD)
src/Gargantext/API/Node.hs
View file @
64941d62
...
@@ -171,7 +171,7 @@ nodeAPI p uId id
...
@@ -171,7 +171,7 @@ nodeAPI p uId id
-- TODO gather it
-- TODO gather it
:<|>
getTable
id
:<|>
getTable
id
:<|>
getTableNgramsCorpus
id
:<|>
getTableNgramsCorpus
id
:<|>
tableNgramsPut
id
:<|>
tableNgramsPut
:<|>
getPairing
id
:<|>
getPairing
id
-- :<|> getTableNgramsDoc id
-- :<|> getTableNgramsDoc id
...
...
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