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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
c227e749
Verified
Commit
c227e749
authored
Feb 28, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flow] insertMasterDocs with HasNLPServer
This simplifies call still a bit more
parent
d4121834
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
Arxiv.hs
src/Gargantext/Core/Text/Corpus/API/Arxiv.hs
+2
-2
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+7
-7
No files found.
src/Gargantext/Core/Text/Corpus/API/Arxiv.hs
View file @
c227e749
...
@@ -9,8 +9,8 @@ Portability : POSIX
...
@@ -9,8 +9,8 @@ Portability : POSIX
-}
-}
{-# OPTIONS_GHC -fno-warn-unused-top-binds #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-unused-top-binds #-}
module
Gargantext.Core.Text.Corpus.API.Arxiv
module
Gargantext.Core.Text.Corpus.API.Arxiv
(
get
(
get
...
@@ -18,7 +18,7 @@ module Gargantext.Core.Text.Corpus.API.Arxiv
...
@@ -18,7 +18,7 @@ module Gargantext.Core.Text.Corpus.API.Arxiv
,
convertQuery
,
convertQuery
)
where
)
where
import
Arxiv
qualified
as
Arxiv
import
Arxiv
qualified
import
Conduit
import
Conduit
import
Data.Text
qualified
as
Text
import
Data.Text
qualified
as
Text
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core
(
Lang
(
..
))
...
...
src/Gargantext/Database/Action/Flow.hs
View file @
c227e749
...
@@ -64,7 +64,7 @@ import Data.Set qualified as Set
...
@@ -64,7 +64,7 @@ import Data.Set qualified as Set
import
Data.Text
qualified
as
T
import
Data.Text
qualified
as
T
import
Gargantext.API.Ngrams.Tools
(
getTermsWith
)
import
Gargantext.API.Ngrams.Tools
(
getTermsWith
)
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
)
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
)
import
Gargantext.Core
(
Lang
(
..
),
NLPServerConfig
,
withDefaultLanguage
)
import
Gargantext.Core
(
Lang
(
..
),
withDefaultLanguage
)
import
Gargantext.Core.Notifications.CentralExchange.Types
(
HasCentralExchangeNotification
(
ce_notify
),
CEMessage
(
..
))
import
Gargantext.Core.Notifications.CentralExchange.Types
(
HasCentralExchangeNotification
(
ce_notify
),
CEMessage
(
..
))
import
Gargantext.Core.Config
(
GargConfig
(
..
),
hasConfig
)
import
Gargantext.Core.Config
(
GargConfig
(
..
),
hasConfig
)
import
Gargantext.Core.Config.Types
(
APIsConfig
(
..
))
import
Gargantext.Core.Config.Types
(
APIsConfig
(
..
))
...
@@ -306,8 +306,7 @@ addDocumentsToHyperCorpus :: ( IsDBCmd env err m
...
@@ -306,8 +306,7 @@ addDocumentsToHyperCorpus :: ( IsDBCmd env err m
->
[
document
]
->
[
document
]
->
m
[
DocId
]
->
m
[
DocId
]
addDocumentsToHyperCorpus
mb_hyper
la
corpusId
docs
=
do
addDocumentsToHyperCorpus
mb_hyper
la
corpusId
docs
=
do
nlpServer
<-
view
$
nlpServerGet
(
_tt_lang
la
)
ids
<-
insertMasterDocs
mb_hyper
la
docs
ids
<-
insertMasterDocs
nlpServer
mb_hyper
la
docs
void
$
Doc
.
add
corpusId
(
map
nodeId2ContextId
ids
)
void
$
Doc
.
add
corpusId
(
map
nodeId2ContextId
ids
)
pure
ids
pure
ids
...
@@ -401,15 +400,16 @@ buildSocialList l user userCorpusId listId ctype mfslw = do
...
@@ -401,15 +400,16 @@ buildSocialList l user userCorpusId listId ctype mfslw = do
insertMasterDocs
::
(
IsDBCmd
env
err
m
insertMasterDocs
::
(
IsDBCmd
env
err
m
,
HasNodeError
err
,
HasNodeError
err
,
HasNLPServer
env
,
FlowCorpus
a
,
FlowCorpus
a
,
MkCorpus
c
,
MkCorpus
c
)
)
=>
NLPServerConfig
=>
Maybe
c
->
Maybe
c
->
TermType
Lang
->
TermType
Lang
->
[
a
]
->
[
a
]
->
m
[
DocId
]
->
m
[
DocId
]
insertMasterDocs
ncs
c
lang
hs
=
do
insertMasterDocs
c
lang
hs
=
do
nlpServer
<-
view
$
nlpServerGet
(
_tt_lang
lang
)
(
masterUserId
,
_
,
masterCorpusId
)
<-
getOrMkRootWithCorpus
MkCorpusUserMaster
c
(
masterUserId
,
_
,
masterCorpusId
)
<-
getOrMkRootWithCorpus
MkCorpusUserMaster
c
(
ids'
,
documentsWithId
)
<-
insertDocs
masterUserId
masterCorpusId
(
map
(
toNode
masterUserId
Nothing
)
hs
)
(
ids'
,
documentsWithId
)
<-
insertDocs
masterUserId
masterCorpusId
(
map
(
toNode
masterUserId
Nothing
)
hs
)
_
<-
Doc
.
add
masterCorpusId
ids'
_
<-
Doc
.
add
masterCorpusId
ids'
...
@@ -421,7 +421,7 @@ insertMasterDocs ncs c lang hs = do
...
@@ -421,7 +421,7 @@ insertMasterDocs ncs c lang hs = do
mapNgramsDocs'
::
HashMap
.
HashMap
ExtractedNgrams
(
Map
NgramsType
(
Map
NodeId
(
TermsWeight
,
TermsCount
)))
mapNgramsDocs'
::
HashMap
.
HashMap
ExtractedNgrams
(
Map
NgramsType
(
Map
NodeId
(
TermsWeight
,
TermsCount
)))
<-
mapNodeIdNgrams
<-
mapNodeIdNgrams
<$>
documentIdWithNgrams
<$>
documentIdWithNgrams
(
extractNgramsT
n
cs
$
withLang
lang
documentsWithId
)
(
extractNgramsT
n
lpServer
$
withLang
lang
documentsWithId
)
(
map
(
B
.
first
contextId2NodeId
)
documentsWithId
)
(
map
(
B
.
first
contextId2NodeId
)
documentsWithId
)
lId
<-
getOrMkList
masterCorpusId
masterUserId
lId
<-
getOrMkList
masterCorpusId
masterUserId
...
...
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