From c4fe72540f6a1653582cf0d504d0c298a88aff7a Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Wed, 17 Jan 2018 20:54:24 +0100
Subject: [PATCH] fix by one error in occs reporting by BMH algo

---
 alib2algo/src/arbology/exact/BoyerMooreHorspool.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/alib2algo/src/arbology/exact/BoyerMooreHorspool.h b/alib2algo/src/arbology/exact/BoyerMooreHorspool.h
index e108e9d982..01a12bb42d 100644
--- a/alib2algo/src/arbology/exact/BoyerMooreHorspool.h
+++ b/alib2algo/src/arbology/exact/BoyerMooreHorspool.h
@@ -82,7 +82,7 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre
 		}
 
 		 // match was found
-		if ( j == -1 ) occ.insert ( offset );
+		if ( j == -1 ) occ.insert ( offset + 1);
 
 		 // shift heuristics
 		i += bcs[subject.getContent ( )[i + pattern.getContent ( ).size ( ) - 1]];
@@ -139,7 +139,7 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre
 		}
 
 		 // match was found
-		if ( j == -1 ) occ.insert ( offset );
+		if ( j == -1 ) occ.insert ( offset + 1);
 
 		 // shift heuristics
 		i += bcs[subject.getContent ( )[i + pattern.getContent ( ).size ( ) - 1]];
-- 
GitLab