From dccd755a6e2b6f8c382282a2842ef2f71b630424 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 11 Sep 2014 18:18:22 +0000 Subject: [PATCH] * fix substring word boundaries issue --- source/net/filebot/similarity/SubstringMetric.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/similarity/SubstringMetric.java b/source/net/filebot/similarity/SubstringMetric.java index 67184ba8..4893e748 100644 --- a/source/net/filebot/similarity/SubstringMetric.java +++ b/source/net/filebot/similarity/SubstringMetric.java @@ -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;