Struct libmathcat::speech::ReplacementArray
source · pub struct ReplacementArray { /* private fields */ }Expand description
An array of rule Replacements (text, xpath, tts commands, etc)
Implementations§
source§impl<'r> ReplacementArray
impl<'r> ReplacementArray
sourcepub fn build_empty() -> ReplacementArray
pub fn build_empty() -> ReplacementArray
Return an empty ReplacementArray
sourcepub fn build(replacements: &Yaml) -> Result<ReplacementArray>
pub fn build(replacements: &Yaml) -> Result<ReplacementArray>
Convert a Yaml input into a ReplacementArray.
Any errors are passed back out.
sourcepub fn replace<'c, 's: 'c, 'm: 'c, T: TreeOrString<'c, 'm, T>>(
&self,
rules_with_context: &'r mut SpeechRulesWithContext<'c, 's, 'm>,
mathml: Element<'c>
) -> Result<T>
pub fn replace<'c, 's: 'c, 'm: 'c, T: TreeOrString<'c, 'm, T>>( &self, rules_with_context: &'r mut SpeechRulesWithContext<'c, 's, 'm>, mathml: Element<'c> ) -> Result<T>
Do all the replacements in mathml using rules.
pub fn replace_array_string<'c, 's: 'c, 'm: 'c>( &self, rules_with_context: &'r mut SpeechRulesWithContext<'c, 's, 'm>, mathml: Element<'c> ) -> Result<String>
pub fn replace_array_tree<'c, 's: 'c, 'm: 'c>( &self, rules_with_context: &'r mut SpeechRulesWithContext<'c, 's, 'm>, mathml: Element<'c> ) -> Result<Element<'m>>
Trait Implementations§
source§impl Clone for ReplacementArray
impl Clone for ReplacementArray
source§fn clone(&self) -> ReplacementArray
fn clone(&self) -> ReplacementArray
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more