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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
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
6c152aab
Commit
6c152aab
authored
Jun 20, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
ssh://gitlab.iscpif.fr:20022/gargantext/haskell-gargantext
into dev
parents
88befdc7
c09d2b80
Pipeline
#483
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+7
-6
No files found.
src/Gargantext/API/Ngrams.hs
View file @
6c152aab
...
@@ -201,12 +201,12 @@ mkNgramsElement ngrams list rp children =
...
@@ -201,12 +201,12 @@ mkNgramsElement ngrams list rp children =
-- TODO review
-- TODO review
size
=
1
+
count
" "
ngrams
size
=
1
+
count
" "
ngrams
newNgramsElement
::
NgramsTerm
->
NgramsElement
newNgramsElement
::
Maybe
ListType
->
NgramsTerm
->
NgramsElement
newNgramsElement
ngrams
=
mkNgramsElement
ngrams
GraphTerm
Nothing
mempty
newNgramsElement
mayList
ngrams
=
mkNgramsElement
ngrams
(
fromMaybe
GraphTerm
mayList
)
Nothing
mempty
instance
ToSchema
NgramsElement
instance
ToSchema
NgramsElement
instance
Arbitrary
NgramsElement
where
instance
Arbitrary
NgramsElement
where
arbitrary
=
elements
[
newNgramsElement
"sport"
]
arbitrary
=
elements
[
newNgramsElement
Nothing
"sport"
]
ngramsElementToRepo
::
NgramsElement
->
NgramsRepoElement
ngramsElementToRepo
::
NgramsElement
->
NgramsRepoElement
ngramsElementToRepo
ngramsElementToRepo
...
@@ -794,9 +794,9 @@ putListNgrams listId ngramsType nes = do
...
@@ -794,9 +794,9 @@ 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
::
RepoCmdM
env
err
m
=>
TabType
->
NodeId
->
[
NgramsTerm
]
->
m
()
tableNgramsPost
::
RepoCmdM
env
err
m
=>
TabType
->
NodeId
->
Maybe
ListType
->
[
NgramsTerm
]
->
m
()
tableNgramsPost
tabType
listId
=
tableNgramsPost
tabType
listId
mayList
=
putListNgrams
listId
(
ngramsTypeFromTabType
tabType
)
.
fmap
newNgramsElement
putListNgrams
listId
(
ngramsTypeFromTabType
tabType
)
.
fmap
(
newNgramsElement
mayList
)
-- 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.
...
@@ -1009,6 +1009,7 @@ type TableNgramsApiPut = Summary " Table Ngrams API Change"
...
@@ -1009,6 +1009,7 @@ type TableNgramsApiPut = Summary " Table Ngrams API Change"
type
TableNgramsApiPost
=
Summary
" Table Ngrams API Adds new ngrams"
type
TableNgramsApiPost
=
Summary
" Table Ngrams API Adds new ngrams"
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParamR
"list"
ListId
:>
QueryParamR
"list"
ListId
:>
QueryParam
"listType"
ListType
:>
ReqBody
'[
J
SON
]
[
NgramsTerm
]
:>
ReqBody
'[
J
SON
]
[
NgramsTerm
]
:>
Post
'[
J
SON
]
()
:>
Post
'[
J
SON
]
()
...
...
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