Trait rustfst::algorithms::randgen::TrSelector
source · pub trait TrSelector: Debug {
// Required method
fn select_tr<W: Semiring, F: Fst<W>>(
&mut self,
fst: &F,
state: StateId
) -> Result<usize>;
}
Expand description
TrSelector
implementors are used to select a random transition given an Fst
state s
, returning a number N
such that 0 <= N
<= fst.num_trs(s)
. If N
is
fst.num_trs(s)
, then the final weight is selected; otherwise the N
-th transition is
selected. It is assumed these are not applied to any state which is neither
final nor has any arcs leaving it.
Required Methods§
Object Safety§
This trait is not object safe.