[−][src]Struct rustfst::algorithms::replace::ReplaceFst
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]
W: Semiring,
F: Fst<W>,
B: Borrow<F>,
pub fn new(
fst_list: Vec<(Label, B)>,
root: Label,
epsilon_on_replace: bool
) -> Result<Self>
[src]
fst_list: Vec<(Label, B)>,
root: Label,
epsilon_on_replace: bool
) -> Result<Self>
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]
W: Semiring,
F: Fst<W>,
B: Borrow<F>,
type TRS = TrsVec<W>
Weight use in the wFST. This type must implement the Semiring trait.
fn start(&self) -> Option<usize>
[src]
fn final_weight(&self, state_id: usize) -> Result<Option<W>>
[src]
unsafe fn final_weight_unchecked(&self, state_id: usize) -> Option<W>
[src]
fn num_trs(&self, s: usize) -> Result<usize>
[src]
unsafe fn num_trs_unchecked(&self, s: usize) -> usize
[src]
fn get_trs(&self, state_id: usize) -> Result<Self::TRS>
[src]
unsafe fn get_trs_unchecked(&self, state_id: usize) -> Self::TRS
[src]
fn properties(&self) -> FstProperties
[src]
fn num_input_epsilons(&self, state: usize) -> Result<usize>
[src]
fn num_output_epsilons(&self, state: usize) -> Result<usize>
[src]
fn is_final(&self, state_id: StateId) -> Result<bool>
[src]
unsafe fn is_final_unchecked(&self, state_id: StateId) -> bool
[src]
fn is_start(&self, state_id: StateId) -> bool
[src]
fn properties_with_mask(&self, mask: FstProperties) -> FstProperties
[src]
fn properties_check(&self, props_known: FstProperties) -> Result<FstProperties>
[src]
impl<W, F, B> Debug for ReplaceFst<W, F, B> where
W: Semiring,
F: Fst<W>,
B: Borrow<F>,
[src]
W: Semiring,
F: Fst<W>,
B: Borrow<F>,
impl<W, F, B> Fst<W> for ReplaceFst<W, F, B> where
W: Semiring,
F: Fst<W> + 'static,
B: Borrow<F> + 'static,
[src]
W: Semiring,
F: Fst<W> + 'static,
B: Borrow<F> + 'static,
fn input_symbols(&self) -> Option<&Arc<SymbolTable>>
[src]
fn output_symbols(&self) -> Option<&Arc<SymbolTable>>
[src]
fn set_input_symbols(&mut self, symt: Arc<SymbolTable>)
[src]
fn set_output_symbols(&mut self, symt: Arc<SymbolTable>)
[src]
fn take_input_symbols(&mut self) -> Option<Arc<SymbolTable>>
[src]
fn take_output_symbols(&mut self) -> Option<Arc<SymbolTable>>
[src]
fn set_symts_from_fst<W2: Semiring, OF: Fst<W2>>(&mut self, other_fst: &OF)
[src]
fn final_states_iter(&self) -> FinalStatesIterator<'_, W, Self> where
Self: Sized,
[src]
Self: Sized,
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]
W: Semiring,
F: Fst<W> + 'a,
B: Borrow<F> + 'a,
type FstIter = <LazyFst<W, ReplaceFstOp<W, F, B>, SimpleHashMapCache<W>> as FstIterator<'a, W>>::FstIter
fn fst_iter(&'a self) -> Self::FstIter
[src]
impl<'a, W, F, B> StateIterator<'a> for ReplaceFst<W, F, B> where
W: Semiring,
F: Fst<W> + 'a,
B: Borrow<F> + 'a,
[src]
W: Semiring,
F: Fst<W> + 'a,
B: Borrow<F> + 'a,
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.
fn states_iter(&'a self) -> Self::Iter
[src]
Auto Trait Implementations
impl<W, F, B> RefUnwindSafe for ReplaceFst<W, F, B> where
B: RefUnwindSafe,
F: RefUnwindSafe,
W: RefUnwindSafe,
B: RefUnwindSafe,
F: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, F, B> Send for ReplaceFst<W, F, B> where
B: Send,
F: Send,
W: Send,
B: Send,
F: Send,
W: Send,
impl<W, F, B> Sync for ReplaceFst<W, F, B> where
B: Sync,
F: Sync,
W: Send,
B: Sync,
F: Sync,
W: Send,
impl<W, F, B> Unpin for ReplaceFst<W, F, B> where
B: Unpin,
F: Unpin,
W: Unpin,
B: Unpin,
F: Unpin,
W: Unpin,
impl<W, F, B> UnwindSafe for ReplaceFst<W, F, B> where
B: UnwindSafe,
F: UnwindSafe,
W: UnwindSafe,
B: UnwindSafe,
F: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,