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

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

    fn equal_quantized<F2: ExpandedFst<W>>(&self, fst2: &F2) -> bool
    where
        W: WeightQuantize
, { ... }
fn quantize<F2: MutableFst<W> + AllocableFst<W>>(&self) -> Result<F2>
    where
        W: WeightQuantize
, { ... } }

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

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

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);
Loading content...

Provided methods

fn equal_quantized<F2: ExpandedFst<W>>(&self, fst2: &F2) -> bool where
    W: WeightQuantize

fn quantize<F2: MutableFst<W> + AllocableFst<W>>(&self) -> Result<F2> where
    W: WeightQuantize

Loading content...

Implementations on Foreign Types

impl<W: Semiring, F: ExpandedFst<W>> ExpandedFst<W> for Arc<F>[src]

Loading content...

Implementors

impl<W, F, M, T> ExpandedFst<W> for MatcherFst<W, F, M, T> where
    W: Semiring,
    F: ExpandedFst<W>,
    M: Debug + Clone + PartialEq,
    T: Debug + Clone + PartialEq
[src]

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

impl<W: 'static + Semiring> ExpandedFst<W> for ConstFst<W>[src]

impl<W: 'static + Semiring> ExpandedFst<W> for VectorFst<W>[src]

Loading content...