Hi, Christian,
Many thanks for your reply and code.
I'll try your code and learn more about BaseX.
Does your code use a full-text index? If not, it is expected to take a lot of time to query a large corpus with more than one million sentences.
Is it possible to use full-text index for search attributes?
That would be much more suitable for searching a pos-tagged corpus.
Best, Sam