Function rustfst::algorithms::project
source · pub fn project<W: Semiring, F: MutableFst<W>>(
fst: &mut F,
project_type: ProjectType
)
Expand description
This operation projects an FST onto its domain or range by either copying each transition input label to its output label or vice versa.
§Example 1
§Project input
let mut fst : VectorFst<IntegerWeight> = fst![2 => 3];
project(&mut fst, ProjectType::ProjectInput);
assert_eq!(fst, fst![2]);
§Project output
let mut fst : VectorFst<IntegerWeight> = fst![2 => 3];
project(&mut fst, ProjectType::ProjectOutput);
assert_eq!(fst, fst![3]);