Speech-Rule-Engine/speech-rule-engine

unexpected lost spacing

pkra opened this issue · 6 comments

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

In krautzource/sre-to-tree#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.)

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

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.

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

I find the configuration options hard to understand.

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.

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.

Thanks, Volker.