Hi guys,

I have an annotation named Extent that covers a large span, and several
Head annotations covering small spans in side it.

For *example *(with simplified representation)

String extentCoveredText = "I saw Bob, and also Mary, John's sister."
Head[] heads = {Head(6, 9), Head(20, 39), Head(26, 30)}

I would like to produce the following String *output*:

"I saw [Bob], and also [Mary, [John]'s sister]."


As you can see, the Head spans can overlap and be nested. Adding all the
'[' and ']' seems like tedious bookkeeping - after adding one, all
positions change and must be manually updated. This update is especially
difficult due to the overlaps.

Is there any existing class that performs this?

Thank you,
Ofer Bronstein

Reply via email to