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

Merge branch 'dev-refact-graph' into dev

parents df8144ca 0ce69ad8
#!/bin/bash #!/bin/bash
stack build --profile # --test # --haddock stack build # --profile # --test # --haddock
#!/bin/bash #!/bin/bash
stack install --profile # --test --haddock stack install #--profile # --test --haddock
...@@ -116,8 +116,8 @@ instance ToSchema GraphMetadata where ...@@ -116,8 +116,8 @@ instance ToSchema GraphMetadata where
makeLenses ''GraphMetadata makeLenses ''GraphMetadata
data Graph = Graph { _graph_nodes :: [Node] data Graph = Graph { _graph_nodes :: [Node]
, _graph_edges :: [Edge] , _graph_edges :: [Edge]
, _graph_metadata :: Maybe GraphMetadata , _graph_metadata :: Maybe GraphMetadata
} }
deriving (Show, Generic) deriving (Show, Generic)
......
...@@ -149,7 +149,7 @@ computeGraph cId d nt repo = do ...@@ -149,7 +149,7 @@ computeGraph cId d nt repo = do
-- TODO split diagonal -- TODO split diagonal
myCooc <- Map.filter (>1) myCooc <- Map.filter (>1)
<$> getCoocByNgrams (Diagonal False) <$> getCoocByNgrams (Diagonal True)
<$> groupNodesByNgrams ngs <$> groupNodesByNgrams ngs
<$> getNodesByNgramsOnlyUser cId (lIds <> [lId]) nt (Map.keys ngs) <$> getNodesByNgramsOnlyUser cId (lIds <> [lId]) nt (Map.keys ngs)
......
...@@ -60,7 +60,9 @@ cooc2graph distance threshold myCooc = do ...@@ -60,7 +60,9 @@ cooc2graph distance threshold myCooc = do
let let
(ti, _) = createIndices myCooc (ti, _) = createIndices myCooc
myCooc' = toIndex ti myCooc myCooc' = toIndex ti myCooc
matCooc = map2mat 0 (Map.size ti) $ Map.filter (> 1) myCooc' matCooc = map2mat 0 (Map.size ti)
$ Map.filterWithKey (\(a,b) _ -> a /= b)
$ Map.filter (> 1) myCooc'
distanceMat = measure distance matCooc distanceMat = measure distance matCooc
distanceMap = Map.filter (> threshold) $ mat2map distanceMat distanceMap = Map.filter (> threshold) $ mat2map distanceMat
......
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