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