Skip to content
Snippets Groups Projects
Commit 812e0083 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

refactoring boyer moore horspool

parent 56440f25
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre
// match of symbol
offset = offset - 1;
j = j - 1;
} else if ( ( pattern.getContent ( )[j] == pattern.getVariablesBar ( ) ) && ( pattern.getBars ( ).count ( subject.getContent ( )[offset] )) ) {
} else if ( ( pattern.getContent ( )[j] == pattern.getVariablesBar ( ) ) && ( pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) ) {
// match of variable with subtree
offset = subjectSubtreeJumpTable[offset];
j = j - 2;
......@@ -95,9 +95,9 @@ template < class SymbolType, class RankType >
ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) {
ext::set < unsigned > occ;
ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::BadCharacterShiftTable::bcs ( pattern ); //NOTE: the subjects alphabet must be a subset or equal to the pattern
ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject );
ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting;
 
ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject );
tree::PrefixRankedBarTree < unsigned, RankType > repeats = tree::properties::ExactSubtreeRepeatsNaive::repeats ( subject );
 
// index to the subject
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment