diff --git a/alib2algo/src/stringology/exact/BadCharacterShiftTable.cpp b/alib2algo/src/string/properties/BadCharacterShiftTable.cpp similarity index 93% rename from alib2algo/src/stringology/exact/BadCharacterShiftTable.cpp rename to alib2algo/src/string/properties/BadCharacterShiftTable.cpp index 9b0cca0bd6f69f536b27bf791defd29205a126d5..1a6b0a780a2765cb4392d7bf9c0259574a928ff7 100644 --- a/alib2algo/src/stringology/exact/BadCharacterShiftTable.cpp +++ b/alib2algo/src/string/properties/BadCharacterShiftTable.cpp @@ -10,9 +10,9 @@ #include <string/LinearString.h> #include <alphabet/Symbol.h> -namespace stringology { +namespace string { -namespace exact { +namespace properties { std::map<alphabet::Symbol, size_t> BadCharacterShiftTable::bcs(const string::String& pattern) { return dispatch(pattern.getData()); @@ -42,6 +42,6 @@ std::map<alphabet::Symbol, size_t> BadCharacterShiftTable::bcs(const string::Lin auto BadCharacterShiftTableLinearString = BadCharacterShiftTable::RegistratorWrapper<std::map<alphabet::Symbol, size_t>, string::LinearString < >>(BadCharacterShiftTable::bcs); -} /* namespace exact */ +} /* namespace properties */ -} /* namespace stringology */ +} /* namespace string */ diff --git a/alib2algo/src/stringology/exact/BadCharacterShiftTable.h b/alib2algo/src/string/properties/BadCharacterShiftTable.h similarity index 91% rename from alib2algo/src/stringology/exact/BadCharacterShiftTable.h rename to alib2algo/src/string/properties/BadCharacterShiftTable.h index 0cff252f69b7794b49bb688876c9aec55d5435b2..c98eca6caf0842b3685deed2d40779a806c4042c 100644 --- a/alib2algo/src/stringology/exact/BadCharacterShiftTable.h +++ b/alib2algo/src/string/properties/BadCharacterShiftTable.h @@ -15,9 +15,9 @@ #include <set> #include <map> -namespace stringology { +namespace string { -namespace exact { +namespace properties { /** * Computation of BCS table for BMH from MI(E+\eps)-EVY course 2014 @@ -35,8 +35,8 @@ public: }; -} /* namespace exact */ +} /* namespace properties */ -} /* namespace stringology */ +} /* namespace string */ #endif /* _STRINGOLOGY_BAD_CHARACTER_SHIFT_TABLE_H_ */ diff --git a/alib2algo/src/stringology/exact/BorderArray.cpp b/alib2algo/src/string/properties/BorderArray.cpp similarity index 90% rename from alib2algo/src/stringology/exact/BorderArray.cpp rename to alib2algo/src/string/properties/BorderArray.cpp index 8ca9734ab757b348b113979bfda6b0cadbd6e503..bed42f90fc9d65430da46d2861feecf14cfd4216 100644 --- a/alib2algo/src/stringology/exact/BorderArray.cpp +++ b/alib2algo/src/string/properties/BorderArray.cpp @@ -13,9 +13,9 @@ #include <primitive/Integer.h> #include <string/LinearString.h> -namespace stringology { +namespace string { -namespace exact { +namespace properties { std::vector<unsigned> BorderArray::construct(const string::String& string) { return dispatch(string.getData()); @@ -43,6 +43,6 @@ std::vector<unsigned> BorderArray::construct(const string::LinearString < >& str auto BorderArrayLinearString = BorderArray::RegistratorWrapper<std::vector<unsigned>, string::LinearString < >>(BorderArray::construct); -} /* namespace exact */ +} /* namespace properties */ -} /* namespace stringology */ +} /* namespace string */ diff --git a/alib2algo/src/stringology/exact/BorderArray.h b/alib2algo/src/string/properties/BorderArray.h similarity index 88% rename from alib2algo/src/stringology/exact/BorderArray.h rename to alib2algo/src/string/properties/BorderArray.h index b26156a91a1c1c71562fd97ac07694dc8fef4031..c3d1e6dadc54deaacfa368d3ba6976f009036478 100644 --- a/alib2algo/src/stringology/exact/BorderArray.h +++ b/alib2algo/src/string/properties/BorderArray.h @@ -12,9 +12,9 @@ #include <core/multipleDispatch.hpp> #include <string/StringFeatures.h> -namespace stringology { +namespace string { -namespace exact { +namespace properties { class BorderArray : public std::SingleDispatch<BorderArray, std::vector<unsigned>, const string::StringBase &> { public: @@ -28,8 +28,8 @@ public: static std::vector<unsigned> construct(const string::LinearString < >& string); }; -} /* namespace exact */ +} /* namespace properties */ -} /* namespace stringology */ +} /* namespace string */ #endif /* _BORDER_ARRAY_H_ */ diff --git a/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.cpp b/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.cpp similarity index 92% rename from alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.cpp rename to alib2algo/src/string/properties/ReversedBadCharacterShiftTable.cpp index 81c74bf1c083767dff0b12053a09b17c808f2402..b31067dc1116dda1bcb0cf1eaafcaeb2771796f4 100644 --- a/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.cpp +++ b/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.cpp @@ -10,9 +10,9 @@ #include <string/LinearString.h> #include <alphabet/Symbol.h> -namespace stringology { +namespace string { -namespace exact { +namespace properties { std::map < alphabet::Symbol, size_t > ReversedBadCharacterShiftTable::bcs ( const string::String & pattern ) { return dispatch ( pattern.getData ( ) ); @@ -35,6 +35,6 @@ std::map < alphabet::Symbol, size_t > ReversedBadCharacterShiftTable::bcs ( cons auto ReversedBadCharacterShiftTableLinearString = ReversedBadCharacterShiftTable::RegistratorWrapper < std::map < alphabet::Symbol, size_t >, string::LinearString < > > ( ReversedBadCharacterShiftTable::bcs ); -} /* namespace exact */ +} /* namespace properties */ -} /* namespace stringology */ +} /* namespace string */ diff --git a/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.h b/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.h similarity index 91% rename from alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.h rename to alib2algo/src/string/properties/ReversedBadCharacterShiftTable.h index 71d36f39bbb2a096d31f535590832f8d45c9c481..2609f6e265089d33bf2bb7d1af68c16b1c3f3763 100644 --- a/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.h +++ b/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.h @@ -15,9 +15,9 @@ #include <set> #include <map> -namespace stringology { +namespace string { -namespace exact { +namespace properties { /** * Computation of BCS table for BMH from MI(E+\eps)-EVY course 2014 @@ -35,8 +35,8 @@ public: }; -} /* namespace exact */ +} /* namespace properties */ -} /* namespace stringology */ +} /* namespace string */ #endif /* _STRINGOLOGY_REVERSED_BAD_CHARACTER_SHIFT_TABLE_H_ */ diff --git a/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp b/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp index 659389e526e91d0950730ff5ebfc556ca790b0c1..56831ebd76dce209782710b537b5399bd0ac6d1b 100644 --- a/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp +++ b/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp @@ -6,7 +6,7 @@ */ #include "BoyerMooreHorspool.h" -#include "BadCharacterShiftTable.h" +#include <string/properties/BadCharacterShiftTable.h> #include <string/LinearString.h> #include <alphabet/Symbol.h> @@ -26,7 +26,7 @@ std::set<unsigned> BoyerMooreHorspool::match(const string::LinearString < >& str std::set<unsigned> occ; measurements::start ( "Preprocess", measurements::Type::PREPROCESS ); - std::map<alphabet::Symbol, size_t> bcs = BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern + std::map<alphabet::Symbol, size_t> bcs = string::properties::BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern measurements::end ( ); measurements::start ( "Algorithm", measurements::Type::ALGORITHM ); diff --git a/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.cpp b/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.cpp index 38ae488a66886cba3ee908397213c3545d079128..831366295e14c0a0e99e1f1a86c47b2d64b30575 100644 --- a/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.cpp +++ b/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.cpp @@ -6,8 +6,8 @@ */ #include "DeadZoneUsingBadCharacterShift.h" -#include "BadCharacterShiftTable.h" -#include "ReversedBadCharacterShiftTable.h" +#include <string/properties/BadCharacterShiftTable.h> +#include <string/properties/ReversedBadCharacterShiftTable.h> #include <string/LinearString.h> #include <alphabet/Symbol.h> @@ -24,8 +24,8 @@ std::set < unsigned > DeadZoneUsingBadCharacterShift::match ( const string::Stri std::set < unsigned > DeadZoneUsingBadCharacterShift::match ( const string::LinearString < > & string, const string::LinearString < > & pattern ) { std::set < unsigned > occ; - std::map < alphabet::Symbol, size_t > fbcs = BadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern - std::map < alphabet::Symbol, size_t > bbcs = ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + std::map < alphabet::Symbol, size_t > fbcs = string::properties::BadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + std::map < alphabet::Symbol, size_t > bbcs = string::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern match_rec ( occ, string, pattern, fbcs, bbcs, 0, string.getContent ( ).size ( ) - pattern.getContent ( ).size ( ) + 1 ); return occ; diff --git a/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.cpp b/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.cpp index 09397943751ae628d3ea93c8c0a7e69c06ee8ee9..e0b4bb69f3e7deb670a1cbd1d6d82e6c4cf95c8d 100644 --- a/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.cpp +++ b/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.cpp @@ -8,7 +8,7 @@ #include "ExactMultiNondeterministicSubsequenceAutomaton.h" #include <string/LinearString.h> #include <string/Epsilon.h> -#include "../../common/ContainerConverter.hpp" +#include <common/ContainerConverter.hpp> namespace stringology { diff --git a/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.cpp b/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.cpp index 9b00bd4db0eba9f391d31c996eed103b26df9d86..fc189d7cad4c02fe4634fbcbae1e893e97338fc0 100644 --- a/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.cpp +++ b/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.cpp @@ -6,7 +6,7 @@ */ #include "ReversedBoyerMooreHorspool.h" -#include "ReversedBadCharacterShiftTable.h" +#include <string/properties/ReversedBadCharacterShiftTable.h> #include <string/LinearString.h> #include <alphabet/Symbol.h> @@ -23,7 +23,7 @@ std::set < unsigned > ReversedBoyerMooreHorspool::match ( const string::String & std::set < unsigned > ReversedBoyerMooreHorspool::match ( const string::LinearString < > & string, const string::LinearString < > & pattern ) { std::set < unsigned > occ; - std::map < alphabet::Symbol, size_t > bcs = ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + std::map < alphabet::Symbol, size_t > bcs = string::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern int haystack_offset = string.getContent ( ).size ( ) - pattern.getContent ( ).size ( ); diff --git a/alib2algo/test-src/stringology/exact/borderArrayTest.cpp b/alib2algo/test-src/string/properties/borderArrayTest.cpp similarity index 79% rename from alib2algo/test-src/stringology/exact/borderArrayTest.cpp rename to alib2algo/test-src/string/properties/borderArrayTest.cpp index 65aa2ab1743484cad2c7d72cc0286bf098cd819e..0381b37fbe32d2e3a2d2ab55de559a966c4f0115 100644 --- a/alib2algo/test-src/stringology/exact/borderArrayTest.cpp +++ b/alib2algo/test-src/string/properties/borderArrayTest.cpp @@ -1,7 +1,7 @@ #include "borderArrayTest.h" -#include "string/String.h" -#include "stringology/exact/BorderArray.h" +#include <string/String.h> +#include <string/properties/BorderArray.h> #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) @@ -16,7 +16,7 @@ void borderArrayTest::tearDown() { void borderArrayTest::testBorderArray() { string::String string = string::stringFrom("alfalfaalf"); - std::vector<unsigned> borderArray = stringology::exact::BorderArray::construct(string); + std::vector<unsigned> borderArray = string::properties::BorderArray::construct(string); std::vector<unsigned> expected {0, 0, 0, 0, 1, 2, 3, 1, 1, 2, 3}; CPPUNIT_ASSERT(borderArray != expected); diff --git a/alib2algo/test-src/stringology/exact/borderArrayTest.h b/alib2algo/test-src/string/properties/borderArrayTest.h similarity index 100% rename from alib2algo/test-src/stringology/exact/borderArrayTest.h rename to alib2algo/test-src/string/properties/borderArrayTest.h diff --git a/astringology2/src/astringology.cpp b/astringology2/src/astringology.cpp index 0598b774b02c5b9eefcee78a954dd1c4aecbf47b..16c9e749e2266a06a03eddf64d3da21c32a74a67 100644 --- a/astringology2/src/astringology.cpp +++ b/astringology2/src/astringology.cpp @@ -33,7 +33,7 @@ #include <stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.h> #include <stringology/exact/FactorOracleAutomaton.h> #include <stringology/exact/SuffixAutomaton.h> -#include <stringology/exact/BorderArray.h> +#include <string/properties/BorderArray.h> #include <stringology/indexing/SuffixTrie.h> int main ( int argc, char * argv[] ) { @@ -271,7 +271,7 @@ int main ( int argc, char * argv[] ) { measurements::end ( ); measurements::start ( "Algorithm", measurements::Type::MAIN ); - std::vector < unsigned > borderArray = stringology::exact::BorderArray::construct ( subject ); + std::vector < unsigned > borderArray = string::properties::BorderArray::construct ( subject ); measurements::end ( ); measurements::start ( "Output write", measurements::Type::AUXILIARY );