]> Git — Sourcephile - gargantext.git/blob - src/Data/Gargantext/Analysis.hs
[FEAT] NLP functions. Servant ClientM need to be fixed.
[gargantext.git] / src / Data / Gargantext / Analysis.hs
1 module Data.Gargantext.Analysis where
2
3 -- import qualified Data.Text.Lazy as DTL
4 import Data.Text
5 import Opaleye (Column, PGInt4)
6
7 -- | Simple function to count Occurrences in a context of text.
8 occOfDocument :: Column PGInt4 -> Text -> IO Int
9 occOfDocument = undefined
10 --occOfDocument c_id txt = do
11 -- docs <- pm (hyperdataDocument_Abstract . node_hyperdata) <$> getCorpusDocument c_id
12 -- let occs = pm (\x -> maybe "" identity x) docs
13 -- let result = case sequence $ pm (parseOccurrences txt) occs of
14 -- -- TODO find a way to get nice message d'errors (file, function, line)
15 -- Left str -> error $ "[ERRROR] at file/function/line" ++ str
16 -- Right xs -> xs
17 -- pure (sum result)