Struct rustfst::algorithms::compose::FstAddOn

source ·
pub struct FstAddOn<F, T> { /* private fields */ }
Expand description

Adds an object of type T to an FST. The resulting type is a new FST implementation.

Implementations§

source§

impl<F, T> FstAddOn<F, T>

source

pub fn new(fst: F, add_on: T) -> Self

source

pub fn fst(&self) -> &F

source

pub fn fst_mut(&mut self) -> &mut F

source

pub fn add_on(&self) -> &T

Trait Implementations§

source§

impl<F: Clone, T: Clone> Clone for FstAddOn<F, T>

source§

fn clone(&self) -> FstAddOn<F, T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<W: Semiring, F: CoreFst<W>, T> CoreFst<W> for FstAddOn<F, T>

§

type TRS = <F as CoreFst<W>>::TRS

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

fn start(&self) -> Option<StateId>

Returns the ID of the start state of the wFST if it exists else none. Read more
source§

fn final_weight(&self, state_id: StateId) -> Result<Option<W>>

Retrieves the final weight of a state (if the state is a final one). Read more
source§

unsafe fn final_weight_unchecked(&self, state_id: StateId) -> Option<W>

Retrieves the final weight of a state (if the state is a final one). Read more
source§

fn num_trs(&self, s: StateId) -> Result<usize>

Number of trs leaving a specific state in the wFST. Read more
source§

unsafe fn num_trs_unchecked(&self, s: StateId) -> usize

Number of trs leaving a specific state in the wFST. Read more
source§

fn get_trs(&self, state_id: StateId) -> Result<Self::TRS>

Get an iterator on the transitions leaving state state.
source§

unsafe fn get_trs_unchecked(&self, state_id: StateId) -> Self::TRS

Get an iterator on the transitions leaving state state. Read more
source§

fn properties(&self) -> FstProperties

Retrieve the FstProperties stored in the Fst. As a result, all the properties returned are verified by the Fst but some other properties might be true as well despite the flag not being set.
source§

fn num_input_epsilons(&self, state: StateId) -> Result<usize>

Returns the number of trs with epsilon input labels leaving a state. Read more
source§

fn num_output_epsilons(&self, state: StateId) -> Result<usize>

Returns the number of trs with epsilon output labels leaving a state. Read more
source§

fn is_final(&self, state_id: StateId) -> Result<bool>

Returns whether or not the state with identifier passed as parameters is a final state. Read more
source§

unsafe fn is_final_unchecked(&self, state: StateId) -> bool

Returns whether or not the state with identifier passed as parameters is a final state. Read more
source§

fn is_start(&self, state_id: StateId) -> bool

Check whether a state is the start state or not.
source§

fn properties_with_mask(&self, mask: FstProperties) -> FstProperties

Apply a mask to the FstProperties returned.
source§

fn properties_check(&self, props_known: FstProperties) -> Result<FstProperties>

Retrieve the FstProperties in the Fst and check that all the properties in props_known are known (not the same as true). If not an error is returned. Read more
source§

impl<F: Debug, T: Debug> Debug for FstAddOn<F, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<W, F, T> ExpandedFst<W> for FstAddOn<F, T>
where W: Semiring, F: ExpandedFst<W>, T: Debug + Clone + PartialEq,

source§

fn num_states(&self) -> usize

Returns the number of states that contains the FST. They are all counted even if some states are not on a successful path (doesn’t perform triming). Read more
source§

fn states_range(&self) -> Range<StateId>

source§

fn approx_equal<F2: ExpandedFst<W>>(&self, fst2: &F2, delta: f32) -> bool

source§

impl<W, F, T: Debug> Fst<W> for FstAddOn<F, T>
where W: Semiring, F: Fst<W>,

source§

fn input_symbols(&self) -> Option<&Arc<SymbolTable>>

Retrieves the input SymbolTable associated to the Fst. If no SymbolTable has been previously attached then None is returned.
source§

fn output_symbols(&self) -> Option<&Arc<SymbolTable>>

Retrieves the output SymbolTable associated to the Fst. If no SymbolTable has been previously attached then None is returned.
source§

fn set_input_symbols(&mut self, symt: Arc<SymbolTable>)

Attaches an output SymbolTable to the Fst. The SymbolTable is not duplicated with the use of Arc.
source§

fn set_output_symbols(&mut self, symt: Arc<SymbolTable>)

Attaches an output SymbolTable to the Fst. The SymbolTable is not duplicated with the use of Arc.
source§

fn take_input_symbols(&mut self) -> Option<Arc<SymbolTable>>

Removes the input symbol table from the Fst and retrieves it.
source§

fn take_output_symbols(&mut self) -> Option<Arc<SymbolTable>>

Removes the output symbol table from the Fst and retrieves it.
source§

fn final_states_iter(&self) -> FinalStatesIterator<'_, W, Self>
where Self: Sized,

Returns an Iterator on the final states along with their weight.
source§

fn paths_iter(&self) -> PathsIterator<'_, W, Self>
where Self: Sized,

Returns an Iterator on the paths accepted by the Fst. Read more
source§

fn string_paths_iter(&self) -> Result<StringPathsIterator<'_, W, Self>>
where Self: Sized,

Returns an Iterator on the paths accepted by the Fst. Plus, handles the SymbolTable allowing to retrieve the strings instead of only the sequence of labels. Read more
source§

impl<W, F, T> FstIntoIterator<W> for FstAddOn<F, T>
where W: Semiring, F: FstIntoIterator<W>, T: Debug,

source§

impl<'a, W, F, T> FstIterator<'a, W> for FstAddOn<F, T>
where W: Semiring + 'a, F: FstIterator<'a, W>,

§

type FstIter = <F as FstIterator<'a, W>>::FstIter

source§

fn fst_iter(&'a self) -> Self::FstIter

source§

impl<F: PartialEq, T: PartialEq> PartialEq for FstAddOn<F, T>

source§

fn eq(&self, other: &FstAddOn<F, T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, F: StateIterator<'a>, T> StateIterator<'a> for FstAddOn<F, T>

§

type Iter = <F as StateIterator<'a>>::Iter

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

fn states_iter(&'a self) -> Self::Iter

Creates an iterator over the state_id of the states of an FST. Read more
source§

impl<F, T> StructuralPartialEq for FstAddOn<F, T>

Auto Trait Implementations§

§

impl<F, T> Freeze for FstAddOn<F, T>
where F: Freeze, T: Freeze,

§

impl<F, T> RefUnwindSafe for FstAddOn<F, T>

§

impl<F, T> Send for FstAddOn<F, T>
where F: Send, T: Send,

§

impl<F, T> Sync for FstAddOn<F, T>
where F: Sync, T: Sync,

§

impl<F, T> Unpin for FstAddOn<F, T>
where F: Unpin, T: Unpin,

§

impl<F, T> UnwindSafe for FstAddOn<F, T>
where F: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V