Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
4a70c663
Commit
4a70c663
authored
Jun 24, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://gitlab.iscpif.fr:20022/gargantext/haskell-gargantext
parents
9920b17c
352e1f2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
Metrics.hs
src/Gargantext/Text/Metrics.hs
+2
-0
FrequentItemSet.hs
src/Gargantext/Text/Metrics/FrequentItemSet.hs
+7
-0
No files found.
src/Gargantext/Text/Metrics.hs
View file @
4a70c663
...
...
@@ -122,6 +122,8 @@ data Scored t = Scored { _scored_terms :: !t
,
_scored_speGen
::
!
SpecificityGenericity
}
deriving
(
Show
)
-- TODO in the textflow we end up needing these indices, it might be better
-- to compute them earlier and pass them around.
coocScored
::
Ord
t
=>
Map
(
t
,
t
)
Int
->
[
Scored
t
]
coocScored
m
=
zipWith
(
\
(
i
,
t
)
(
inc
,
spe
)
->
Scored
t
inc
spe
)
(
M
.
toList
fi
)
scores
where
...
...
src/Gargantext/Text/Metrics/FrequentItemSet.hs
View file @
4a70c663
...
...
@@ -21,6 +21,7 @@ module Gargantext.Text.Metrics.FrequentItemSet
,
fisWith
,
fisWithSizePoly
,
fisWithSizePoly2
,
fisWithSizePolyMap
,
module
HLCM
)
where
...
...
@@ -91,8 +92,10 @@ fisWithSize n f is = case n of
cond
a'
x
b'
=
a'
<=
x
&&
x
<=
b'
--- 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
-- drop unMaybe
where
filter'
=
case
s
of
Nothing
->
identity
...
...
@@ -113,6 +116,10 @@ fisWithSizePoly2 n f is = fisWithSizePoly n f ks is
where
ks
=
Set
.
fromList
$
concat
is
fisWithSizePolyMap
::
Ord
a
=>
Size
->
Frequency
->
[[
a
]]
->
Map
(
Set
a
)
Int
fisWithSizePolyMap
n
f
is
=
Map
.
fromList
$
(
\
i
->
(
Set
.
fromList
(
_fisItemSet
i
),
_fisCount
i
))
<$>
fisWithSizePoly2
n
f
is
------------------------------------------------------------------------
------------------------------------------------------------------------
...
...
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