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
27c08f8f
Commit
27c08f8f
authored
Dec 02, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getTableNgrams more timing infos
parent
35d2b25a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+7
-2
No files found.
src/Gargantext/API/Ngrams.hs
View file @
27c08f8f
...
...
@@ -115,7 +115,7 @@ import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import
Data.Swagger
hiding
(
version
,
patch
)
import
Data.Text
(
Text
,
isInfixOf
,
count
)
import
Data.Validity
import
Formatting
(
hprint
,
(
%
))
import
Formatting
(
hprint
,
int
,
(
%
))
import
Formatting.Clock
(
timeSpecs
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
...
...
@@ -997,15 +997,20 @@ getTableNgrams _nType nId tabType listId limit_ offset
setScores
False
table
=
pure
table
setScores
True
table
=
do
let
ngrams_terms
=
(
table
^..
each
.
ne_ngrams
)
t1
<-
getTime'
occurrences
<-
getOccByNgramsOnlyFast
nId
ngramsType
ngrams_terms
t2
<-
getTime'
liftIO
$
hprint
stderr
(
"getTableNgrams/setScores #ngrams="
%
int
%
" time="
%
timeSpecs
%
"
\n
"
)
(
length
ngrams_terms
)
t1
t2
{-
occurrences <- getOccByNgramsOnlySlow nType nId
(lIds <> [listId])
ngramsType
ngrams_terms
-}
-}
let
setOcc
ne
=
ne
&
ne_occurrences
.~
sumOf
(
at
(
ne
^.
ne_ngrams
)
.
_Just
)
occurrences
...
...
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