st-annotated-text icon indicating copy to clipboard operation
st-annotated-text copied to clipboard

Feature request: handle overlapping annotations

Open swartchris8 opened this issue 4 years ago • 2 comments

I would love it if overlapping annotations could be handled though this would require substantial changes to annotation

swartchris8 avatar Aug 31 '21 10:08 swartchris8

Hmmm... yeah, that's a tough one API-wise. Any thoughts on how the API should look?

tvst avatar Sep 08 '21 00:09 tvst

The way that would be most natural to me is if annotations could be nested

lowest_level_annotation_tuple = ("is", "verb", "#8ef")
overlapping_annotation = (["This", lowest_level_annotation_tuple, "annotated"], "example", "#afa")

So annotations could be constructed from a list of space separated tokens and annotations instead of just constructing them from strings.

I know it complicates things quite a bit but would be nice for my use case!

swartchris8 avatar Sep 08 '21 09:09 swartchris8