93#ifndef __ADS_StringMatching
94 #define __ADS_StringMatching
105#include <string_view>
130 std::string_view P );
150inline std::vector< long >
failure( std::string_view P );
174inline std::vector< std::size_t >
kmp( std::string_view T ,
176 long * comparisons =
nullptr );
210inline std::vector< std::size_t >
kmpStrong( std::string_view T ,
212 long * comparisons =
nullptr );
240inline std::vector< std::size_t >
boyerMoore( std::string_view T ,
242 long * comparisons =
nullptr );
265inline std::vector< std::size_t >
horspool( std::string_view T ,
267 long * comparisons =
nullptr );
291inline std::vector< std::size_t >
shiftOr( std::string_view T ,
292 std::string_view P );
317inline std::vector< std::size_t >
zFunction( std::string_view S );
342inline std::vector< std::size_t >
zMatching( std::string_view T ,
343 std::string_view P );
381inline std::vector< std::size_t >
twoWay( std::string_view T ,
382 std::string_view P );
392#include "ADS/string/impl/StringMatching.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::vector< std::size_t > kmp(std::string_view T, std::string_view P, long *comparisons=nullptr)
the places of all the occurrences of in , by Knuth-Morris-Pratt; the comparisons of characters go to...
std::vector< std::size_t > zFunction(std::string_view S)
the Z-function: is the length of the longest common prefix of and , and
std::vector< std::size_t > shiftOr(std::string_view T, std::string_view P)
the places of all the occurrences of in , by Shift-Or
std::vector< std::size_t > horspool(std::string_view T, std::string_view P, long *comparisons=nullptr)
the places of all the occurrences of in , by Horspool
std::vector< long > strongFailure(std::string_view P)
the strong failure function: unless , in which case ;
std::vector< std::size_t > twoWay(std::string_view T, std::string_view P)
the places of all the occurrences of in , by the Two-Way algorithm of Crochemore and Perrin
std::vector< std::size_t > naiveMatching(std::string_view T, std::string_view P)
the places of all the occurrences of in , by trying every shift
std::vector< std::size_t > kmpStrong(std::string_view T, std::string_view P, long *comparisons=nullptr)
the occurrences of kmp() above, with the strong failure function on a mismatch
std::vector< long > failure(std::string_view P)
the failure function: is the length of the longest proper border of , and
std::vector< std::size_t > zMatching(std::string_view T, std::string_view P)
the places of all the occurrences of in , by the Z-function of and the Z-boxes of
std::vector< std::size_t > boyerMoore(std::string_view T, std::string_view P, long *comparisons=nullptr)
the places of all the occurrences of in , by Boyer-Moore with the bad character and the strong good ...