Skip to content
Snippets Groups Projects
DeadZoneUsingBadCharacterShiftAndBorderArray.h 2.16 KiB
Newer Older
  • Learn to ignore specific revisions
  • /*
     * 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 <core/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 < DeadZoneUsingBadCharacterShiftAndBorderArray, std::set < unsigned >, const tree::TreeBase &, const 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 < std::ranked_symbol < >, size_t > & bbcs, std::vector < int > & subjectSubtreeJumpTable, int low, int high );
    
    	static std::set < unsigned > match ( const tree::PrefixRankedTree < > & subject, const tree::PrefixRankedTree < > & pattern );
    
    	static std::set < unsigned > match ( const tree::PrefixRankedTree < > & subject, const tree::PrefixRankedPattern < > & pattern );
    	static void match_rec ( std::set < unsigned > & occ, const tree::PrefixRankedTree < > & subject, const tree::PrefixRankedPattern < > & pattern, std::vector < size_t > & fba, std::map < std::ranked_symbol < >, size_t > & bbcs, std::vector < int > & subjectSubtreeJumpTable, int low, int high );
    
    };
    
    } /* namespace exact */
    
    } /* namespace arbology */
    
    #endif /* _DEAD_ZONE_USING_BAD_CHARACTER_SHIFT_AND_BORDER_ARRAY_H_ */