usestd::path::Path;usefailure::Fallible;usecrate::fst_traits::ExpandedFst;usecrate::parsers::text_fst::ParsedTextFst;usecrate::semirings::Semiring;/// Trait to allow serialization and deserialization of a wFST in text format.
pubtraitTextParser: ExpandedFst
where
Self::W: Semiring<Type = f32>,
{/// Turns a generic wFST format into the one of the wFST.
fnfrom_parsed_fst_text(parsed_fst_text: ParsedTextFst)->Fallible<Self>;/// Deserializes a wFST in text from a path and returns a loaded wFST.
fnfrom_text_string(fst_string:&str)->Fallible<Self>{let parsed_text_fst =ParsedTextFst::from_string(fst_string)?;Self::from_parsed_fst_text(parsed_text_fst)}/// Deserializes a wFST in text from a path and returns a loaded wFST.
fnread_text<P:AsRef<Path>>(path_text_fst: P)->Fallible<Self>{let parsed_text_fst =ParsedTextFst::from_path(path_text_fst)?;Self::from_parsed_fst_text(parsed_text_fst)}}