]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Analysis.hs
[FACET DOC QUERY] needs Full Text filter and Sum ngrams count but type is ok for...
[gargantext.git] / src / Gargantext / Analysis.hs
1 module Gargantext.Analysis where
2
3 import Gargantext.Prelude
4
5 -- import qualified Data.Text.Lazy as DTL
6 import Data.Text
7 import Opaleye (Column, PGInt4)
8 --import Data.Map as DM
9 --import Data.Vector as DV
10
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
20 -- Right xs -> xs
21 -- pure (sum result)
22
23
24
25 data Occurrences a b = Map a b
26
27
28
29
30
31
32
33
34