BlackLab
BlackLab copied to clipboard
Highlight document contents with hit number attribute
(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>
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).
I've made a small start with this, but complex nesting makes this nontrivial.