Commit 43efa783 authored by Alexandre Delanoë's avatar Alexandre Delanoë
parents 7bdcadbf ed90539a
Pipeline #2264 failed with stage
in 12 minutes and 6 seconds
...@@ -56,12 +56,16 @@ getCorpus cId lId nt' = do ...@@ -56,12 +56,16 @@ getCorpus cId lId nt' = do
Nothing -> NgramsTerms Nothing -> NgramsTerms
Just t -> t Just t -> t
listId <- case lId of
Nothing -> defaultList cId
Just l -> pure l
ns <- Map.fromList ns <- Map.fromList
<$> map (\n -> (_node_id n, n)) <$> map (\n -> (_node_id n, n))
<$> selectDocNodes cId <$> selectDocNodes cId
repo <- getRepo' [fromMaybe (panic "[Gargantext.API.Node.Corpus.Export]") lId] repo <- getRepo' [listId]
ngs <- getNodeNgrams cId lId nt repo ngs <- getNodeNgrams cId listId nt repo
let -- uniqId is hash computed already for each document imported in database let -- uniqId is hash computed already for each document imported in database
r = Map.intersectionWith r = Map.intersectionWith
(\a b -> Document { _d_document = a (\a b -> Document { _d_document = a
...@@ -77,14 +81,14 @@ getCorpus cId lId nt' = do ...@@ -77,14 +81,14 @@ getCorpus cId lId nt' = do
getNodeNgrams :: HasNodeError err getNodeNgrams :: HasNodeError err
=> CorpusId => CorpusId
-> Maybe ListId -> ListId
-> NgramsType -> NgramsType
-> NodeListStory -> NodeListStory
-> Cmd err (Map NodeId (Set NgramsTerm)) -> Cmd err (Map NodeId (Set NgramsTerm))
getNodeNgrams cId lId' nt repo = do getNodeNgrams cId lId nt repo = do
lId <- case lId' of -- lId <- case lId' of
Nothing -> defaultList cId -- Nothing -> defaultList cId
Just l -> pure l -- Just l -> pure l
lIds <- selectNodesWithUsername NodeList userMaster lIds <- selectNodesWithUsername NodeList userMaster
let ngs = filterListWithRoot MapTerm $ mapTermListRoot [lId] nt repo let ngs = filterListWithRoot MapTerm $ mapTermListRoot [lId] nt repo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment