bartneck / swiML

A project to formalise swimming programs using XML
MIT License
2 stars 2 forks source link

Alignment not working #111

Open bartneck opened 1 month ago

bartneck commented 1 month ago

I created the bookExamples/swiML-documentation/alignment.xml file to test the <excluderAlignment> element. While testing, I discovered that even with two simple repetitions, the alignment fails when there is too much difference between them.

When only the stroke is different, it works:

SCR-20240524-karr

When <rest> is added, it fails.

SCR-20240524-kayw

Is there an automatic check that stops the alignment when the difference is too large? If so, what exactly is the threshold?

bartneck commented 1 month ago

Setting the <excludeAlign> does not seem to have any effect either.

bartneck commented 1 month ago

I am not sure if this is the same error, but the repetitions in the first set in this file do not align:

jasiMasters/JasiMasters2024032601.xml

SCR-20240524-npzy
calloc262 commented 1 month ago

There is currently a check that means any instruction of the same type will not align if a certain number of characters apart, This is set to 9 so any 10 characters apart will not align So I think this is still acting as intended: In the first case, the repetitions are exactly 10 characters apart so just missing that alignment. In the second case, the 1st, 3rd and 4th are aligned on the left of the 50 the 2nd repetition is over 9 characters longer so does not align with the rest.

This should probably be discussed again on Friday so we can choose a definitive option to move forward with.

bartneck commented 1 month ago

Thank you for clarifying the alignment threshold. In the second example, should line 8,10,12 and 20 not align at the "x"? Why is line 20 so much intended?

bartneck commented 1 month ago

The existence of the <excludeAlign> element needs to be discussed. There seems very little reason to use it anymore. Unless we force elements to align by setting it to false.

bartneck commented 1 month ago

Decision: add alignProgram as meta element on top, check if all excludeAligns could be the same. No more specific excludeAlignContinue. Keep a threshold of 10 for the default automatic system that can be manually overridden in both directions.