3

I'm using the method linear_chain to accept a String. When I convert it into a fst binary to then into a DOT format, I get integers instead of the characters. Also, I have a SymbolTable for each of the corresponding letters being read.

What I need is to show the characters instead, be by the command line or by coding directly in Python. Any help or reference would be greatly appreciated.

two7s_clash
  • 5,755
  • 1
  • 27
  • 44
  • Welcome to stackoverflow. This question would be vastly improved by providing the literal for the value you want to convert (just call `repr(value)` and post it here). – Paulo Scardine Sep 28 '16 at 23:47
  • Greeting @Paulo, just learned something new, thank you. Here you go, `` – DoritoDewBoop Sep 28 '16 at 23:55
  • OK, I was expecting something like a list of integers. :-) I would like to reproduce your problem - I know a lot about ETL but nothing about openfst. Could you edit your question in order to include a small, self-contained and reproducible example of the input you got and expected output? – Paulo Scardine Sep 29 '16 at 00:13

1 Answers1

1

To do this on the command line, make sure you provide both an input and output symbol table. The command should be something like

fstdraw --isymbols=input_syms.txt --osymbols=output_syms.txt fst.bin

I haven't used "PyFST", but I would suggest you use the Python bindings that are included in OpenFst 1.5.1 and later. The Python support has been getting better in versions 1.5.x, so it's best to use 1.5.3 or later.

If using the OpenFST provided Python bindings, make sure you set the symbol tables before attempting to draw.

fst.input_symbols = your_symbol_table
fst.output_symbols = your_symbol_table
fst.draw("fst.dot")

There is more documentation for these Python bindings available here: http://www.openfst.org/twiki/bin/view/FST/PythonExtension

If that doesn't help, could you post some example code please?

blambert
  • 1,340
  • 13
  • 19