pub struct VectorFst<W: Semiring> { /* private fields */ }
Trait Implementations
sourceimpl<'a, W: 'static + Semiring> ArcIterator<'a> for VectorFst<W>
impl<'a, W: 'static + Semiring> ArcIterator<'a> for VectorFst<W>
sourceimpl<W: 'static + Semiring> CoreFst for VectorFst<W>
impl<W: 'static + Semiring> CoreFst for VectorFst<W>
type W = W
type W = W
Weight use in the wFST. This type must implement the Semiring trait
sourcefn start(&self) -> Option<StateId>
fn start(&self) -> Option<StateId>
Returns the ID of the start state of the wFST if it exists else none. Read more
sourcefn final_weight(&self, state_id: &StateId) -> Option<W>
fn final_weight(&self, state_id: &StateId) -> Option<W>
Retrieves the final weight of a state (if the state is a final one). Read more
sourceimpl<W: 'static + Semiring> ExpandedFst for VectorFst<W>
impl<W: 'static + Semiring> ExpandedFst for VectorFst<W>
sourcefn num_states(&self) -> usize
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
sourceimpl<'a, W: 'static + Semiring> MutableArcIterator<'a> for VectorFst<W>
impl<'a, W: 'static + Semiring> MutableArcIterator<'a> for VectorFst<W>
sourceimpl<W: 'static + Semiring> MutableFst for VectorFst<W>
impl<W: 'static + Semiring> MutableFst for VectorFst<W>
sourcefn set_start(&mut self, state_id: &StateId) -> Result<(), Error>
fn set_start(&mut self, state_id: &StateId) -> Result<(), Error>
The state with identifier
state_id
is now the start state.
Note that only one start state is allowed in this implementation. Calling this function twice
will mean losing the first start state.
If the state_id
doesn’t exist an error is raised. Read moresourcefn set_final(&mut self, state_id: &StateId, final_weight: W) -> Result<(), Error>
fn set_final(&mut self, state_id: &StateId, final_weight: W) -> Result<(), Error>
The state with identifier
state_id
is now a final state with a weight final_weight
.
If the state_id
doesn’t exist an error is raised. Read moresourcefn add_state(&mut self) -> StateId
fn add_state(&mut self) -> StateId
Adds a new state to the current FST. The identifier of the new state is returned Read more
sourcefn add_arc(
&mut self,
source: &StateId,
arc: Arc<<Self as CoreFst>::W>
) -> Result<(), Error>
fn add_arc(
&mut self,
source: &StateId,
arc: Arc<<Self as CoreFst>::W>
) -> Result<(), Error>
Adds an arc to the FST. The arc will start in the state
source
.
An error is raised if the state source
doesn’t exist. Read moresourcefn del_state(&mut self, state_to_remove: &StateId) -> Result<(), Error>
fn del_state(&mut self, state_to_remove: &StateId) -> Result<(), Error>
Removes a state from an FST. It also removes all the arcs starting from another state and
reaching this state. An error is raised if the state
state_id
doesn’t exist. Read moresourcefn del_states<T: IntoIterator<Item = StateId>>(
&mut self,
states: T
) -> Result<(), Error>
fn del_states<T: IntoIterator<Item = StateId>>(
&mut self,
states: T
) -> Result<(), Error>
Removes multiple states from an FST. If one of the states doesn’t exist, an error is raised. Read more
fn add_fst<F: ExpandedFst<W = Self::W>>(
&mut self,
fst_to_add: &F
) -> Result<HashMap<StateId, StateId>, Error>
sourceimpl<W: PartialEq + Semiring> PartialEq<VectorFst<W>> for VectorFst<W>
impl<W: PartialEq + Semiring> PartialEq<VectorFst<W>> for VectorFst<W>
sourceimpl<'a, W: 'a + Semiring> StateIterator<'a> for VectorFst<W>
impl<'a, W: 'a + Semiring> StateIterator<'a> for VectorFst<W>
type Iter = VectorStateIterator<'a, W>
type Iter = VectorStateIterator<'a, W>
Iterator used to iterate over the
state_id
of the states of an FST.sourcefn states_iter(&'a self) -> Self::Iter
fn states_iter(&'a self) -> Self::Iter
Creates an iterator over the
state_id
of the states of an FST. Read moreimpl<W: 'static + Semiring> Fst for VectorFst<W>
impl<W: Semiring> StructuralPartialEq for VectorFst<W>
Auto Trait Implementations
impl<W> RefUnwindSafe for VectorFst<W>where
W: RefUnwindSafe,
impl<W> Send for VectorFst<W>where
W: Send,
impl<W> Sync for VectorFst<W>where
W: Sync,
impl<W> Unpin for VectorFst<W>where
W: Unpin,
impl<W> UnwindSafe for VectorFst<W>where
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more