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
9
Merge Requests
9
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
8d15e43f
Unverified
Commit
8d15e43f
authored
Jun 06, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eleve...
parent
151e8522
Pipeline
#442
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Eleve.hs
src/Gargantext/Text/Eleve.hs
+8
-4
No files found.
src/Gargantext/Text/Eleve.hs
View file @
8d15e43f
...
...
@@ -209,8 +209,9 @@ class IsTrie trie where
=>
Getting
e
i
e
->
ModEntropy
i
o
e
->
trie
k
i
->
trie
k
o
nodeAutonomy
::
(
Ord
k
,
Entropy
e
)
=>
Getting
e
i
e
->
trie
k
i
->
[
k
]
->
e
nodeAutonomy
inE
t
ks
=
nodeEntropy
inE
$
findTrie
ks
t
-- UNUSED
--nodeAutonomy :: (Ord k, Entropy e) => Getting e i e -> trie k i -> [k] -> e
--nodeAutonomy inE t ks = nodeEntropy inE $ findTrie ks t
instance
IsTrie
Trie
where
buildTrie
=
entropyTrie
isTerminal
.
insertTries
...
...
@@ -275,7 +276,10 @@ instance IsTrie Tries where
nodeEntropy
inE
(
Tries
fwd
bwd
)
=
mean
$
noNaNs
[
nodeEntropy
inE
fwd
,
nodeEntropy
inE
bwd
]
findTrie
ks
(
Tries
fwd
bwd
)
=
Tries
(
findTrie
ks
fwd
)
(
findTrie
(
reverse
ks
)
bwd
)
findTrie
ks
(
Tries
fwd
bwd
)
=
Tries
(
findTrie
ks
fwd
)
(
findTrie
ks
bwd
)
-- ^^
-- TODO: here this is tempting to reverse but this is not always what we
-- want. See also nodeAutonomy.
nodeChild
k
(
Tries
fwd
bwd
)
=
Tries
(
nodeChild
k
fwd
)
(
nodeChild
k
bwd
)
...
...
@@ -389,7 +393,7 @@ testEleve debug n output checks = do
check
sim
"entropy"
entropy
(
nodeEntropy
info_entropy
t'
)
check
sim
"autonomy"
autonomy
(
nodeEntropy
info_autonomy
t'
)
check
sim
"fwd_entropy"
fwd_entropy
(
nodeEntropy
info_entropy
(
_fwd
t'
))
check
sim
"bwd_entropy"
bwd_entropy
(
nodeEntropy
info_entropy
(
findTrie
ns
(
_bwd
nt
)
))
check
sim
"bwd_entropy"
bwd_entropy
(
nodeEntropy
info_entropy
(
_bwd
t'
))
printTrie
=
P
.
putStrLn
.
Tree
.
drawTree
...
...
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