From 59df068bf4355e8aec2d3a37f88734565135a079 Mon Sep 17 00:00:00 2001 From: Lucas ONDEL YANG <lucas.ondel@cnrs.fr> Date: Thu, 13 Apr 2023 13:15:35 +0200 Subject: [PATCH] changed graphviz display --- src/abstractfsa.jl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/abstractfsa.jl b/src/abstractfsa.jl index 4330d55..669d9a8 100644 --- a/src/abstractfsa.jl +++ b/src/abstractfsa.jl @@ -162,7 +162,11 @@ function dot_write_nodes(io::IO, T, ω, Ï, λ) for i in 1:size(T, 1) if ! iszero(ω[i]) - print(io, "$(i) [label=\"$i/", ω[i], "\", shape=\"doublecircle\"];") + if isone(ω[i]) + print(io, "$(i) [label=\"$i\", shape=\"doublecircle\"];") + else + print(io, "$(i) [label=\"$i/", ω[i], "\", shape=\"doublecircle\"];") + end end end end @@ -187,7 +191,10 @@ function dot_write_edges(io, T, Ï, λ) end function dot_write_edge(io, src, dst, label, weight) - val = typeof(weight) <: AbstractFloat ? round(weight, digits=3) : weight - print(io, "$src -> $dst [label=\"", label, "/", weight, "\"];") + if isone(weight) + print(io, "$src -> $dst [label=\"", label, "\"];") + else + print(io, "$src -> $dst [label=\"", label, "/", weight, "\"];") + end end -- GitLab