Trait rustfst::algorithms::WeightConverter

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

The WeightConverter interfaces defines how a weight should be turned into another one. Useful for changing the semiring of an FST.

Required Methods§

source

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

source

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

source

fn final_action(&self) -> MapFinalAction

source

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

Implementors§

source§

impl<S> WeightConverter<S, S> for IdentityTrMapper
where S: Semiring,

source§

impl<S> WeightConverter<S, S> for InputEpsilonMapper
where S: Semiring,

source§

impl<S> WeightConverter<S, S> for InvertWeightMapper

source§

impl<S> WeightConverter<S, S> for OutputEpsilonMapper
where S: Semiring,

source§

impl<S> WeightConverter<S, S> for PlusMapper<S>
where S: Semiring,

source§

impl<S> WeightConverter<S, S> for QuantizeMapper
where S: WeightQuantize,

source§

impl<S> WeightConverter<S, S> for RmWeightMapper
where S: Semiring,

source§

impl<S> WeightConverter<S, S> for TimesMapper<S>
where S: Semiring,

source§

impl<SI, SO> WeightConverter<SI, SO> for SimpleWeightConverter
where SI: Semiring, SO: Semiring<Type = SI::Type>,

source§

impl<W> WeightConverter<W, GallicWeight<W>> for ToGallicConverter
where W: Semiring,

source§

impl<W> WeightConverter<W, GallicWeightLeft<W>> for ToGallicConverter
where W: Semiring,

source§

impl<W> WeightConverter<W, GallicWeightMin<W>> for ToGallicConverter
where W: Semiring,

source§

impl<W> WeightConverter<W, GallicWeightRestrict<W>> for ToGallicConverter
where W: Semiring,

source§

impl<W> WeightConverter<W, GallicWeightRight<W>> for ToGallicConverter
where W: Semiring,

source§

impl<W: Semiring> WeightConverter<GallicWeight<W>, W> for FromGallicConverter

source§

impl<W: Semiring> WeightConverter<GallicWeightLeft<W>, W> for FromGallicConverter

source§

impl<W: Semiring> WeightConverter<GallicWeightMin<W>, W> for FromGallicConverter

source§

impl<W: Semiring> WeightConverter<GallicWeightRestrict<W>, W> for FromGallicConverter

source§

impl<W: Semiring> WeightConverter<GallicWeightRight<W>, W> for FromGallicConverter