gregorio icon indicating copy to clipboard operation
gregorio copied to clipboard

Issue with <eu> and <alt>

Open olivierberten opened this issue 3 years ago • 3 comments

See https://gregobase.selapa.net/chant.php?id=13840

I couldn't manage to have the above-line-text without the hyphen.

<eu>o(h) i(hjh) ou(g) e(f) a(fffe) e(dc/dff)</eu><alt>(4)</alt> (::) (current situation) and <eu>o(h) i(hjh) ou(g) e(f) a(fffe) e(dc/dff)</eu> <alt>(4)</alt>(::) render the alt but adds an hyphen after the last e while <eu>o(h) i(hjh) ou(g) e(f) a(fffe) e(dc/dff) <alt>(4)</alt></eu>(::) and <eu>o(h) i(hjh) ou(g) e(f) a(fffe) e(dc/dff) </eu><alt>(4)</alt>(::) print neither of them...

olivierberten avatar Jan 31 '21 00:01 olivierberten

As a side question: is there a way to have that numbering on top of the last note as in the source? [alt:] doesn't allow parentheses...

olivierberten avatar Feb 02 '21 18:02 olivierberten

<eu>o(h) i(hjh) ou(g) e(f) a(fffe) e(dc/dff) </eu> <alt>(4)</alt>(::) works. Probably not exactly how we should expect the <eu> tags to work though.

[alt:] doesn't allow parentheses...

We should probably allow backslash escaping of parentheses. Right now the opening parentheses gets processed fine, but when you try to close the parentheses it's interpreted as the end of the notes segment. This happens when you try to put parentheses in the lyrics too, though the use of <v> tags can get you around it there. Said strategy won't work here because we're inside the notes and those kind of tags cannot be nested.

rpspringuel avatar Feb 02 '21 20:02 rpspringuel

Comparing the dump of the following: <eu>o(h) i(hjh) ou(g) e(f) a(fffe) e(dc/dff)</eu> <alt>(4)</alt>(::) (what I would consider the proper way to enter this) <eu>o(h) i(hjh) ou(g) e(f) a(fffe) e(dc/dff) </eu> <alt>(4)</alt>(::) (what actually works)

The difference is in the last two syllables. With the space, the penultimate syllable (e(dc/dff)) is identified as a WORD_ONE_SYLLABLE. Without it, it's WORD_BEGINNING. With the space, the last syllable ((4)(::)) is identified as WORD_ONE_SYLLABLE. Without it, it's WORD_END. In both cases it's the last syllable which is identified as the EUOUAE_END.

In looking at the gtex output, these are reflected by argument 4 being 1 (this syllable is end of word) when the space is present and 0 (this syllable is not end of word) when there is no space. Further, the \GreEndEUOUAE appears after the bar syllable.

My interpretation of this is that the closing parentheses in the penultimate syllable ends that syllable and so the </eu> counts as being part of the following syllable. If there's no space before it, then it detects as being part of the same word and inserts a hyphen. My naive expectation would have been that the </eu> was still part of the syllable just before it and that the character after it would be the start of the new syllable, triggering a new word if it was a space.

However, my understanding of the lexer isn't sufficient to figure out how to do this, or even if it's a good idea.

rpspringuel avatar Feb 05 '21 03:02 rpspringuel