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

Method is_true

src/speech.rs:1092–1101  ·  view source on GitHub ↗
(&self, context: &Context, mathml: Element)

Source from the content-addressed store, hash-verified

1090 }
1091
1092 fn is_true(&self, context: &Context, mathml: Element) -> Result<bool> {
1093 // return true if there is no condition or if the condition evaluates to true
1094 return Ok(
1095 match self.evaluate(context, mathml)? {
1096 Value::Boolean(b) => b,
1097 Value::Nodeset(nodes) => nodes.size() > 0,
1098 _ => false,
1099 }
1100 )
1101 }
1102
1103 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> {
1104 if self.rc.string == "process-intent(.)" {

Callers 1

replaceMethod · 0.80

Calls 1

evaluateMethod · 0.45

Tested by

no test coverage detected