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
10
Merge Requests
10
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
aae49548
Unverified
Commit
aae49548
authored
Jun 06, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eleve: fix bwd check
parent
ffbf9ea6
Pipeline
#437
canceled with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Eleve.hs
src/Gargantext/Text/Eleve.hs
+4
-3
No files found.
src/Gargantext/Text/Eleve.hs
View file @
aae49548
...
...
@@ -95,7 +95,7 @@ isTerminal (Terminal _) = True
isTerminal
(
NonTerminal
_
)
=
False
toToken
::
Int
->
[
Text
]
->
[
Token
]
toToken
n
xs
=
Terminal
Start
:
(
NonTerminal
<$>
xs
)
<>
L
.
take
n
(
repeat
$
Terminal
Stop
)
toToken
n
xs
=
Terminal
Start
:
(
NonTerminal
<$>
xs
)
<>
[
Terminal
Stop
]
unToken
::
[
Token
]
->
[
Text
]
unToken
=
map
f
...
...
@@ -369,13 +369,14 @@ testEleve debug n output checks = do
else
P
.
putStrLn
$
" FAIL "
<>
msg
<>
" "
<>
show
x
<>
" /= "
<>
show
y
checker
(
ngram
,
count
,
entropy
,
_ev
,
autonomy
,
bwd_entropy
,
fwd_entropy
)
=
do
let
t'
=
findTrie
(
NonTerminal
<$>
T
.
words
ngram
)
nt
let
ns
=
NonTerminal
<$>
T
.
words
ngram
t'
=
findTrie
ns
nt
P
.
putStrLn
$
" "
<>
T
.
unpack
ngram
<>
":"
check
(
==
)
"count"
count
(
_node_count
(
_fwd
t'
))
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
(
_bwd
t'
))
check
sim
"bwd_entropy"
bwd_entropy
(
nodeEntropy
info_entropy
(
findTrie
ns
(
_bwd
nt
)
))
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