Commit c7c5cba3 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TEXT] some comments.

parent a04e0e9d
...@@ -155,6 +155,8 @@ type ListNgrams = NgramsTable ...@@ -155,6 +155,8 @@ type ListNgrams = NgramsTable
makePrisms ''NgramsTable makePrisms ''NgramsTable
-- | Question: why these repetition of Type in this instance
-- may you document it please ?
instance Each NgramsTable NgramsTable NgramsElement NgramsElement where instance Each NgramsTable NgramsTable NgramsElement NgramsElement where
each = _NgramsTable . each each = _NgramsTable . each
...@@ -644,8 +646,9 @@ something :: Monoid a => Maybe a -> a ...@@ -644,8 +646,9 @@ something :: Monoid a => Maybe a -> a
something Nothing = mempty something Nothing = mempty
something (Just a) = a something (Just a) = a
putListNgrams :: RepoCmdM env err m => NodeId -> NgramsType putListNgrams :: RepoCmdM env err m
-> [NgramsElement] -> m () => NodeId -> NgramsType
-> [NgramsElement] -> m ()
putListNgrams listId ngramsType nes = do putListNgrams listId ngramsType nes = do
var <- view repoVar var <- view repoVar
liftIO $ modifyMVar_ var $ liftIO $ modifyMVar_ var $
......
...@@ -19,6 +19,7 @@ Portability : POSIX ...@@ -19,6 +19,7 @@ Portability : POSIX
module Gargantext.Database.Flow -- (flowDatabase, ngrams2list) module Gargantext.Database.Flow -- (flowDatabase, ngrams2list)
where where
--import Debug.Trace (trace)
--import Control.Lens (view) --import Control.Lens (view)
import Control.Monad (mapM_) import Control.Monad (mapM_)
import Control.Monad.IO.Class (liftIO) import Control.Monad.IO.Class (liftIO)
...@@ -121,9 +122,7 @@ flowCorpus' NodeCorpus hyperdataDocuments (ids,masterUserId,masterCorpusId, user ...@@ -121,9 +122,7 @@ flowCorpus' NodeCorpus hyperdataDocuments (ids,masterUserId,masterCorpusId, user
-- List Ngrams Flow -- List Ngrams Flow
_masterListId <- flowList masterUserId masterCorpusId indexedNgrams _masterListId <- flowList masterUserId masterCorpusId indexedNgrams
_userListId <- flowListUser userId userCorpusId 500 _userListId <- flowListUser userId userCorpusId 500
--printDebug "Working on User ListId : " userListId
--}
-------------------------------------------------- --------------------------------------------------
_ <- mkDashboard userCorpusId userId _ <- mkDashboard userCorpusId userId
_ <- mkGraph userCorpusId userId _ <- mkGraph userCorpusId userId
...@@ -249,6 +248,7 @@ flowList :: FlowCmdM env err m => UserId -> CorpusId ...@@ -249,6 +248,7 @@ flowList :: FlowCmdM env err m => UserId -> CorpusId
flowList uId cId ngs = do flowList uId cId ngs = do
--printDebug "ngs:" ngs --printDebug "ngs:" ngs
lId <- getOrMkList cId uId lId <- getOrMkList cId uId
printDebug "listId flowList" lId
--printDebug "ngs" (DM.keys ngs) --printDebug "ngs" (DM.keys ngs)
-- TODO add stemming equivalence of 2 ngrams -- TODO add stemming equivalence of 2 ngrams
-- TODO needs rework -- TODO needs rework
...@@ -256,8 +256,7 @@ flowList uId cId ngs = do ...@@ -256,8 +256,7 @@ flowList uId cId ngs = do
-- _ <- insertGroups lId groupEd -- _ <- insertGroups lId groupEd
-- compute Candidate / Map -- compute Candidate / Map
_is <- mapM_ (\(typeList, ngElements) -> putListNgrams lId typeList ngElements) $ toList $ ngrams2list' ngs mapM_ (\(typeList, ngElmts) -> putListNgrams lId typeList ngElmts) $ toList $ ngrams2list' ngs
--printDebug "listNgrams inserted :" is
pure lId pure lId
......
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