Matching on phrase/chunk instead of token

Is there a way to make a rule that matches a particular phrase/chunk instead of a token? Like if I want to match an arbitrary noun-phrase, instead of just a noun.

For example, I’m trying to make a rule that suggest replacing “gives X the ability to” with “lets X”. I can make X be a noun, but I don’t know how to match X with any noun phrase.

I’d like to be able to catch both “This gives it the ability to move” and “this gives my robot the ability to move”

Is this possible?

You can learn about chunks here: Using Chunks | dev.languagetool.org. However, it’s not always robust. For example, it doesn’t work well for your example…