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

unexpected lost spacing #739

Closed pkra closed 7 months ago

pkra commented 8 months ago

This is a bit of a weird one, somewhat of a continuation of #729. I'm struggling to get a simple test case.

In https://github.com/krautzource/sre-to-tree/issues/39, I have a test that passes if run individually but fails if run all tests.

The failing case is

  expected: |-
      'left brace StartLayout 1st Row  with Label left parenthesis 1 right parenthesis EndLabel b EndLayout'
    actual: |-
      'left braceStartLayout1st Row  with Labelleft parenthesis1right parenthesisEndLabelbEndLayout'

Slightly more minimized: I run the mathjax+sre setup in the repository with first 'f(x) = y' and then \begin{empheq} [left = \empheqlbrace \,]{align} b \tag{1}\end{empheq}, the resulting top-level label for the second sample will be different. (And by "label" I mean data-semantic-speech for the "true" semantic root, cf #729.)

zorkow commented 7 months ago

Is it possible that you are running this in parallel with Braille translation? That changes the speech separator from ' ' to ''.

pkra commented 7 months ago

Thanks for taking a look!

Is it possible that you are running this in parallel with Braille translation? That changes the speech separator from ' ' to ''.

Yes. The tests in the repo use the setup in https://github.com/krautzource/sre-to-tree/blob/master/test/tex2svg.js.

I'm switching back and forth there. Perhaps I'm not resetting SRE correctly. I recall from another project (with a similar setup) that SRE's config had changed.

I'll take a look and report back.

pkra commented 7 months ago

Ok, when I manually set modality: 'speech', the problem goes away.

I find the configuration options hard to understand.

pkra commented 7 months ago

I find the configuration options hard to understand.

Just to expand. I obviously found it difficult to understand SRE's behavior with these options. Primarily, I don't understand why braille is a modality - it seems distinct from the other modalities (if I read "speech" as "full string") but the result also doesn't seem useful for braille output.

In any case, I didn't meant to come across snarky - this was just an FYI.

zorkow commented 7 months ago

SRE starts in a default configurations. The setupEngine changes these parameters, but it does not reset them. I.e., once modality is braille it remains so, until it is set to something else. Hence the effect you see.

I understand that the braille modality appears out of place. Initially it was thought that locales would come with speech, braille, etc. But that is rubbish, as tactile languages are locales in their own right. As such functionality that decides on modality === braille should be refactored into the locale setup in the future.

pkra commented 7 months ago

Thanks, Volker.