[][src]Struct rustfst::algorithms::replace::ReplaceFst

pub struct ReplaceFst<W: Semiring, F: Fst<W>, B: Borrow<F>>(_);

ReplaceFst supports lazy replacement of trs in one FST with another FST. This replacement is recursive. ReplaceFst can be used to support a variety of delayed constructions such as recursive transition networks, union, or closure.

Implementations

impl<W, F, B> ReplaceFst<W, F, B> where
    W: Semiring,
    F: Fst<W>,
    B: Borrow<F>, 
[src]

pub fn new(
    fst_list: Vec<(Label, B)>,
    root: Label,
    epsilon_on_replace: bool
) -> 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> CoreFst<W> for ReplaceFst<W, F, B> where
    W: Semiring,
    F: Fst<W>,
    B: Borrow<F>, 
[src]

type TRS = TrsVec<W>

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

impl<W, F, B> Debug for ReplaceFst<W, F, B> where
    W: Semiring,
    F: Fst<W>,
    B: Borrow<F>, 
[src]

impl<W, F, B> Fst<W> for ReplaceFst<W, F, B> where
    W: Semiring,
    F: Fst<W> + 'static,
    B: Borrow<F> + 'static, 
[src]

impl<'a, W, F, B> FstIterator<'a, W> for ReplaceFst<W, F, B> where
    W: Semiring,
    F: Fst<W> + 'a,
    B: Borrow<F> + 'a, 
[src]

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

impl<'a, W, F, B> StateIterator<'a> for ReplaceFst<W, F, B> where
    W: Semiring,
    F: Fst<W> + 'a,
    B: Borrow<F> + 'a, 
[src]

type Iter = <LazyFst<W, ReplaceFstOp<W, F, B>, 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> RefUnwindSafe for ReplaceFst<W, F, B> where
    B: RefUnwindSafe,
    F: RefUnwindSafe,
    W: RefUnwindSafe

impl<W, F, B> Send for ReplaceFst<W, F, B> where
    B: Send,
    F: Send,
    W: Send

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

impl<W, F, B> Unpin for ReplaceFst<W, F, B> where
    B: Unpin,
    F: Unpin,
    W: Unpin

impl<W, F, B> UnwindSafe for ReplaceFst<W, F, B> where
    B: UnwindSafe,
    F: 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.