Bug #3296

Mis à jour par Matthieu Decorde il y a presque 3 ans

Currently "--" input words/tokens break XML comments encoding.

They should not appear in an XML comment — https://www.w3.org/TR/xml/#sec-comments :

<pre>
For compatibility, the string " -- " (double-hyphen) MUST NOT occur within comments.] Parameter entity references MUST NOT be recognized within comments.
</pre>

h3. Discussion

FR:

<pre>
Il s'agit d'une rétro-compatibilité avec SGML si je comprends bien.
Donc on peut supposer que l'API javax.xml.stream.XMLStreamWriter ne fait aucun effort pour gérer le cas.

Si on cherche à remplacer "--" par des caractères Unicode équivalents ça dépend des cas : https://en.wikipedia.org/wiki/Dash#Types_of_dash.

Voici les 5 cas du corpus .conllu posant problème (il s'agit de lignes commentaires UD qui indiquent une traduction des phrases, il ne s'agit pas des phrases analysées syntaxiquement - qui sont en français dans ce corpus) :

1) # text_en = That share has been rising steadily over the years — only 11 percent of the total vote was cast before Election Day in 1996, according to the Census Bureau -- and seems likely to jump again this year.

Ici c'est 'facile' : le '--' clos le '—' situé avant (l'encodage n'est pas homogène). On peut supposer que '--' doit être '—' pour encoder le parenthésage.

Parenthesis-like use
https://en.wikipedia.org/wiki/Dash#Parenthesis-like_use

D'après wikipedia ça devrait être typographiquement un "(unspaced) em dash", mais là encore le manque de précision sur les espaces fait qu'on peut supposer que les em dash sont décollés.
--> ―

2) # text_en = A Harley-Davidson spokeswoman said timelines that have been floated in the media -- 2017 or 2020 -- aren't accurate.

Ici c'est 'facile' : parenthésage également "(unspaced) em dash" '— ... —' ou spaced en dash ' – ... – ' au choix
--> ―

3) # text_en = As the movie makes clear, the Lovings -- and Richard in particular -- were reluctant participants in history.

Ici c'est 'facile' : parenthésage également "(unspaced) em dash" '— ... —'.
--> ―

4) # text_en = "I have to congratulate Andy -- to get to No. 1 in the world that's an incredible achievement," the American said.

Quotation mark–like use
https://en.wikipedia.org/wiki/Dash#Quotation_mark%E2%80%93like_use
--> ―

5) # text_en = It's also fuelled the emergence of modern high-rises -- like the visionary MahaNakhon, Bangkok's tallest building.

Là je passe mon tour
--> ―
</pre>

h3. Solution 1

Replace all "-" with its UTF-8 entity &#x2212; -> no information is lost

h3. Solution 2

Replace all
'--' by '―'. -> information lost

Retour