fstrelabel

fstrelabel relabels input and output symbols of a given fst. To use the command you provide a file containing numeric pairs.
for relabeling input symbols: fstrelabel -relabel_ipairs=isyms.txt filename.fst
for relabeling output symbols: fstrelabel -relabel_opairs=osyms.txt filename.fst

Given the following L.fst (using fstdraw):
fst

We can create a new text file containing numeric pairs representing relabeling. For example, the isyms.txt file used below looks like this:

3        1

Indicating inputs of 3 should be relabeled to inputs of 1. After running fstrelabel we have:
fst2

As you can see, the inputs of 3 in the original fst have been changed to inputs of 1. We can then run fstrelabel again to change the output symbols using osyms.txt which contains the same information as isyms.txt. The output produced is:
L3

 

One thought on “fstrelabel

Leave a Reply