Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hit marking in HTML visualizations #105

Closed
amir-zeldes opened this issue May 15, 2013 · 1 comment
Closed

Hit marking in HTML visualizations #105

amir-zeldes opened this issue May 15, 2013 · 1 comment

Comments

@amir-zeldes
Copy link
Collaborator

There should be a special way to configure hit marking in the HTML visualizations. Regions of tokens overlapping any hit node (#1, #2 etc.) should be either unmarked, marked in one color (default red) or marked in the standard ANNIS hit colors with the standard color overlap behavior (red, purple, green, etc.). If the last possibility is difficult, an implementation of the uniform coloring (one color) might be preferred as a first step.

A syntax suggestion for the config file:

tok span; style="tok"
annis:hit none
...

Or

annis:hit red #(if an unknown color is used, default is "red")

Or

annis:hit multicolor #(usual behavior with red, purple, green)

Within the HTML visualizations we should allow the marking strategy to use token-wise elements (so a separate coloring element for each red token etc.) as suggested in issue #104 for tokenwise HTML spans. This could look like this:

annis:hit red; tokenwise

This generates (never mind what element is realized with):

bla bla my hit bla bla

Instead of:

bla bla my hit bla bla

Both options should be available, as some visualizations might work better with the first options and some with the second.

@ghost ghost assigned thomaskrause May 29, 2013
@amir-zeldes
Copy link
Collaborator Author

Updated specification:

We should plan for two scenarios, at least for an initial prototype:

  1. Hit marking should be colored by ANNIS colors by default in HTML vis. To do this, add the standard ANNIS hit marking CSS classes (just like v-table-cell-content-match_1 in the grid/kwic visualizer) and the colors are inherited from the ANNIS stylesheet. It should be possible to turn off this behavior in resolver_vis_map using a mapping, so it could say: config:dipl;hitmarking:false
  2. In the second scenario, the user wants to add special formatting to their HTML visualizer's hits. As a simple example, let's say they want the hits to be bold. This is orthogonal to the hit marking colors, so they can still receive colors based on default hitmarking, unless it's been configured to false in resolver_vis_map. The syntax for hit formatting rules could look like this in the visualizer's .config file:
annis:HIT   span; style="my_hit_style"

As usual, leaving the third column of the config file empty just means that the hit area is wrapped in the declared element (in this case ) and no text is outputted inside the span (that is taken care of by some instruction starting with "tok" presumably).

Another important point is that hit marking can easily conflict with other annotation spans, leading to HTML hierarchy conflicts. Because of this, it's important to give an option to produce hit spans token-wise. We could use the third column, which is redundant for hit marking: the user can either write nothing in column 3, or use the reserved "tokenwise".

annis:HIT   span; style="my_hit_style"  tokenwise

If "tokenwise" is declared, then a hit-generated element is placed at every token position, e.g.:

This is a sentence and the hit is in these <span class="my_hit">two</span><span class="my_hit">words</span> only.

In cases like these, it's assumed that another instruction is outputting tokens. If not and a longer span contains the words (because of units smaller than words acting as tokens), then this strategy is benign, since you'll get:

The hit covers two token positions <span class="my_hit">here</span><span class="my_hit"></span> because the letter 'h' in 'here' was annotated as red.

In this case the second token generates and empty, harmless span.

@thomaskrause thomaskrause removed their assignment Sep 4, 2015
@zangsir zangsir self-assigned this Sep 5, 2015
@thomaskrause thomaskrause added this to the 3.4.0-preview4 milestone Oct 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants