[][src]Trait rustfst::algorithms::TrMapper

pub trait TrMapper<S: Semiring> {
    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; }

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

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

How to modify the trs.

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

fn final_action(&self) -> MapFinalAction

Specifies final action the mapper requires (see above).

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

Loading content...

Implementors

impl<S: Semiring> TrMapper<S> for IdentityTrMapper[src]

impl<S: Semiring> TrMapper<S> for InputEpsilonMapper[src]

impl<S: Semiring> TrMapper<S> for OutputEpsilonMapper[src]

impl<S: Semiring> TrMapper<S> for PlusMapper<S>[src]

impl<S: Semiring> TrMapper<S> for RmWeightMapper[src]

impl<S: Semiring> TrMapper<S> for TimesMapper<S>[src]

impl<S: WeaklyDivisibleSemiring> TrMapper<S> for InvertWeightMapper[src]

impl<S: WeightQuantize + Semiring> TrMapper<S> for QuantizeMapper[src]

Loading content...