I’ve added a class
ResultCache that can be used to speed up checking if sentences get checked more than once. The HTTP server already uses this. Checking a sentence more than once is actually common when a user makes corrections based on LT’s suggestion but the whole text needs to be re-checked.
The original idea was to cache the results for every sentence, but this won’t work correctly with rules that work on the text level instead of the sentence level. So for now, only the analyzed sentence is cached and the rules still need to run. Yet, for languages with a slow analysis like English the cache can help a lot. Maybe I manage to cache rule matches too (minus the sentence-level ones).