Trait rustfst::fst_traits::ExpandedFst[][src]

pub trait ExpandedFst<W: Semiring>: Fst<W> + Clone + PartialEq + FstIntoIterator<W> {
    fn num_states(&self) -> usize;

    fn states_range(&self) -> Range<StateId> { ... }
fn approx_equal<F2: ExpandedFst<W>>(&self, fst2: &F2, delta: f32) -> bool { ... }
fn quantize<F2: MutableFst<W> + AllocableFst<W>>(&self) -> Result<F2>
    where
        W: WeightQuantize
, { ... } }
Expand description

Trait defining the necessary methods that should implement an ExpandedFST e.g a FST where all the states are already computed and not computed on the fly.

Required methods

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).

Example

let mut fst = VectorFst::<BooleanWeight>::new();

assert_eq!(fst.num_states(), 0);

fst.add_state();
assert_eq!(fst.num_states(), 1);

fst.add_state();
assert_eq!(fst.num_states(), 2);

Provided methods

Implementations on Foreign Types

Implementors