HFST - Helsinki Finite-State Transducer Technology - Python API
version 3.12.2
|
State is not final (and cannot have a final weight). More...
Additional Inherited Members | |
Public Member Functions inherited from HfstException | |
def | what () |
A message describing the error in more detail. More... | |
State is not final (and cannot have a final weight).
An example :
tr = hfst.HfstBasicTransducer() tr.add_state(1) # An exception is thrown as state number 1 is not final try: w = tr.get_final_weight(1) except hfst.exceptions.StateIsNotFinalException: print("State is not final.")
You should use function hfst.HfstBasicTransducer.is_final_state if you are not sure whether a state is final.
Thrown by hfst.HfstBasicTransducer get_final_weight.