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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
01f6f79c
Commit
01f6f79c
authored
Nov 23, 2020
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
G.API.Ngrams: add newNgramsFromNgramsStatePatch
parent
8013e11f
Pipeline
#1236
failed with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+7
-1
No files found.
src/Gargantext/API/Ngrams.hs
View file @
01f6f79c
...
...
@@ -83,7 +83,7 @@ module Gargantext.API.Ngrams
where
import
Control.Concurrent
import
Control.Lens
((
.~
),
view
,
(
^.
),
(
^..
),
(
+~
),
(
%~
),
(
.~
),
sumOf
,
at
,
_Just
,
Each
(
..
),
(
%%~
),
mapped
)
import
Control.Lens
((
.~
),
view
,
(
^.
),
(
^..
),
(
+~
),
(
%~
),
(
.~
),
sumOf
,
at
,
_Just
,
Each
(
..
),
(
%%~
),
mapped
,
ifolded
,
withIndex
)
import
Control.Monad.Reader
import
Data.Aeson
hiding
((
.=
))
import
qualified
Data.Aeson.Text
as
DAT
...
...
@@ -275,6 +275,12 @@ currentVersion = do
r
<-
liftBase
$
readMVar
var
pure
$
r
^.
r_version
newNgramsFromNgramsStatePatch
::
NgramsStatePatch
->
[
Ngrams
]
newNgramsFromNgramsStatePatch
p
=
[
text2ngrams
(
unNgramsTerm
n
)
|
(
n
,
np
)
<-
p
^..
_PatchMap
.
each
.
_PatchMap
.
each
.
_NgramsTablePatch
.
_PatchMap
.
ifolded
.
withIndex
,
_
<-
np
^..
patch_new
.
_Just
]
-- tableNgramsPut :: (HasInvalidError err, RepoCmdM env err m)
commitStatePatch
::
RepoCmdM
env
err
m
=>
Versioned
NgramsStatePatch
->
m
(
Versioned
NgramsStatePatch
)
...
...
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