MCPcopy Create free account
hub / github.com/daisy/MathCAT / intent_from_mathml

Function intent_from_mathml

src/speech.rs:67–71  ·  view source on GitHub ↗

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>)

Source from the content-addressed store, hash-verified

65/// A string is returned in call cases.
66/// If there is an error, the speech string will indicate an error.
67pub 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
73pub fn speak_mathml(mathml: Element, nav_node_id: &str) -> Result<String> {
74 return speak_rules(&SPEECH_RULES, mathml, nav_node_id);

Callers 4

replaceMethod · 0.85
test_intentFunction · 0.85
get_spoken_textFunction · 0.85
speakFunction · 0.85

Calls 1

intent_rulesFunction · 0.85

Tested by 1

test_intentFunction · 0.68