1 module Data.Gargantext.Analysis where
3 -- import qualified Data.Text.Lazy as DTL
5 import Opaleye (Column, PGInt4)
6 --import Data.Map as DM
7 --import Data.Vector as DV
9 -- | Simple function to count Occurrences in a context of text.
10 occOfDocument :: Column PGInt4 -> Text -> IO Int
11 occOfDocument = undefined
12 --occOfDocument c_id txt = do
13 -- docs <- pm (hyperdataDocument_Abstract . node_hyperdata) <$> getCorpusDocument c_id
14 -- let occs = pm (\x -> maybe "" identity x) docs
15 -- let result = case sequence $ pm (parseOccurrences txt) occs of
16 -- -- TODO find a way to get nice message d'errors (file, function, line)
17 -- Left str -> error $ "[ERRROR] at file/function/line" ++ str
23 data Occurrences a b = Map a b