The existing function to describe text quotes can lock up the runtime if given a very small quote with a lot of matches to disambiguate between. The absolutely worst case scenario is to give it an empty range, which causes the implementation to compare the context to the context around every single other position within the text!
For most use cases, it's probably not important to find a minimal solution. Let's provide some function to get a context more simply.
The existing function to describe text quotes can lock up the runtime if given a very small quote with a lot of matches to disambiguate between. The absolutely worst case scenario is to give it an empty range, which causes the implementation to compare the context to the context around every single other position within the text!
For most use cases, it's probably not important to find a minimal solution. Let's provide some function to get a context more simply.