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
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
Changes
1
Hide 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
...
@@ -83,7 +83,7 @@ module Gargantext.API.Ngrams
where
where
import
Control.Concurrent
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
Control.Monad.Reader
import
Data.Aeson
hiding
((
.=
))
import
Data.Aeson
hiding
((
.=
))
import
qualified
Data.Aeson.Text
as
DAT
import
qualified
Data.Aeson.Text
as
DAT
...
@@ -275,6 +275,12 @@ currentVersion = do
...
@@ -275,6 +275,12 @@ currentVersion = do
r
<-
liftBase
$
readMVar
var
r
<-
liftBase
$
readMVar
var
pure
$
r
^.
r_version
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)
-- tableNgramsPut :: (HasInvalidError err, RepoCmdM env err m)
commitStatePatch
::
RepoCmdM
env
err
m
=>
Versioned
NgramsStatePatch
->
m
(
Versioned
NgramsStatePatch
)
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