Speech-Rule-Engine / speech-rule-engine

Generating speech descriptions for XML structures
https://zorkow.github.io/speech-rule-engine/
Apache License 2.0
73 stars 39 forks source link

Bracketed uncertainty in numbers #725

Open limefrogyank opened 12 months ago

limefrogyank commented 12 months ago

Brackets in MathML seem to default to multiplication in SRE. For an uncertainty written in the form:

8.35(4)

MathML: <mn>8.35</mn><mo>(</mo><mn>4</mn><mo>)</mo>

This means that the last digit (5) has an uncertainty of plus or minus 4.

i.e. 8.35 +- 0.04

While MathSpeak just literally announces the brackets after the main number, ClearSpeak uses the word "times" which is incorrect.

One possible (perhaps naive) solution is to wrap the uncertainty section in an <mrow> then define a class like "Bracketed-Uncertainty" (or something similar to "MathML-Unit") that could identify the start of the uncertainty so that it is interpreted correctly in SRE.

Ideally, this would change the operator that separates the number and the leading bracket for the uncertainty from multiplication to something else.

pkra commented 11 months ago

I would add a wrapper with an aria-label attribute that specifies your preferred voicing. SRE will still provide for exploring the layout, i.e., find out that this is visually represented with parentheses. For an example, see https://krautzource.github.io/mathjax-aria-label/