rustfst 0.3.0

Library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use failure::Fallible;

use crate::algorithms::StateMapper;
use crate::fst_traits::MutableFst;

/// Mapper that returns its input.
pub struct IdentityStateMapper {}

impl<F: MutableFst> StateMapper<F> for IdentityStateMapper {
    fn map_final_weight(&self, _weight: Option<&mut F::W>) -> Fallible<()> {
        Ok(())
    }

    fn map_arcs(&self, _fst: &mut F, _state: usize) -> Fallible<()> {
        Ok(())
    }
}