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
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
Grégoire Locqueville
haskell-gargantext
Commits
25a14cb2
Commit
25a14cb2
authored
Mar 21, 2024
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/adinapoli/issue-ps-632-phylo-unicode' into dev
parents
574631df
1a1ff4a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
gargantext.cabal
gargantext.cabal
+2
-0
PhyloExport.hs
src/Gargantext/Core/Viz/Phylo/PhyloExport.hs
+1
-1
Phylo.hs
test/Test/Offline/Phylo.hs
+18
-0
No files found.
gargantext.cabal
View file @
25a14cb2
...
...
@@ -896,6 +896,7 @@ test-suite garg-test-tasty
, fmt
, gargantext
, gargantext-prelude
, graphviz ^>= 2999.20.1.0
, hspec ^>= 2.7.10
, hspec-core
, hspec-expectations >= 0.8 && < 0.9
...
...
@@ -942,6 +943,7 @@ test-suite garg-test-tasty
, tree-diff
, unordered-containers ^>= 0.2.16.0
, validity ^>= 0.11.0.1
, vector ^>= 0.12.3.0
, wai
, wai-extra
, warp
...
...
src/Gargantext/Core/Viz/Phylo/PhyloExport.hs
View file @
25a14cb2
...
...
@@ -125,7 +125,7 @@ groupToDotNode fdt g bId =
,
toAttr
"sourceFull"
(
show
(
g
^.
phylo_groupSources
))
,
toAttr
"density"
(
show
(
g
^.
phylo_groupDensity
))
,
toAttr
"cooc"
(
show
(
g
^.
phylo_groupCooc
))
,
toAttr
"lbl"
(
show
(
ngramsToLabel
fdt
(
g
^.
phylo_groupNgrams
)
))
,
toAttr
"lbl"
(
Lazy
.
fromStrict
$
ngramsToLabel
fdt
(
g
^.
phylo_groupNgrams
))
,
toAttr
"foundation"
(
show
(
idxToLabel
(
g
^.
phylo_groupNgrams
)))
,
toAttr
"role"
(
show
(
idxToLabel'
((
g
^.
phylo_groupMeta
)
!
"dynamics"
)))
,
toAttr
"frequence"
(
show
(
idxToLabel'
((
g
^.
phylo_groupMeta
)
!
"frequence"
)))
...
...
test/Test/Offline/Phylo.hs
View file @
25a14cb2
...
...
@@ -5,14 +5,18 @@
module
Test.Offline.Phylo
(
tests
)
where
import
Data.GraphViz.Attributes.Complete
qualified
as
Graphviz
import
Data.Vector
qualified
as
V
import
Gargantext.Core.Viz.Phylo
import
Gargantext.Core.Viz.Phylo.API.Tools
(
readPhylo
,
writePhylo
)
import
Gargantext.Core.Viz.Phylo.PhyloExport
import
Gargantext.Core.Viz.Phylo.PhyloMaker
(
toPhylo
)
import
Gargantext.Core.Viz.Phylo.PhyloTools
import
Prelude
import
Test.Tasty
import
Test.Tasty.HUnit
import
Test.Tasty.QuickCheck
import
Data.Text.Lazy
as
TL
import
Paths_gargantext
...
...
@@ -43,6 +47,10 @@ phyloConfig = PhyloConfig {
tests
::
TestTree
tests
=
testGroup
"Phylo"
[
-- testCase "returns expected data" testSmallPhyloExpectedOutput
testGroup
"Export"
[
testCase
"ngramsToLabel respects encoding"
test_ngramsToLabel_01
,
testCase
"ngramsToLabel is rendered correctly in CustomAttribute"
test_ngramsToLabel_02
]
]
testSmallPhyloExpectedOutput
::
Assertion
...
...
@@ -51,3 +59,13 @@ testSmallPhyloExpectedOutput = do
expected
<-
readPhylo
=<<
getDataFileName
"test-data/phylo/issue-290-small.golden.json"
let
actual
=
toPhylo
issue290PhyloSmall
expected
@?=
actual
test_ngramsToLabel_01
::
Assertion
test_ngramsToLabel_01
=
let
ngrams
=
V
.
fromList
[
"évaluation"
,
"méthodologique"
]
in
ngramsToLabel
ngrams
[
0
,
1
]
@?=
"évaluation | méthodologique"
test_ngramsToLabel_02
::
Assertion
test_ngramsToLabel_02
=
let
ngrams
=
V
.
fromList
[
"钱"
,
"狗"
]
in
(
Graphviz
.
customValue
$
toAttr
"lbl"
$
TL
.
fromStrict
$
ngramsToLabel
ngrams
[
0
,
1
])
@?=
"钱 | 狗"
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