Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
147
Issues
147
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
eade2d55
Commit
eade2d55
authored
May 28, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] adding pipeline.
parent
2cdbaa72
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
6 deletions
+55
-6
Main.hs
app/Main.hs
+0
-1
Gargantext.hs
src/Gargantext.hs
+6
-0
Types.hs
src/Gargantext/Core/Types.hs
+3
-1
Pipeline.hs
src/Gargantext/Pipeline.hs
+38
-0
Prelude.hs
src/Gargantext/Prelude.hs
+1
-1
Occurrences.hs
src/Gargantext/Text/Metrics/Occurrences.hs
+0
-3
Graph.hs
src/Gargantext/Viz/Graph.hs
+7
-0
No files found.
app/Main.hs
View file @
eade2d55
...
...
@@ -7,7 +7,6 @@ Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
<<<<<<< HEAD
Script to start gargantext with different modes (Dev, Prod, Mock).
-}
...
...
src/Gargantext.hs
View file @
eade2d55
...
...
@@ -19,3 +19,9 @@ module Gargantext (
import
Gargantext.Database
-- import Gargantext.Ngrams
-- import Gargantext.Utils
src/Gargantext/Core/Types.hs
View file @
eade2d55
...
...
@@ -42,8 +42,10 @@ type Label = [Text]
data
Terms
=
Terms
{
_terms_label
::
Label
,
_terms_stem
::
Stems
}
deriving
(
Show
,
Ord
)
}
deriving
(
Ord
)
instance
Show
Terms
where
show
(
Terms
l
s
)
=
show
l
-- class Inclusion where include
--instance Eq Terms where
-- (==) (Terms _ s1) (Terms _ s2) = s1 `S.isSubsetOf` s2
...
...
src/Gargantext/Pipeline.hs
0 → 100644
View file @
eade2d55
{-|
Module : Gargantext.Pipeline
Description : Server API
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE NoImplicitPrelude #-}
module
Gargantext.Pipeline
where
import
Data.Text.IO
(
readFile
)
import
Gargantext.Core
import
Gargantext.Prelude
import
Gargantext.Text.Metrics.Occurrences
import
Gargantext.Text.Terms
import
Gargantext.Text.Context
pipeline
pth
=
do
text
<-
readFile
pth
let
contexts
=
splitBy
Sentences
4
text
cooc
<$>
map
occurrences
<$>
mapM
(
terms
Mono
FR
)
contexts
-- todo
-- Cooc map -> Matrix
-- distributional or conditional
-- Matrix -> Graph
src/Gargantext/Prelude.hs
View file @
eade2d55
...
...
@@ -36,7 +36,7 @@ import Protolude ( Bool(True, False), Int, Double, Integer
,
putStrLn
,
head
,
flip
,
Ord
,
Integral
,
Foldable
,
RealFrac
,
Monad
,
filter
,
reverse
,
map
,
zip
,
drop
,
take
,
zipWith
,
reverse
,
map
,
mapM
,
zip
,
drop
,
take
,
zipWith
,
sum
,
fromIntegral
,
length
,
fmap
,
foldl
,
foldl'
,
takeWhile
,
sqrt
,
undefined
,
identity
,
abs
,
min
,
max
,
maximum
,
minimum
,
return
,
snd
,
truncate
...
...
src/Gargantext/Text/Metrics/Occurrences.hs
View file @
eade2d55
...
...
@@ -43,9 +43,7 @@ import Data.Attoparsec.Text
------------------------------------------------------------------------
import
Gargantext.Prelude
import
Gargantext.Core.Types
------------------------------------------------------------------------
type
Occ
a
=
Map
a
Int
type
Cooc
a
=
Map
(
a
,
a
)
Int
type
FIS
a
=
Map
(
Set
a
)
Int
...
...
@@ -68,7 +66,6 @@ type Grouped = Stems
--fromList [((fromList ["blue"],fromList ["lagoon"]),2),((fromList ["lagoon"],fromList ["red"]),2)]
----
cooc
::
(
Ord
b
,
Num
a
)
=>
[
Map
b
a
]
->
Map
(
b
,
b
)
a
cooc
ts
=
cooc'
$
map
cooc''
ts
...
...
src/Gargantext/Viz/Graph.hs
View file @
eade2d55
...
...
@@ -58,3 +58,10 @@ $(deriveJSON (unPrefix "g_") ''Graph)
-----------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment