Function rustfst::algorithms::replace::replace
source · pub fn replace<W, F1, F2, B>(
fst_list: Vec<(Label, B)>,
root: Label,
epsilon_on_replace: bool,
) -> Result<F2>
Expand description
Recursively replaces trs in the root FSTs with other FSTs.
Replace supports replacement of trs in one Fst with another FST. This replacement is recursive. Replace takes an array of FST(s). One FST represents the root (or topology) machine. The root FST refers to other FSTs by recursively replacing trs labeled as non-terminals with the matching non-terminal FST. Currently Replace uses the output symbols of the trs to determine whether the transition is a non-terminal transition or not. A non-terminal can be any label that is not a non-zero terminal label in the output alphabet.
Note that input argument is a vector of pairs. These correspond to the tuple of non-terminal Label and corresponding FST.