2 Module : Gargantext.Analysis
3 Description : Gargantext Analysis
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
11 {-# LANGUAGE NoImplicitPrelude #-}
14 module Gargantext.Analysis
17 import Gargantext.Prelude (undefined, IO(), Int())
19 -- import qualified Data.Text.Lazy as DTL
21 import Opaleye (Column, PGInt4)
22 --import Data.Map as DM
23 --import Data.Vector as DV
25 -- | Simple function to count Occurrences in a context of text.
26 occOfDocument :: Column PGInt4 -> Text -> IO Int
27 occOfDocument = undefined
28 --occOfDocument c_id txt = do
29 -- docs <- pm (hyperdataDocument_Abstract . node_hyperdata) <$> getCorpusDocument c_id
30 -- let occs = pm (\x -> maybe "" identity x) docs
31 -- let result = case sequence $ pm (parseOccurrences txt) occs of
32 -- -- TODO find a way to get nice message d'errors (file, function, line)
33 -- Left str -> error $ "[ERRROR] at file/function/line" ++ str
39 data Occurrences a b = Map a b