BlackLab icon indicating copy to clipboard operation
BlackLab copied to clipboard

Highlight document contents with hit number attribute

Open jan-niestadt opened this issue 1 year ago • 1 comments

(see https://github.com/INL/corpus-frontend/issues/527)

/docs/DOCID/contents should add a hit number to <hl> tags, which will allow the frontend to deal with overlapping hits and hits that e.g. span across <s> tags.

<s><hl n="1">The fox <hl n="2">jumps</hl></hl><hl n="2"> over the dog.</hl></s>

jan-niestadt avatar Aug 26 '24 10:08 jan-niestadt

Start (and end) position would also be useful; frontend would use this to jump to a specific hit in a fragment, for example (@KCMertens in INL/corpus-frontend#527).

jan-niestadt avatar Sep 05 '24 08:09 jan-niestadt

I've made a small start with this, but complex nesting makes this nontrivial.

jan-niestadt avatar Apr 07 '25 10:04 jan-niestadt