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
177
Issues
177
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
48e8772e
Commit
48e8772e
authored
Jun 07, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Ngrams][DOC] Comments.
parent
fc806c34
Pipeline
#447
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Eleve.hs
src/Gargantext/Text/Eleve.hs
+5
-3
No files found.
src/Gargantext/Text/Eleve.hs
View file @
48e8772e
...
...
@@ -44,6 +44,7 @@ module Gargantext.Text.Eleve where
import
Debug.Trace
(
trace
)
-- import Debug.SimpleReflect
import
Data.Functor.Reverse
import
Control.Lens
(
Lens
'
,
Getting
,
(
^.
),
(
^?
),
view
,
makeLenses
,
_Just
,
under
,
reversed
)
import
Control.Monad
(
forM_
)
import
Data.Ord
(
Ord
)
...
...
@@ -223,8 +224,7 @@ instance IsTrie Trie where
buildTrie
to
n
ts
=
entropyTrie
isTerminal
$
insertTries
$
to
n
ts
nodeEntropy
inE
(
Node
_
e
_
)
=
e
^.
inE
nodeEntropy
_
(
Leaf
_
)
=
-- trace "nodeEntropy of Leaf" $
nan
nodeEntropy
_
(
Leaf
_
)
=
nan
nodeChild
k
(
Node
_
_
cs
)
=
fromMaybe
emptyTrie
(
Map
.
lookup
k
cs
)
nodeChild
_
(
Leaf
_
)
=
emptyTrie
...
...
@@ -291,6 +291,8 @@ instance IsTrie Tries where
-- ^^
-- TODO: here this is tempting to reverse but this is not always what we
-- want. See also nodeAutonomy.
-- AD: I also tried to reverse here and I confirm getting unexpected results (whereas VETODO is ok)
-- since recursivity of the function makes the reverse multiple times (I guess)
nodeChild
k
(
Tries
fwd
bwd
)
=
Tries
(
nodeChild
k
fwd
)
(
nodeChild
k
bwd
)
...
...
@@ -412,7 +414,7 @@ testEleve debug n output checks = do
t'
=
findTrie
ns
nt
nsb
=
parseToken
<$>
(
reverse
$
T
.
words
ngram
)
tb'
=
findTrie
nsb
nt
-- TODO put this Variation Entropy at VETODO mark above
-- TODO put this Variation Entropy at VETODO mark above
maybe in nodeEntropy ?
ev
=
(
mean
[(
nodeEntropy
info_entropy
(
_fwd
t'
)),
(
nodeEntropy
info_entropy
(
_bwd
tb'
))])
P
.
putStrLn
$
" "
<>
T
.
unpack
ngram
<>
":"
...
...
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