Grouping on captures
Use cases: user has some complex pattern to extract, for instance, verb-subject-object triples. It would be nice to be able to group directly on properties of one or more of the named captures.
Example:
Query:
(v:[pos="VERB"] o:[pos="NOUN"] | [word="dat"] s:[pos="NOUN"] o:[pos="NOUN"] v:[pos="VERB"])
Result
Piet v:eet o:worst.
Ik zag dat Klaas o:kaas v:at.
Group on v.lemma and o.lemma:
eten worst
eten kaas
Good idea, and shouldn't be too difficult I think. I might have a look soon.
I'm not sure if tagging different parts of the query with the same group name works at present; we should investigate that.
https://github.com/INL/BlackLab/tree/group-by-capture
Work in progress.
Should work, please test. :-)
(e.g. group by property capture:word:i:X to group on named capture X)
Do we need to expose this in the frontend?
That's above my pay grade. ;-)