Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
ab268184
Commit
ab268184
authored
May 07, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-np' of
ssh://gitlab.iscpif.fr:20022/gargantext/haskell-gargantext
into dev
parents
b71f03ca
64941d62
Changes
2
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 @
ab268184
...
...
@@ -84,7 +84,7 @@ import qualified Gargantext.Database.Schema.Ngrams as Ngrams
-- import Gargantext.Database.Schema.NodeNgram hiding (Action)
import
Gargantext.Prelude
-- 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
System.FileLock
(
FileLock
)
import
Test.QuickCheck
(
elements
)
...
...
@@ -787,15 +787,16 @@ putListNgrams listId ngramsType nes = do
where
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
-- client.
tableNgramsPut
::
(
HasInvalidError
err
,
RepoCmdM
env
err
m
)
=>
CorpusId
->
TabType
->
ListId
=>
TabType
->
ListId
->
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
let
ngramsType
=
ngramsTypeFromTabType
tabType
...
...
@@ -927,7 +928,6 @@ getTableNgrams nId tabType listId limit_ offset
type
QueryParamR
=
QueryParam'
'[
R
equired
,
Strict
]
type
TableNgramsApiGet
=
Summary
" Table Ngrams API Get"
:>
QueryParamR
"docId"
DocId
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParamR
"list"
ListId
:>
QueryParamR
"limit"
Limit
...
...
@@ -986,11 +986,15 @@ type ApiNgramsTableDoc = TableNgramsApiGet
:<|>
TableNgramsApiPut
:<|>
TableNgramsApiPost
apiNgramsTableDoc
::
(
RepoCmdM
env
err
m
,
HasNodeError
err
,
HasConnection
env
)
=>
ServerT
ApiNgramsTableDoc
m
apiNgramsTableDoc
=
getTableNgramsDoc
:<|>
tableNgramsPut
:<|>
tableNgramsPost
apiNgramsTableDoc
::
(
RepoCmdM
env
err
m
,
HasNodeError
err
,
HasInvalidError
err
,
HasConnection
env
)
=>
DocId
->
ServerT
ApiNgramsTableDoc
m
apiNgramsTableDoc
dId
=
getTableNgramsDoc
dId
:<|>
tableNgramsPut
:<|>
tableNgramsPost
-- > add new ngrams in database (TODO AD)
-- > index all the corpus accordingly (TODO AD)
src/Gargantext/API/Node.hs
View file @
ab268184
...
...
@@ -171,7 +171,7 @@ nodeAPI p uId id
-- TODO gather it
:<|>
getTable
id
:<|>
getTableNgramsCorpus
id
:<|>
tableNgramsPut
id
:<|>
tableNgramsPut
:<|>
getPairing
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