Input/output

FiniteStateTransducers.txt2fstFunction

txt2fst(path_or_text,isym[,osym];W=TropicalWeight{Float32})

Loads a WFST from a text file using OpenFST format.

isym and osym can be either dictionaries or paths to the input/output symbol list.

If path_or_text is not a path, the input string is parsed directly.

julia> txt2fst("0 1 a a 3.0
       1 2 b <eps> 77.0
       2 3 c <eps> 33.0
       3 4 d d 44.0
       4 90.0
       ",Dict("a"=>1,"b"=>2,"c"=>3,"d"=>4))
WFST #states: 5, #arcs: 4, #isym: 4, #osym: 4
|1/0.0f0|
a:a/3.0f0 → (2)
(2)
b:ϵ/77.0f0 → (3)
(3)
c:ϵ/33.0f0 → (4)
(4)
d:d/44.0f0 → (5)
((5/90.0f0))
source