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
0c9ed01c
Commit
0c9ed01c
authored
Oct 01, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PHYLO] FIS added.
parent
c430654e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
package.yaml
package.yaml
+2
-1
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 @
0c9ed01c
...
...
@@ -111,7 +111,8 @@ library:
-
path
-
path-io
-
postgresql-simple
-
pretty
-
pretty-simple
-
probability
-
product-profunctors
-
profunctors
-
protolude
...
...
src/Gargantext/Text/Metrics/FrequentItemSet.hs
View file @
0c9ed01c
...
...
@@ -33,7 +33,7 @@ import qualified Data.Set as Set
import
Data.Set
(
Set
)
import
qualified
Data.Vector
as
V
import
Data.List
(
filter
,
concat
)
import
Data.List
(
filter
,
concat
,
null
)
import
Data.Maybe
(
catMaybes
)
import
HLCM
...
...
@@ -93,7 +93,9 @@ fisWithSize n f is = case n of
--- Filter on Fis and not on [Item]
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
where
filter'
=
case
s
of
...
...
src/Gargantext/Viz/Phylo/Example.hs
View file @
0c9ed01c
...
...
@@ -10,13 +10,16 @@ module Gargantext.Viz.Phylo.Example where
import
qualified
Data.List
as
DL
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.Map
(
Map
)
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
------------------------------------------------------------------------
...
...
@@ -24,11 +27,21 @@ type Histoire = [Event]
data
Event
=
Event
{
date
::
Double
,
text
::
Text
}
deriving
(
Show
)
type
MapList
=
[
Text
]
type
PeriodeSize
=
Int
-- 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
_
_
[]
=
panic
$
pack
"Empty history can not have any periode"
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