[][src]Function rustfst::algorithms::encode::encode

pub fn encode<W, F>(
    fst: &mut F,
    encode_type: EncodeType
) -> Result<EncodeTable<W>> where
    W: Semiring,
    F: MutableFst<W>, 

The encode operation allows the representation of a weighted transducer as a weighted automaton, an unweighted transducer or an unweighted automaton by considering the pair (input label, output), the pair (input label, weight) or the triple (input label, output label, weight) as a single label depending on the value of the encode flags: encode_labels and encode_weights.

The encoding of each pair or triple of labels and/or weights as a unique key is stored in an EncodeTable object.