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

Method is_match

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

Source from the content-addressed store, hash-verified

1272 }
1273
1274 fn is_match(&self, context: &Context, mathml: Element) -> Result<bool> {
1275 if self.tag_name != mathml.name().local_part() && self.tag_name != "*" && self.tag_name != "!*" {
1276 return Ok( false );
1277 }
1278
1279 // debug!("\nis_match: pattern='{}'", self.pattern_name);
1280 // debug!(" pattern_expr {:?}", self.pattern_expr);
1281 // print!("is_match: mathml is\n{}", mml_to_string(mathml));
1282 return Ok(
1283 match self.pattern.evaluate(context, mathml)? {
1284 Value::Boolean(b) => b,
1285 Value::Nodeset(nodes) => nodes.size() > 0,
1286 _ => false,
1287 }
1288 );
1289 }
1290}
1291
1292

Callers 15

clean_mathmlMethod · 0.80
is_roman_number_matchMethod · 0.80
merge_number_blocksMethod · 0.80
split_pointsMethod · 0.80
is_likely_a_numberMethod · 0.80
merge_charsMethod · 0.80
merge_primesMethod · 0.80
find_matchMethod · 0.80
typeface_to_word_modeFunction · 0.80
is_chemistry_offFunction · 0.80

Calls 1

evaluateMethod · 0.45

Tested by

no test coverage detected