Crate libmathcat

source ·
Expand description

A library for generating speech and braille from MathML

Typical usage is:

  1. Set the rules directory set_rules_dir
  2. Set whatever preferences are need with repeated calls to set_preference.
  3. Set MathML via set_mathml A string representing the cleaned up MathML along with ids on each node is returned for highlighting if desired
  4. Get the speech get_spoken_text or (Unicode) braille get_braille.

The expression can be navigated also. This is done in one of two ways:

  1. Pass key strokes to allow a user to navigate the MathML by calling do_navigate_keypress; the speech is returned.
  2. Pass the MathCAT navigation command directory by called do_navigate_command; the speech is return returned.

To get the MathML associated with the current navigation node, call get_navigation_mathml. To just get the id and offset from the id of the current navigation node, call get_navigation_mathml_id.

Re-exports§

Modules§

  • The interface module provides functionality both for calling from an API and also running the code from main.
  • This is used to paste over normal reading of the Rules files and building them into the code for web assembly (WASM) which can’t do file system access. For the latter, the Rules directory should be zipped up.
  • The speech module is where the speech rules are read in and speech generated.