On Sat, Apr 25, 2020 at 06:02:14PM -0400, Liam R. E. Quin scripsit:
On Sat, 2020-04-25 at 13:46 -0400, Graydon Saunders wrote:
I think I have figured out a way to connect the adjacent marked words in the phrasal term into a single mark element. I cannot convince myself that this is the right way; is there a better approach than tumbling windows?
I just search for the multi-word phrase and surround that. Enclosed is a sample from a prototype for a keyword in context search index for fromoldbooks.org (not yet live). Lookognow i see it's not very neat but maybe it'll give some ideas.
It does, but alas I can't use string-join. Some of the terms have hyphens, so I'm getting <mark>A</mark>-<mark>List</mark> coming out of the full text search, which must become <mark>A-List</mark>. Plus some of the terms have the form "nine-pence and six-pence", so any solution has to be general for interstitial text nodes.
(I can't rule out any punctuation. I know there are hyphens, but don't know there are ONLY hyphens.)
Thanks!
Graydon