Back to LanguageTool Homepage - Privacy - Imprint

Exception Rule - Help with syntax

I am trying to specify a rule which says that the word “portable” must be preceded somewhere by variants of the word “large”. Here’s what I’ve tried in German.


I want to match “Das neue Acme Smartphone mit Android-Betriebssystem NuPhone T Ultra ist elegant, tragbar und leicht.” but not match “… großen Display ist das Dual-SIM-Smartphone {120} überraschend leicht, tragbar und elegant.”.

I guess this cannot be expressed by our XML syntax, but I might be wrong. You might want to subscribe to our mailing list to ask for help (, or you might want to write a Java rule which can easily do this.

Just to help my understanding. In the context of scope, “previous” and “next” mean literally as opposed to “preceding” or “following” which would explain why my rule doesn’t work? Do the combination of skip="-5" and scope=“previous” make any difference?

I actually didn’t try the combination of skip and scope, maybe it works. Here’s an example:

But I think the problem is a logical one: if there can be any number of tokens between “groß” and “tragbar”, you need to skip. But then there will always be a word that’s not “groß” somewhere and you’ll get a match. What you would need is a way to negate to whole pattern, not just a token, but we don’t have that.