Trait rustfst::algorithms::TrMapper [−][src]
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; }
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
fn final_tr_map(&self, final_tr: &mut FinalTr<S>) -> Result<()>
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
fn final_action(&self) -> MapFinalAction
Specifies final action the mapper requires (see above).
fn properties(&self, inprops: FstProperties) -> FstProperties