NSoiffer/MathCATForPython

Looking for an example

tteodorescu0 opened this issue · 5 comments

Is there an example of how to use MathCAT in a Python program to convert a MathML expression to a speech string? I am looking for something I can adapt to test a large number of MathML expressions.

Thank you for the instructions! How do I change the speech options? For example, to output regular text (no SSML); to apply the Fraction=FracOver preference; or to apply more than one preference in ClearSpeak? Here's what I have so far.

import libmathcat
rules_dir = "C:\mathcat-python\Rules"
libmathcat.SetRulesDir(rules_dir)
libmathcat.SetPreference("TTS", "SSML")
mathml ="x2"
libmathcat.SetMathML(mathml)
print(libmathcat.GetSpokenText()) ## prints "<say-as interpret-as='characters'>x over 2"

Thank you. I was able to change the speech options. I'll run more tests next week. I am looking forward to your presentation on Tuesday at ETS.

Closing since no activity in a long time.