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
198
Issues
198
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
fbc34579
Commit
fbc34579
authored
Oct 01, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
[FIX] pretty print fix.
parents
11a8797b
0c9ed01c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
package.yaml
package.yaml
+1
-0
FrequentItemSet.hs
src/Gargantext/Text/Metrics/FrequentItemSet.hs
+4
-2
Example.hs
src/Gargantext/Viz/Phylo/Example.hs
+15
-2
No files found.
package.yaml
View file @
fbc34579
...
@@ -115,6 +115,7 @@ library:
...
@@ -115,6 +115,7 @@ library:
-
path
-
path
-
path-io
-
path-io
-
postgresql-simple
-
postgresql-simple
-
pretty-simple
-
probability
-
probability
-
product-profunctors
-
product-profunctors
-
profunctors
-
profunctors
...
...
src/Gargantext/Text/Metrics/FrequentItemSet.hs
View file @
fbc34579
...
@@ -33,7 +33,7 @@ import qualified Data.Set as Set
...
@@ -33,7 +33,7 @@ import qualified Data.Set as Set
import
Data.Set
(
Set
)
import
Data.Set
(
Set
)
import
qualified
Data.Vector
as
V
import
qualified
Data.Vector
as
V
import
Data.List
(
filter
,
concat
)
import
Data.List
(
filter
,
concat
,
null
)
import
Data.Maybe
(
catMaybes
)
import
Data.Maybe
(
catMaybes
)
import
HLCM
import
HLCM
...
@@ -93,7 +93,9 @@ fisWithSize n f is = case n of
...
@@ -93,7 +93,9 @@ fisWithSize n f is = case n of
--- Filter on Fis and not on [Item]
--- Filter on Fis and not on [Item]
fisWith
::
Maybe
([
Item
]
->
Bool
)
->
Frequency
->
[[
Item
]]
->
[
Fis
]
fisWith
::
Maybe
([
Item
]
->
Bool
)
->
Frequency
->
[[
Item
]]
->
[
Fis
]
fisWith
s
f
is
=
catMaybes
$
map
items2fis
$
filter'
$
runLCMmatrix
is
f
fisWith
s
f
is
=
case
filter
(
not
.
null
)
is
of
[]
->
[]
js
->
catMaybes
$
map
items2fis
$
filter'
$
runLCMmatrix
js
f
-- drop unMaybe
-- drop unMaybe
where
where
filter'
=
case
s
of
filter'
=
case
s
of
...
...
src/Gargantext/Viz/Phylo/Example.hs
View file @
fbc34579
...
@@ -10,13 +10,16 @@ module Gargantext.Viz.Phylo.Example where
...
@@ -10,13 +10,16 @@ module Gargantext.Viz.Phylo.Example where
import
qualified
Data.List
as
DL
import
qualified
Data.List
as
DL
import
Data.String
(
String
)
import
Data.String
(
String
)
import
Data.Text
(
Text
,
pack
,
unwords
,
toLower
)
import
Data.Text
(
Text
,
pack
,
unwords
,
toLower
,
words
)
import
Data.Tuple.Extra
(
both
)
import
Data.Tuple.Extra
(
both
)
import
Data.Map
(
Map
)
import
Data.Map
(
Map
)
import
qualified
Data.Map
as
DM
import
qualified
Data.Map
as
DM
import
Gargantext.Text.Terms.Mono
(
monoTexts
)
import
Data.Set
(
Set
)
import
Gargantext.Text.Metrics.FrequentItemSet
(
fisWithSizePolyMap
,
Size
(
..
))
import
Gargantext.Text.Terms.Mono
(
monoTexts
)
import
Gargantext.Prelude
import
Gargantext.Prelude
------------------------------------------------------------------------
------------------------------------------------------------------------
...
@@ -24,11 +27,21 @@ type Histoire = [Event]
...
@@ -24,11 +27,21 @@ type Histoire = [Event]
data
Event
=
Event
{
date
::
Double
,
text
::
Text
}
data
Event
=
Event
{
date
::
Double
,
text
::
Text
}
deriving
(
Show
)
deriving
(
Show
)
type
MapList
=
[
Text
]
type
MapList
=
[
Text
]
type
PeriodeSize
=
Int
type
PeriodeSize
=
Int
-- data Periodes b a = Map (b,b) a
-- data Periodes b a = Map (b,b) a
------------------------------------------------------------------------
------------------------------------------------------------------------
-- | TODO FIS on monotexts
phyloFIS
::
Map
(
Double
,
Double
)
[
Event
]
->
Map
(
Double
,
Double
)
(
Map
(
Set
Text
)
Int
)
phyloFIS
=
DM
.
map
(
\
n
->
fisWithSizePolyMap
(
Point
1
)
1
(
map
(
words
.
text
)
n
))
phyloExample
::
Map
(
Double
,
Double
)
[
Event
]
phyloExample
=
toPeriodes
date
1
$
cleanHistoire
mapList
phyloCorpus
------------------------------------------------------------------------
toPeriodes
::
(
Enum
b
,
Fractional
b
,
Ord
b
)
=>
(
t
->
b
)
->
b
->
[
t
]
->
Map
(
b
,
b
)
[
t
]
toPeriodes
::
(
Enum
b
,
Fractional
b
,
Ord
b
)
=>
(
t
->
b
)
->
b
->
[
t
]
->
Map
(
b
,
b
)
[
t
]
toPeriodes
_
_
[]
=
panic
$
pack
"Empty history can not have any periode"
toPeriodes
_
_
[]
=
panic
$
pack
"Empty history can not have any periode"
toPeriodes
f
s
hs
=
periodes
f
st
hs
toPeriodes
f
s
hs
=
periodes
f
st
hs
...
...
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