Crate libmathcat
source ·Expand description
A library for generating speech and braille from MathML
Typical usage is:
- Set the rules directory
set_rules_dir
- Set whatever preferences are need with repeated calls to
set_preference
. - Set MathML via
set_mathml
A string representing the cleaned up MathML along withid
s on each node is returned for highlighting if desired - Get the speech
get_spoken_text
or (Unicode) brailleget_braille
.
The expression can be navigated also. This is done in one of two ways:
- Pass key strokes to allow a user to navigate the MathML by calling
do_navigate_keypress
; the speech is returned. - 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§
pub use shim_filesystem::ZIPPED_RULE_FILES;
pub use interface::*;
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.