-
-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$startpos adjustment may return minus value. #297
Comments
ok, please send a pull request |
infinitail
added a commit
to infinitail/tntsearch
that referenced
this issue
Sep 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In extractRelevant() function $startpos variable is adjusted for keep text length. But some case like below, it may return minus value and bogus hilighted text.
$textlength = 323
$startpos = 95
$locations = 145
$rellength = 300
adjusted $startpos = 95 - (323 - 95) / 2 = -19
I suggest add max() for fix this issue.
The text was updated successfully, but these errors were encountered: