[][src]Function rustfst::algorithms::reweight

pub fn reweight<W, F>(
    fst: &mut F,
    potentials: &[W],
    reweight_type: ReweightType
) -> Result<()> where
    F: MutableFst<W>,
    W: WeaklyDivisibleSemiring

Reweights an FST according to a vector of potentials in a given direction. The weight must be left distributive when reweighting towards the initial state and right distributive when reweighting towards the final states.

A transition of weight w, with an origin state of potential p and destination state of potential q, is reweighted by p^-1 \otimes (w \otimes q) when reweighting torwards the initial state, and by (p \otimes w) \otimes q^-1 when reweighting towards the final states.