How to create rules for the whole text?

I’ll got some Ideas for LT which needs to compare more then one sentence. But I don’t know how this can be realized.
For example some Ideas:

  • A blank before or after a paragraph
  • Matching of opening and closing quotes, double quotes, brackets etc. (In the German grammar is a great rule for this problem, but it works only for one sentence. In a novel for example If there is a longer speech the rule has to work over more then one sentence, sometimes some paragraphs could be involved)
  • Empty lines (this is not really a bug, but a bad style in office products)
    It would be very helpful, if there was the possibilities to use something like a regexp for the whole text.

In general, the XML rules only work on the sentence level. To go beyond that, you’d need to write a Java rule. For parentheses etc., we already have GenericUnpairedBracketsRule which in my opinion works quite well.