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

verbose backward string matching algorithms

parent 4b43871a
No related branches found
No related tags found
1 merge request!74Merge jt
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include <string/properties/BadCharacterShiftTable.h> #include <string/properties/BadCharacterShiftTable.h>
#include <string/properties/GoodSuffixShiftTable.h> #include <string/properties/GoodSuffixShiftTable.h>
   
#include <global/GlobalData.h>
namespace stringology { namespace stringology {
   
namespace exact { namespace exact {
...@@ -45,6 +47,11 @@ ext::set<unsigned> BoyerMoore::match(const string::LinearString < SymbolType >& ...@@ -45,6 +47,11 @@ ext::set<unsigned> BoyerMoore::match(const string::LinearString < SymbolType >&
ext::vector<size_t> gss = string::properties::GoodSuffixShiftTable::gss(pattern); ext::vector<size_t> gss = string::properties::GoodSuffixShiftTable::gss(pattern);
measurements::end ( ); measurements::end ( );
   
if(common::GlobalData::verbose) {
common::Streams::log << "bcs = " << bcs << std::endl;
common::Streams::log << "gss = " << gss << std::endl;
}
measurements::start ( "Algorithm", measurements::Type::ALGORITHM ); measurements::start ( "Algorithm", measurements::Type::ALGORITHM );
size_t haystack_offset = 0; size_t haystack_offset = 0;
while(haystack_offset + pattern.getContent().size() <= string.getContent().size()) { while(haystack_offset + pattern.getContent().size() <= string.getContent().size()) {
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
   
#include <string/properties/BadCharacterShiftTable.h> #include <string/properties/BadCharacterShiftTable.h>
   
#include <global/GlobalData.h>
namespace stringology { namespace stringology {
   
namespace exact { namespace exact {
...@@ -43,6 +45,9 @@ ext::set<unsigned> BoyerMooreHorspool::match(const string::LinearString < Symbol ...@@ -43,6 +45,9 @@ ext::set<unsigned> BoyerMooreHorspool::match(const string::LinearString < Symbol
ext::map<SymbolType, size_t> bcs = string::properties::BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern ext::map<SymbolType, size_t> bcs = string::properties::BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern
measurements::end ( ); measurements::end ( );
   
if(common::GlobalData::verbose)
common::Streams::log << "bcs = " << bcs << std::endl;
measurements::start ( "Algorithm", measurements::Type::ALGORITHM ); measurements::start ( "Algorithm", measurements::Type::ALGORITHM );
size_t haystack_offset = 0; size_t haystack_offset = 0;
while(haystack_offset + pattern.getContent().size() <= string.getContent().size()) { while(haystack_offset + pattern.getContent().size() <= string.getContent().size()) {
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
   
#include <string/properties/QuickSearchBadCharacterShiftTable.h> #include <string/properties/QuickSearchBadCharacterShiftTable.h>
   
#include <global/GlobalData.h>
namespace stringology { namespace stringology {
   
namespace exact { namespace exact {
...@@ -42,6 +44,9 @@ ext::set<unsigned> QuickSearch::match(const string::LinearString < SymbolType >& ...@@ -42,6 +44,9 @@ ext::set<unsigned> QuickSearch::match(const string::LinearString < SymbolType >&
ext::map<SymbolType, size_t> bcs = string::properties::QuickSearchBadCharacterShiftTable::qsbcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern ext::map<SymbolType, size_t> bcs = string::properties::QuickSearchBadCharacterShiftTable::qsbcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern
measurements::end ( ); measurements::end ( );
   
if(common::GlobalData::verbose)
common::Streams::log << "bcs = " << bcs << std::endl;
measurements::start ( "Algorithm", measurements::Type::ALGORITHM ); measurements::start ( "Algorithm", measurements::Type::ALGORITHM );
size_t i = 0; size_t i = 0;
size_t j; size_t j;
......
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