1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

* fix substring word boundaries issue

This commit is contained in:
Reinhard Pointner 2014-09-11 18:18:22 +00:00
parent 0cff9d3ce5
commit dccd755a6e

View File

@ -34,11 +34,11 @@ public class SubstringMetric implements SimilarityMetric {
if (index < 0)
return false;
// check before and after and make sure we're only matching between word boundries
if (index - 1 >= 0 && !Character.isLetterOrDigit(s1.charAt(index - 1)))
// check before and after and make sure we're only matching between word boundaries
if (index - 1 >= 0 && Character.isLetterOrDigit(s1.charAt(index - 1)))
return false;
if (index + s2.length() < s1.length() && !Character.isLetterOrDigit(index + s2.length()))
if (index + s2.length() < s1.length() && Character.isLetterOrDigit(s1.charAt(index + s2.length())))
return false;
return true;