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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
5a332bda
Commit
5a332bda
authored
Mar 22, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TYPING] Diagnoal option clearer.
parent
3d05ad43
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+2
-2
Node.hs
src/Gargantext/API/Node.hs
+1
-1
Metrics.hs
src/Gargantext/Database/Metrics.hs
+2
-2
List.hs
src/Gargantext/Text/List.hs
+1
-1
Metrics.hs
src/Gargantext/Text/Metrics.hs
+3
-3
No files found.
src/Gargantext/API/Ngrams/Tools.hs
View file @
5a332bda
...
@@ -84,10 +84,10 @@ groupNodesByNgrams syn occs = Map.fromListWith (<>) occs'
...
@@ -84,10 +84,10 @@ groupNodesByNgrams syn occs = Map.fromListWith (<>) occs'
Nothing
->
(
t
,
ns
)
Nothing
->
(
t
,
ns
)
Just
r'
->
(
r'
,
ns
)
Just
r'
->
(
r'
,
ns
)
type
Diagonal
=
Bool
data
Diagonal
=
Diagonal
Bool
getCoocByNgrams
::
Diagonal
->
Map
Text
(
Set
NodeId
)
->
Map
(
Text
,
Text
)
Int
getCoocByNgrams
::
Diagonal
->
Map
Text
(
Set
NodeId
)
->
Map
(
Text
,
Text
)
Int
getCoocByNgrams
diag
m
=
getCoocByNgrams
(
Diagonal
diag
)
m
=
Map
.
fromList
[((
t1
,
t2
)
Map
.
fromList
[((
t1
,
t2
)
,
maybe
0
Set
.
size
$
Set
.
intersection
,
maybe
0
Set
.
size
$
Set
.
intersection
<$>
Map
.
lookup
t1
m
<$>
Map
.
lookup
t1
m
...
...
src/Gargantext/API/Node.hs
View file @
5a332bda
...
@@ -290,7 +290,7 @@ graphAPI nId = do
...
@@ -290,7 +290,7 @@ graphAPI nId = do
lId
<-
defaultList
cId
lId
<-
defaultList
cId
ngs
<-
filterListWithRoot
GraphTerm
<$>
mapTermListRoot
[
lId
]
NgramsTerms
ngs
<-
filterListWithRoot
GraphTerm
<$>
mapTermListRoot
[
lId
]
NgramsTerms
myCooc
<-
Map
.
filter
(
>
1
)
<$>
getCoocByNgrams
False
myCooc
<-
Map
.
filter
(
>
1
)
<$>
getCoocByNgrams
(
Diagonal
False
)
<$>
groupNodesByNgrams
ngs
<$>
groupNodesByNgrams
ngs
<$>
getNodesByNgramsOnlyUser
cId
NgramsTerms
(
Map
.
keys
ngs
)
<$>
getNodesByNgramsOnlyUser
cId
NgramsTerms
(
Map
.
keys
ngs
)
...
...
src/Gargantext/Database/Metrics.hs
View file @
5a332bda
...
@@ -28,7 +28,7 @@ import Gargantext.Database.Metrics.NgramsByNode (getNodesByNgramsOnlyUser)
...
@@ -28,7 +28,7 @@ import Gargantext.Database.Metrics.NgramsByNode (getNodesByNgramsOnlyUser)
import
Gargantext.Database.Schema.Node
(
defaultList
)
import
Gargantext.Database.Schema.Node
(
defaultList
)
import
Gargantext.Database.Types.Node
(
ListId
,
CorpusId
)
import
Gargantext.Database.Types.Node
(
ListId
,
CorpusId
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Text.Metrics
import
Gargantext.Text.Metrics
(
scored
,
Scored
(
..
))
import
Servant
(
ServantErr
)
import
Servant
(
ServantErr
)
import
qualified
Data.Map
as
Map
import
qualified
Data.Map
as
Map
...
@@ -51,7 +51,7 @@ getMetrics' cId maybeListId tabType maybeLimit = do
...
@@ -51,7 +51,7 @@ getMetrics' cId maybeListId tabType maybeLimit = do
take'
Nothing
xs
=
xs
take'
Nothing
xs
=
xs
take'
(
Just
n
)
xs
=
take
n
xs
take'
(
Just
n
)
xs
=
take
n
xs
myCooc
<-
Map
.
filter
(
>
1
)
<$>
getCoocByNgrams
True
myCooc
<-
Map
.
filter
(
>
1
)
<$>
getCoocByNgrams
(
Diagonal
True
)
<$>
groupNodesByNgrams
ngs
<$>
groupNodesByNgrams
ngs
<$>
getNodesByNgramsOnlyUser
cId
ngramsType
(
take'
maybeLimit
$
Map
.
keys
ngs
)
<$>
getNodesByNgramsOnlyUser
cId
ngramsType
(
take'
maybeLimit
$
Map
.
keys
ngs
)
...
...
src/Gargantext/Text/List.hs
View file @
5a332bda
...
@@ -100,7 +100,7 @@ toTermList stop ns = map (toTermList' stop CandidateTerm) xs
...
@@ -100,7 +100,7 @@ toTermList stop ns = map (toTermList' stop CandidateTerm) xs
ys
=
take
b
$
drop
a
ns
ys
=
take
b
$
drop
a
ns
zs
=
drop
b
$
drop
a
ns
zs
=
drop
b
$
drop
a
ns
a
=
10
a
=
3
b
=
400
b
=
400
isStopTerm
::
Text
->
Bool
isStopTerm
::
Text
->
Bool
...
...
src/Gargantext/Text/Metrics.hs
View file @
5a332bda
...
@@ -76,10 +76,10 @@ scored2map m = Map.fromList $ map (\(Scored t i s) -> (t, Vec.fromList [i,s])) $
...
@@ -76,10 +76,10 @@ scored2map m = Map.fromList $ map (\(Scored t i s) -> (t, Vec.fromList [i,s])) $
map2scored
::
Ord
t
=>
Map
t
(
Vec
.
Vector
Double
)
->
[
Scored
t
]
map2scored
::
Ord
t
=>
Map
t
(
Vec
.
Vector
Double
)
->
[
Scored
t
]
map2scored
=
map
(
\
(
t
,
ds
)
->
Scored
t
(
Vec
.
head
ds
)
(
Vec
.
last
ds
))
.
Map
.
toList
map2scored
=
map
(
\
(
t
,
ds
)
->
Scored
t
(
Vec
.
head
ds
)
(
Vec
.
last
ds
))
.
Map
.
toList
-- TODO in the textflow we end up needing these indices
, it might be better
-- TODO in the textflow we end up needing these indices
, it might be
-- to compute them earlier and pass them around.
--
better
to compute them earlier and pass them around.
scored'
::
Ord
t
=>
Map
(
t
,
t
)
Int
->
[
Scored
t
]
scored'
::
Ord
t
=>
Map
(
t
,
t
)
Int
->
[
Scored
t
]
scored'
m
=
zipWith
(
\
(
_
,
t
)
(
inc
,
spe
)
->
Scored
t
inc
spe
)
(
Map
.
toList
fi
)
scores
scored'
m
=
zipWith
(
\
(
_
,
t
)
(
inc
,
spe
)
->
Scored
t
(
inc
)
(
spe
)
)
(
Map
.
toList
fi
)
scores
where
where
(
ti
,
fi
)
=
createIndices
m
(
ti
,
fi
)
=
createIndices
m
(
is
,
ss
)
=
incExcSpeGen
$
cooc2mat
ti
m
(
is
,
ss
)
=
incExcSpeGen
$
cooc2mat
ti
m
...
...
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