Hi Daniel,
//w[@type = "NN"][(subsequence(preceding::w, 1, 3), subsequence(following::w, 1, 3))/@type = "ADJA"]
The preceding axis can be quite costly. You could try to use preceding-sibling and following-sibling instead (if it makes sense in your scenario). Another option could be to replace the subsequence function with a predicate: position() = 1 to 3].
I’d be glad to provide my dataset off list, if this helps.
Feel free to do so. Christian