HFST - Helsinki Finite-State Transducer Technology - Python API  version 3.9.0
StateIsNotFinalException Class Reference

State is not final (and cannot have a final weight). More...

Inheritance diagram for StateIsNotFinalException:
HfstException

Detailed Description

State is not final (and cannot have a final weight).

An example :

 tr = libhfst.HfstBasicTransducer()
 tr.add_state(1)
 # An exception is thrown as state number 1 is not final
 try:
     w = tr.get_final_weight(1)
 except libhfst.StateIsNotFinalException:
     print("State is not final.")

You should use function libhfst.HfstBasicTransducer.is_final_state if you are not sure whether a state is final.

Thrown by libhfst.HfstBasicTransducer get_final_weight.


The documentation for this class was generated from the following file: