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

\Delta toSpeech text returned as "Triangle" (clearspeak) #654

Closed adamc-texthelp closed 2 years ago

adamc-texthelp commented 2 years ago

When generating spoken text with toSpeech using the clearspeak domain \Delta is seemingly always converted to "triangle". I understand it could possibly be contextually read as triangle, however there is a seperate hex character code and latex for that.

Delta latex: \Delta MathML hex code: Δ

Triangle latex: \triangle MathML hex code: △

Speech engine settings: { domain: "clearspeak", style: "default", locale: "en" }

Examples: Latex: \Delta

MathML:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mi mathvariant="normal">&#x394;</mi>
</math>

Speech text: triangle

More complex example: Latex: \left|S-\sum_{i=1}^{n} f\left(t_{i}\right) \Delta_{i}\right|<\varepsilon

MathML:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow data-mjx-texclass="INNER">
    <mo data-mjx-texclass="OPEN">|</mo>
    <mi>S</mi>
    <mo>&#x2212;</mo>
    <munderover>
      <mo data-mjx-texclass="OP">&#x2211;</mo>
      <mrow data-mjx-texclass="ORD">
        <mi>i</mi>
        <mo>=</mo>
        <mn>1</mn>
      </mrow>
      <mrow data-mjx-texclass="ORD">
        <mi>n</mi>
      </mrow>
    </munderover>
    <mi>f</mi>
    <mrow data-mjx-texclass="INNER">
      <mo data-mjx-texclass="OPEN">(</mo>
      <msub>
        <mi>t</mi>
        <mrow data-mjx-texclass="ORD">
          <mi>i</mi>
        </mrow>
      </msub>
      <mo data-mjx-texclass="CLOSE">)</mo>
    </mrow>
    <msub>
      <mi>&#x3B4;</mi>
      <mrow data-mjx-texclass="ORD">
        <mi>i</mi>
      </mrow>
    </msub>
    <mo data-mjx-texclass="CLOSE">|</mo>
  </mrow>
  <mo>&lt;</mo>
  <mi>&#x3B5;</mi>
</math>

Speech text: the absolute value of S minus the sum from i equals 1 to n of f of open paren t sub i close paren triangle sub i is less than epsilon

zorkow commented 2 years ago

Unfortunately, that is part of the original ClearSpeak spec. It is no longer available online, but I have the sample extracted from the Example files here: https://speech-rule-engine.github.io/sre-resources/samples/clearspeak/html/ClearSpeakExamples_Part2-Symbols.html#triangle-symbol

I always thought that this is very naive (K-12?) interpretation of cap Delta. In fact, I think it would be better to have Delta as Auto preference and a preference setting for Triangle pronunciation.

zorkow commented 2 years ago

I'll move this to the discussion board.