mcId <- getClosestParentIdByType nId NodeCorpus
let cId = maybe (panic "[G.V.G.API] Node has no parent") identity mcId
- printDebug "[getGraph] getting list for cId" cId
+ -- printDebug "[getGraph] getting list for cId" cId
listId <- defaultList cId
- repo <- getRepo' [listId]
+ repo <- getRepo [listId]
-- TODO Distance in Graph params
case graph of
let cId = maybe (panic "[G.V.G.API] Node has no parent") identity mcId
listId <- defaultList cId
- repo <- getRepo' [listId]
+ repo <- getRepo [listId]
let v = repo ^. unNodeStory . at listId . _Just . a_version
let computeG mt = do
$ mapTermListRoot [lId] nt repo
myCooc <- HashMap.filter (>1) -- Removing the hapax (ngrams with 1 cooc)
- -- <$> HashMap.filterWithKey (\(x,y) _ -> x /= y)
- -- <$> getCoocByNgrams (if d == Conditional then Diagonal True else Diagonal False)
<$> getCoocByNgrams (Diagonal True)
<$> groupNodesByNgrams ngs
<$> getContextsByNgramsOnlyUser cId (lIds <> [lId]) nt (HashMap.keys ngs)
- -- printDebug "myCooc" myCooc
- -- saveAsFileDebug "debug/my-cooc" myCooc
-
- listNgrams <- getListNgrams [lId] nt
-
- -- graph <- liftBase $ cooc2graphWith Confluence d 0 myCooc
- -- graph <- liftBase $ cooc2graphWith Spinglass d 0 myCooc
graph <- liftBase $ cooc2graphWith method d 0 myCooc
- -- saveAsFileDebug "debug/graph" graph
- pure $ mergeGraphNgrams graph (Just listNgrams)
+ -- listNgrams <- getListNgrams [lId] nt
+ --let graph' = mergeGraphNgrams graph (Just listNgrams)
+ -- saveAsFileDebug "/tmp/graphWithNodes" graph'
+
+ pure graph
defaultGraphMetadata :: HasNodeError err
else panic "[G.V.G.API] list not found after iterations"
Just listId -> do
- repo <- getRepo' [listId]
+ repo <- getRepo [listId]
let v = repo ^. unNodeStory . at listId . _Just . a_version
- printDebug "graphVersions" v
+ -- printDebug "graphVersions" v
pure $ GraphVersions { gv_graph = listVersion
, gv_repo = v }