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
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
Christian Merten
haskell-gargantext
Commits
8023a043
Verified
Commit
8023a043
authored
Mar 02, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some test code for ngrams coutn
parent
cff88cad
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
4 deletions
+32
-4
.envrc
.envrc
+1
-0
gargantext.cabal
gargantext.cabal
+1
-0
package.yaml
package.yaml
+1
-0
shell.nix
shell.nix
+2
-1
Facet.hs
src/Gargantext/Database/Query/Facet.hs
+27
-3
No files found.
.envrc
View file @
8023a043
use_nix
export LANG=C.UTF-8
PATH_add $HOME/.ghcup/bin
gargantext.cabal
View file @
8023a043
...
...
@@ -93,6 +93,7 @@ library
Gargantext.Database.Admin.Types.Hyperdata
Gargantext.Database.Admin.Types.Node
Gargantext.Database.Prelude
Gargantext.Database.Query.FacetTest
Gargantext.Database.Query.Table.NgramsPostag
Gargantext.Database.Query.Table.Node
Gargantext.Database.Query.Table.Node.UpdateOpaleye
...
...
package.yaml
View file @
8023a043
...
...
@@ -122,6 +122,7 @@ library:
-
Gargantext.Database.Query.Table.Node
-
Gargantext.Database.Query.Table.Node.UpdateOpaleye
-
Gargantext.Database.Query.Table.User
-
Gargantext.Database.Query.FacetTest
-
Gargantext.Database.Schema.Ngrams
-
Gargantext.Defaults
-
Gargantext.Utils.Jobs
...
...
shell.nix
View file @
8023a043
...
...
@@ -2,7 +2,8 @@
let
myBuildInputs
=
[
pkgs
.
pkgs
.
docker-compose
pkgs
.
pkgs
.
haskell-language-server
#pkgs.pkgs.haskell-language-server
#pkgs.pkgs.haskellPackages.implicit-hie
pkgs
.
pkgs
.
stack
];
in
...
...
src/Gargantext/Database/Query/Facet.hs
View file @
8023a043
...
...
@@ -20,6 +20,7 @@ module Gargantext.Database.Query.Facet
,
runViewDocuments
,
viewDocuments
--, viewDocuments'
,
viewDocumentsAgg
,
runCountDocuments
,
filterWith
,
runTestAgg
...
...
@@ -176,6 +177,24 @@ viewDocuments cId t ntId mQuery mYear = proc () -> do
,
facetDoc_score
=
toNullable
$
nc
^.
nc_score
}
viewDocumentsNonNull
::
CorpusId
->
IsTrash
->
NodeTypeId
->
Maybe
Text
->
Maybe
Text
->
Select
FacetDocAggPart
viewDocumentsNonNull
cId
t
ntId
mQuery
mYear
=
proc
()
->
do
(
c
,
nc
)
<-
viewDocumentsQuery
cId
t
ntId
mQuery
mYear
-<
()
returnA
-<
FacetDoc
{
facetDoc_id
=
_cs_id
c
,
facetDoc_created
=
_cs_date
c
,
facetDoc_title
=
_cs_name
c
,
facetDoc_hyperdata
=
_cs_hyperdata
c
,
facetDoc_category
=
nc
^.
nc_category
,
facetDoc_ngramCount
=
0
-- nc^.nc_score
,
facetDoc_score
=
nc
^.
nc_score
}
viewDocuments'
::
CorpusId
->
IsTrash
->
NodeTypeId
...
...
@@ -183,10 +202,15 @@ viewDocuments' :: CorpusId
->
Maybe
Text
->
Select
FacetDocAgg
viewDocuments'
cId
t
ntId
mQuery
mYear
=
proc
()
->
do
fd
<-
viewDocumentsAgg
cId
t
ntId
mQuery
mYear
-<
()
-- fd <- viewDocumentsAgg cId t ntId mQuery mYear -< ()
fd
<-
viewDocumentsNonNull
cId
t
ntId
mQuery
mYear
-<
()
agg
<-
(
laterally
.
OAgg
.
aggregate
)
sumInt4
(
proc
fd'
->
do
returnA
-<
facetDoc_ngramCount
fd'
)
-<
fd
cnng
<-
optionalRestrict
queryContextNodeNgramsTable
-<
\
cnng'
->
(
cnng'
^.
cnng_node_id
)
.==
pgNodeId
cId
.&&
(
cnng'
^.
cnng_context_id
)
.==
facetDoc_id
fd'
returnA
-<
matchMaybe
cnng
$
maybe
0
_cnng_doc_count
)
-<
fd
returnA
-<
fd
{
facetDoc_ngramCount
=
agg
}
...
...
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