import Gargantext.Core.Text.Terms.WithList
import Gargantext.Database.Query.Table.Node(defaultList)
import Gargantext.Prelude
-import Gargantext.Database.Action.Flow
+import Gargantext.Database.Action.Flow.Types
import Gargantext.Core.Viz.LegacyPhylo hiding (Svg, Dot)
import Gargantext.Database.Admin.Types.Hyperdata
import Gargantext.Database.Schema.Ngrams (NgramsType(..))
-import Gargantext.Database.Query.Table.NodeNode (selectDocs)
+import Gargantext.Database.Query.Table.NodeContext (selectDocs)
import Gargantext.Core.Types
-
+import Gargantext.Core (HasDBid)
-- import Gargantext.Core.Viz.Phylo.LevelMaker (toPhylo)
-- import Gargantext.Core.Viz.Phylo.Tools
type MinSizeBranch = Int
-flowPhylo :: FlowCmdM env err m
+flowPhylo :: (FlowCmdM env err m, HasDBid NodeType)
=> CorpusId
-> m Phylo
flowPhylo cId = do
-- | To filter the Ngrams of a document based on the termList
filterTerms :: Patterns -> (Date, Text) -> (Date, [Text])
filterTerms patterns' (y,d) = (y,termsInText patterns' d)
- where
- --------------------------------------
- termsInText :: Patterns -> Text -> [Text]
- termsInText pats txt = List.nub
- $ List.concat
- $ map (map Text.unwords)
- $ extractTermsWithList pats txt
- --------------------------------------
docs = map ((\(y,t) -> Document y t) . filterTerms patterns) docs'