-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Currently, to enforce adherence to legal restrictions like: "a KWIC may only be the search token +25 tokens left and right" are implemented with maxTokenContextSize=25 and maxTokenMatchSize=1 so that the highlighted and via the API exported match is always cut to a length of one token – even if the user searched for a sequence of more than one token:
What actually is needed is a property krill.kwic.max.token to reflect the legal restriction. To smoothly migrate the old behavior, if krill.context.max.token and/or krill.match.max.token is set, a deprecation warning should be issued and the property krill.kwic.max.token, if not set, should be calculated by 2*krill.context.max.token+krill.match.max.token. Then in the actual cutting of the search result, as much as possible of the match should be retained, and all remaining tokens should be distributed equally between left and right context, making sure the actual match size in tokens + context size never exceeds krill.kwic.max.token.