[][src]Function rustfst::algorithms::add_super_final_state

pub fn add_super_final_state<W: Semiring, F: MutableFst<W>>(
    ifst: &mut F
) -> StateId

Add, if needed, a super final state to the given FST. The super final state is returned if it is possible.

Definition

A super final state is a state that is the only final state in the FST with a weight of W::One().

Behaviour

If the input FST has no final states, this algorithm will add super final state that is connected to no other state.

If the input FST has only one final state with a weight of W::One(), this algorithm will have no effect and this final state will be returned as the super final state.

Otherwise, a final super state will be added to the input FST. Any final state will point to this final super state where the transition weight will be their final weight.