Skip to content
Snippets Groups Projects
DeadZoneUsingBadCharacterShiftAndBorderArray.h 1.69 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 <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_ */