pub struct ConstFst<W> { /* private fields */ }
Expand description
Immutable FST whose states and trs each implemented by single arrays,
Trait Implementations§
source§impl<W: Semiring> CoreFst<W> for ConstFst<W>
impl<W: Semiring> CoreFst<W> for ConstFst<W>
source§fn 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
source§fn final_weight(&self, state_id: StateId) -> Result<Option<W>>
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>
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>
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
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>
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
unsafe fn get_trs_unchecked(&self, state_id: StateId) -> Self::TRS
Get an iterator on the transitions leaving state
state
. Read moresource§fn properties(&self) -> FstProperties
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>
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>
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>
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
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
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
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>
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 moresource§impl<W: 'static + SerializableSemiring> Display for ConstFst<W>
impl<W: 'static + SerializableSemiring> Display for ConstFst<W>
source§impl<W: 'static + Semiring> ExpandedFst<W> for ConstFst<W>
impl<W: 'static + Semiring> ExpandedFst<W> for ConstFst<W>
source§fn 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
fn states_range(&self) -> Range<StateId>
fn approx_equal<F2: ExpandedFst<W>>(&self, fst2: &F2, delta: f32) -> bool
source§impl<W: Semiring> Fst<W> for ConstFst<W>
impl<W: Semiring> Fst<W> for ConstFst<W>
source§fn input_symbols(&self) -> Option<&Arc<SymbolTable>>
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>>
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>)
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>)
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>>
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>>
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,
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,
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,
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> FstIntoIterator<W> for ConstFst<W>where
W: 'static + Semiring,
impl<W> FstIntoIterator<W> for ConstFst<W>where
W: 'static + Semiring,
source§impl<'a, W: Semiring + 'static> FstIterator<'a, W> for ConstFst<W>
impl<'a, W: Semiring + 'static> FstIterator<'a, W> for ConstFst<W>
source§impl<W: Semiring> PartialEq for ConstFst<W>
impl<W: Semiring> PartialEq for ConstFst<W>
source§impl<W: SerializableSemiring> SerializableFst<W> for ConstFst<W>
impl<W: SerializableSemiring> SerializableFst<W> for ConstFst<W>
source§fn fst_type() -> String
fn fst_type() -> String
String identifying the type of the FST. Will be used when serialiing and
deserializing an FST in binary format.
source§fn from_parsed_fst_text(parsed_fst_text: ParsedTextFst<W>) -> Result<Self>
fn from_parsed_fst_text(parsed_fst_text: ParsedTextFst<W>) -> Result<Self>
Turns a generic wFST format into the one of the wFST.
source§fn read<P: AsRef<Path>>(path_bin_fst: P) -> Result<Self>
fn read<P: AsRef<Path>>(path_bin_fst: P) -> Result<Self>
Loads an FST from a file in binary format.
source§fn write<P: AsRef<Path>>(&self, path_bin_fst: P) -> Result<()>
fn write<P: AsRef<Path>>(&self, path_bin_fst: P) -> Result<()>
Writes the FST to a file in binary format.
source§fn from_text_string(fst_string: &str) -> Result<Self>
fn from_text_string(fst_string: &str) -> Result<Self>
Deserializes a wFST in text from a path and returns a loaded wFST.
source§fn read_text<P: AsRef<Path>>(path_text_fst: P) -> Result<Self>
fn read_text<P: AsRef<Path>>(path_text_fst: P) -> Result<Self>
Deserializes a wFST in text from a path and returns a loaded wFST.
Auto Trait Implementations§
impl<W> Freeze for ConstFst<W>
impl<W> RefUnwindSafe for ConstFst<W>where
W: RefUnwindSafe,
impl<W> Send for ConstFst<W>
impl<W> Sync for ConstFst<W>
impl<W> Unpin for ConstFst<W>where
W: Unpin,
impl<W> UnwindSafe for ConstFst<W>where
W: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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