The main external call, `intent_from_mathml` returns a string for the speech associated with the `mathml`. It matches against the rules that are computed by user prefs such as "Language" and "SpeechStyle". The speech rules assume `mathml` has been "cleaned" via the canonicalization step. If the preferences change (and hence the speech rules to use change), or if the rule file changes, `intent_fr
(mathml: Element, doc: Document<'m>)
| 65 | /// A string is returned in call cases. |
| 66 | /// If there is an error, the speech string will indicate an error. |
| 67 | pub fn intent_from_mathml<'m>(mathml: Element, doc: Document<'m>) -> Result<Element<'m>> { |
| 68 | let intent_tree = intent_rules(&INTENT_RULES, doc, mathml, "")?; |
| 69 | doc.root().append_child(intent_tree); |
| 70 | return Ok(intent_tree); |
| 71 | } |
| 72 | |
| 73 | pub fn speak_mathml(mathml: Element, nav_node_id: &str) -> Result<String> { |
| 74 | return speak_rules(&SPEECH_RULES, mathml, nav_node_id); |