Function rustfst::algorithms::project_output
source · pub fn project_output<F: ExpandedFst + MutableFst>(
fst: &mut F
) -> Result<(), Error>
Expand description
This operation projects an FST onto its domain or range by copying each arc’s output label to its input label.
Example
use rustfst::utils::{acceptor, transducer};
use rustfst::semirings::{Semiring, IntegerWeight};
use rustfst::fst_impls::VectorFst;
use rustfst::algorithms::project;
let mut fst : VectorFst<IntegerWeight> = transducer(vec![2].into_iter(), vec![3].into_iter()).unwrap();
project(&mut fst, false).unwrap();
assert_eq!(fst, acceptor(vec![3].into_iter()).unwrap());