Trait rustfst::algorithms::TrMapper

source ·
pub trait TrMapper<S: Semiring> {
    // Required methods
    fn tr_map(&self, tr: &mut Tr<S>) -> Result<()>;
    fn final_tr_map(&self, final_tr: &mut FinalTr<S>) -> Result<()>;
    fn final_action(&self) -> MapFinalAction;
    fn properties(&self, inprops: FstProperties) -> FstProperties;
}
Expand description

The TrMapper interfaces defines how trs and final weights are mapped. This is useful for implementing operations that do not change the number of trs.

Required Methods§

source

fn tr_map(&self, tr: &mut Tr<S>) -> Result<()>

How to modify the trs.

source

fn final_tr_map(&self, final_tr: &mut FinalTr<S>) -> Result<()>

The mapper will be passed final weights as trs of the form FinalTr(EPS_LABEL, EPS_LABEL, weight).

source

fn final_action(&self) -> MapFinalAction

Specifies final action the mapper requires (see above).

source

fn properties(&self, inprops: FstProperties) -> FstProperties

Implementors§