Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* DeadZoneUsingBadCharacterShiftAndBorderArray.h
*
* Created on: 5. 11. 2014
* Author: Jan Travnicek
*/
#ifndef _DEAD_ZONE_USING_BAD_CHARACTER_SHIFT_AND_BORDER_ARRAY_H_
#define _DEAD_ZONE_USING_BAD_CHARACTER_SHIFT_AND_BORDER_ARRAY_H_
#include <set>
#include <vector>
#include <common/multipleDispatch.hpp>
#include <tree/TreeFeatures.h>
#include <alphabet/RankedSymbol.h>
namespace arbology {
namespace exact {
/**
* Implementation of DeadZone matching using bad character shift as shifting method on one direction and border array on the other
*/
class DeadZoneUsingBadCharacterShiftAndBorderArray : public std::DoubleDispatch < std::set < unsigned >, tree::TreeBase, tree::TreeBase > {
public:
/**
* Search for pattern in linear string.
* @return set set of occurences
*/
static std::set < unsigned > match ( const tree::Tree & subject, const tree::Tree & pattern );
static std::set < unsigned > match ( const tree::PrefixRankedBarTree & subject, const tree::PrefixRankedBarTree & pattern );
static std::set < unsigned > match ( const tree::PrefixRankedBarTree & subject, const tree::PrefixRankedBarPattern & pattern );
static void match_rec ( std::set < unsigned > & occ, const tree::PrefixRankedBarTree & subject, const tree::PrefixRankedBarPattern & pattern, std::vector < size_t > & fba, std::map < alphabet::RankedSymbol, size_t > & bbcs, std::vector < int > & subjectSubtreeJumpTable, int low, int high );
static DeadZoneUsingBadCharacterShiftAndBorderArray & getInstance ( ) {
static DeadZoneUsingBadCharacterShiftAndBorderArray res;
return res;
}
};
} /* namespace exact */
} /* namespace arbology */
#endif /* _DEAD_ZONE_USING_BAD_CHARACTER_SHIFT_AND_BORDER_ARRAY_H_ */