]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Pipeline.hs
[Types] Phylo
[gargantext.git] / src / Gargantext / Pipeline.hs
1 {-|
2 Module : Gargantext.Pipeline
3 Description : Server API
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 -}
11
12 {-# OPTIONS_GHC -fno-warn-name-shadowing #-}
13
14 {-# LANGUAGE NoImplicitPrelude #-}
15
16 module Gargantext.Pipeline
17 where
18
19
20 import Data.Text.IO (readFile)
21
22 import Gargantext.Core
23 import Gargantext.Prelude
24
25 import Gargantext.Text.Metrics.Occurrences
26 import Gargantext.Text.Terms
27 import Gargantext.Text.Context
28
29
30 pipeline pth = do
31 text <- readFile pth
32 let contexts = splitBy Sentences 4 text
33 cooc <$> map occurrences <$> mapM (terms Mono FR) contexts
34 -- todo
35 -- Cooc map -> Matrix
36 -- distributional or conditional
37 -- Matrix -> Graph
38