2 Module : Gargantext.Core.Flow
3 Description : Core Flow main Types
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# LANGUAGE ConstraintKinds #-}
13 {-# LANGUAGE RankNTypes #-}
14 {-# LANGUAGE ConstrainedClassMethods #-}
16 module Gargantext.Core.Flow where
18 import Control.Lens (Lens')
20 import Data.Text (Text)
21 import Gargantext.Text.Terms (TermType)
22 import Gargantext.Core (Lang)
23 import Gargantext.Database.Schema.Ngrams (Ngrams, NgramsType)
24 import Gargantext.Core.Types.Main (HashId)
25 import Gargantext.Database.Types.Node -- (HyperdataDocument(..))
26 import Gargantext.Database.Node.Contact -- (HyperdataContact(..))
27 import Gargantext.Database.Node.Document.Insert (AddUniqId, InsertDb)
28 import Gargantext.Database.Utils (Cmd)
30 type FlowCorpus a = ( AddUniqId a
39 uniqId :: Lens' a (Maybe HashId)
41 class ExtractNgramsT h
43 extractNgramsT :: HasText h => TermType Lang -> h -> Cmd err (Map Ngrams (Map NgramsType Int))
47 hasText :: h -> [Text]
49 ------------------------------------------------------------------------
51 instance UniqId HyperdataDocument
53 uniqId = hyperdataDocument_uniqId
55 instance UniqId HyperdataContact