ANNIS icon indicating copy to clipboard operation
ANNIS copied to clipboard

Token-wise HTML element generation in HTML visualizations

Open amir-zeldes opened this issue 11 years ago • 0 comments

In some cases of conflicting hierarchies, generating the same HTML element for two annotations can cause severe problems. For example, if a <span> is used to represent a line (or line break) and also a 'person' entity crossing the line break, the following happens:

<span class="line"> bla bla <span class="person">Angela </span> <span class="line">Merkel</span> bla bla </span>

It appears as though the first line's closing tag is closing the 'person' span's tag. If we just want persons to be marked in red etc., this can be avoided by surrounding each token of the person span with its own tag. Note that it is good to allow spans to not be token-wise by default, as this is not necessary for the line (and for some styling, e.g. a div with block, this would break the behavior of the line element).

Therefore, the following configuration:

line span; style="line" person span; style="person"; tokenwise

Should generate the following HTML:

<span class="line"> bla bla <span class="person">Angela</span></span> <span class="line"><span class="person">Merkel</span> bla bla </span>

The person span has been broken up token for token, and each token receives a duplicate of the span annotation triggered by the configuration file.

amir-zeldes avatar May 15 '13 10:05 amir-zeldes