apache / incubator-annotator

Apache Annotator provides annotation enabling code for browsers, servers, and humans.
https://annotator.apache.org/
Apache License 2.0
222 stars 39 forks source link

Provide a fast method to describe text quotes #91

Closed tilgovi closed 4 years ago

tilgovi commented 4 years ago

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.