Speech-Rule-Engine / speech-rule-engine

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

Clearspeak Recurring Decimal (\dot) #683

Open adamc-texthelp opened 1 year ago

adamc-texthelp commented 1 year ago

There seems to only be a rule for using \overline{} when displaying recurring/repeating decimals. If you use the \dot{} representation the generated text is very literal in comparison.

I suppose this is more of a feature request. Is there any chance of getting the same result for \dot{} as we do for \overline{} or is there a different latex command recommended for the dot notation?

Examples:

image LaTeX: 2.\overline{34} Spoken text: the repeating decimal 2 point followed by repeating digits 3 4 MathML:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mn>2.</mn>
  <mover>
    <mn>34</mn>
    <mo accent="true">&#x2015;</mo>
  </mover>
</math>

image LaTeX: 2.\dot{3}\dot{4} Spoken text: 2 period 3 dot above 4 dot above MathML:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mn>2.</mn>
  <mrow data-mjx-texclass="ORD">
    <mover>
      <mn>3</mn>
      <mo>&#x2D9;</mo>
    </mover>
  </mrow>
  <mrow data-mjx-texclass="ORD">
    <mover>
      <mn>4</mn>
      <mo>&#x2D9;</mo>
    </mover>
  </mrow>
</math>
zorkow commented 1 year ago

Thanks for the request. I had a more elaborate heuristic for interpretation for multiple overaccents, ellipses etc. But at the time it broke too many things so I did not continue that line of work. I might be worth revisiting.