Closed kalvinchang closed 3 years ago
Currently, I am determining if a state is an accepting state with the following: fsa.final(state) == pynini.Weight.one('tropical')
fsa.final(state) == pynini.Weight.one('tropical')
However, this approach is flawed if we set the weight of a state to 1. Is there a better way of figuring out if a state is accepting or not?
Why not just:
def accepting(fst: pynini.Fst, state: int) -> bool: return fst.final(state) != pynini.Weight.zero(fst.arc_type())
?
oh that works too. Thanks!!
Currently, I am determining if a state is an accepting state with the following:
fsa.final(state) == pynini.Weight.one('tropical')
However, this approach is flawed if we set the weight of a state to 1. Is there a better way of figuring out if a state is accepting or not?