[][src]Struct rustfst::algorithms::factor_weight::FactorWeightFst

pub struct FactorWeightFst<W: WeightQuantize, F: Fst<W>, B: Borrow<F>, FI: FactorIterator<W>>(_);

The result of weight factoring is a transducer equivalent to the input whose path weights have been factored according to the FactorIterator. States and transitions will be added as necessary. The algorithm is a generalization to arbitrary weights of the second step of the input epsilon-normalization algorithm. This version is a Delayed FST.

Implementations

impl<'a, W, F: Fst<W>, B: Borrow<F>, FI: FactorIterator<W>> FactorWeightFst<W, F, B, FI> where
    W: WeightQuantize
[src]

pub fn new(fst: B, opts: FactorWeightOptions) -> Result<Self>[src]

pub fn compute<F2: MutableFst<W> + AllocableFst<W>>(&self) -> Result<F2>[src]

Turns the Lazy FST into a static one.

Trait Implementations

impl<W, F, B, FI> CoreFst<W> for FactorWeightFst<W, F, B, FI> where
    W: WeightQuantize,
    F: Fst<W>,
    B: Borrow<F>,
    FI: FactorIterator<W>, 
[src]

type TRS = TrsVec<W>

Weight use in the wFST. This type must implement the Semiring trait.

impl<W, F, B, FI> Debug for FactorWeightFst<W, F, B, FI> where
    W: WeightQuantize,
    F: Fst<W>,
    B: Borrow<F>,
    FI: FactorIterator<W>, 
[src]

impl<W, F, B, FI> Fst<W> for FactorWeightFst<W, F, B, FI> where
    W: WeightQuantize,
    F: Fst<W> + 'static,
    B: Borrow<F> + 'static,
    FI: FactorIterator<W> + 'static, 
[src]

impl<'a, W, F, B, FI> FstIterator<'a, W> for FactorWeightFst<W, F, B, FI> where
    W: WeightQuantize,
    F: Fst<W> + 'a,
    B: Borrow<F> + 'a,
    FI: FactorIterator<W> + 'a, 
[src]

type FstIter = <LazyFst<W, FactorWeightOp<W, F, B, FI>, SimpleHashMapCache<W>> as FstIterator<'a, W>>::FstIter

impl<'a, W, F, B, FI> StateIterator<'a> for FactorWeightFst<W, F, B, FI> where
    W: WeightQuantize,
    F: Fst<W> + 'a,
    B: Borrow<F> + 'a,
    FI: FactorIterator<W> + 'a, 
[src]

type Iter = <LazyFst<W, FactorWeightOp<W, F, B, FI>, SimpleHashMapCache<W>> as StateIterator<'a>>::Iter

Iterator used to iterate over the state_id of the states of an FST.

Auto Trait Implementations

impl<W, F, B, FI> RefUnwindSafe for FactorWeightFst<W, F, B, FI> where
    B: RefUnwindSafe,
    F: RefUnwindSafe,
    FI: RefUnwindSafe,
    W: RefUnwindSafe

impl<W, F, B, FI> Send for FactorWeightFst<W, F, B, FI> where
    B: Send,
    F: Send,
    FI: Send,
    W: Send

impl<W, F, B, FI> Sync for FactorWeightFst<W, F, B, FI> where
    B: Sync,
    F: Sync,
    W: Send

impl<W, F, B, FI> Unpin for FactorWeightFst<W, F, B, FI> where
    B: Unpin,
    F: Unpin,
    FI: Unpin,
    W: Unpin

impl<W, F, B, FI> UnwindSafe for FactorWeightFst<W, F, B, FI> where
    B: UnwindSafe,
    F: UnwindSafe,
    FI: UnwindSafe,
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.