Commit 85d75a49 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[LOGS] removing trace.

parent 3a7a4e60
Pipeline #203 canceled with stage
...@@ -38,7 +38,7 @@ import Control.Monad.IO.Class (liftIO) ...@@ -38,7 +38,7 @@ import Control.Monad.IO.Class (liftIO)
import Control.Monad ((>>)) import Control.Monad ((>>))
--import System.IO (putStrLn, readFile) --import System.IO (putStrLn, readFile)
--import qualified Data.Map as Map import qualified Data.Map as Map
import Data.Aeson (FromJSON, ToJSON) import Data.Aeson (FromJSON, ToJSON)
import Data.Text (Text()) import Data.Text (Text())
import Data.Swagger import Data.Swagger
...@@ -284,8 +284,7 @@ graphAPI nId = do ...@@ -284,8 +284,7 @@ graphAPI nId = do
nodeGraph <- getNode nId HyperdataGraph nodeGraph <- getNode nId HyperdataGraph
let title = "Title" let metadata = GraphMetadata "Title" [maybe 0 identity $ _node_parentId nodeGraph]
let metadata = GraphMetadata title [maybe 0 identity $ _node_parentId nodeGraph]
[ LegendField 1 "#FFF" "Cluster" [ LegendField 1 "#FFF" "Cluster"
, LegendField 2 "#FFF" "Cluster" , LegendField 2 "#FFF" "Cluster"
] ]
...@@ -294,9 +293,8 @@ graphAPI nId = do ...@@ -294,9 +293,8 @@ graphAPI nId = do
_lId <- defaultList cId _lId <- defaultList cId
-- lId' <- listsWith masterUser -- lId' <- listsWith masterUser
--myCooc <- getCoocByDocDev cId lId -- (lid' <> [lId]) --myCooc <- getCoocByDocDev cId lId -- (lid' <> [lId])
myCooc <- coocOn identity <$> getNgramsByNode cId NgramsTerms myCooc <- Map.filter (>2) <$> coocOn identity <$> getNgramsByNode cId NgramsTerms
liftIO $ set graph_metadata (Just metadata) liftIO $ set graph_metadata (Just metadata) <$> cooc2graph myCooc
<$> cooc2graph myCooc
-- <$> maybe defaultGraph identity -- <$> maybe defaultGraph identity
-- <$> readGraphFromJson "purescript-gargantext/dist/examples/imtNew.json" -- <$> readGraphFromJson "purescript-gargantext/dist/examples/imtNew.json"
......
...@@ -122,7 +122,7 @@ flowCorpus' NodeCorpus hyperdataDocuments (ids,masterUserId,masterCorpusId, user ...@@ -122,7 +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 100
-------------------------------------------------- --------------------------------------------------
_ <- mkDashboard userCorpusId userId _ <- mkDashboard userCorpusId userId
_ <- mkGraph userCorpusId userId _ <- mkGraph userCorpusId userId
...@@ -270,7 +270,8 @@ flowListUser uId cId n = do ...@@ -270,7 +270,8 @@ flowListUser uId cId n = do
putListNgrams lId NgramsTerms $ putListNgrams lId NgramsTerms $
[ NgramsElement (tficf_ngramsTerms ng) GraphList 1 Nothing mempty [ NgramsElement (tficf_ngramsTerms ng) GraphList 1 Nothing mempty
| ng <- ngs ] | ng <- ngs
]
pure lId pure lId
......
...@@ -18,25 +18,19 @@ Mainly reexport functions in @Data.Text.Metrics@ ...@@ -18,25 +18,19 @@ Mainly reexport functions in @Data.Text.Metrics@
module Gargantext.Text.Metrics module Gargantext.Text.Metrics
where where
import Data.Ord (Down(..)) --import Data.Array.Accelerate ((:.)(..), Z(..))
import qualified Data.List as L --import Debug.Trace (trace)
import Data.Map (Map)
import qualified Data.Map as M
--import Math.KMeans (kmeans, euclidSq, elements) --import Math.KMeans (kmeans, euclidSq, elements)
import Data.Map (Map)
import Data.Ord (Down(..))
import GHC.Real (round)
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Viz.Graph.Distances.Matrice import Gargantext.Viz.Graph.Distances.Matrice
import Gargantext.Viz.Graph.Index import Gargantext.Viz.Graph.Index
import qualified Data.Array.Accelerate.Interpreter as DAA
import qualified Data.Array.Accelerate as DAA import qualified Data.Array.Accelerate as DAA
-- import Data.Array.Accelerate ((:.)(..), Z(..)) import qualified Data.Array.Accelerate.Interpreter as DAA
import qualified Data.List as L
import GHC.Real (round) import qualified Data.Map as M
import Debug.Trace (trace)
data MapListSize = MapListSize Int data MapListSize = MapListSize Int
data InclusionSize = InclusionSize Int data InclusionSize = InclusionSize Int
...@@ -57,7 +51,8 @@ filterCooc fc cc = (filterCooc' fc) ts cc ...@@ -57,7 +51,8 @@ filterCooc fc cc = (filterCooc' fc) ts cc
ts = map _scored_terms $ takeSome fc $ coocScored cc ts = map _scored_terms $ takeSome fc $ coocScored cc
filterCooc' :: (Show t, Ord t) => FilterConfig -> [t] -> Map (t, t) Int -> Map (t, t) Int filterCooc' :: (Show t, Ord t) => FilterConfig -> [t] -> Map (t, t) Int -> Map (t, t) Int
filterCooc' (FilterConfig _ _ _ _ (DefaultValue dv)) ts m = trace ("coocScored " <> show ts) $ filterCooc' (FilterConfig _ _ _ _ (DefaultValue dv)) ts m =
-- trace ("coocScored " <> show ts) $
foldl' (\m' k -> M.insert k (maybe dv identity $ M.lookup k m) m') foldl' (\m' k -> M.insert k (maybe dv identity $ M.lookup k m) m')
M.empty selection M.empty selection
where where
......
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