Function rustfst::algorithms::closure::closure

source ·
pub fn closure<W, F>(fst: &mut F, closure_type: ClosureType)
where W: Semiring, F: MutableFst<W>,
Expand description

This operation computes the concatenative closure. If A transduces string x to y with weight a, then the closure transduces x to y with weight a, xx to yy with weight a ⊗ a, xxx to yyy with weight a ⊗ a ⊗ a, etc. If closure_star then the empty string is transduced to itself with weight 1 as well.

§Example

§Input

closure_in

§Closure Plus

closure_out_closure_plus

§Closure Star

closure_out_closure_star