Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
ExactFactorMatch.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <alib/set>
9
10#include <string/LinearString.h>
11
12namespace stringology {
13
14namespace exact {
15
17public:
22 template < class SymbolType >
24};
25
26template < class SymbolType >
29
30 for ( unsigned i = 0; i + pattern.getContent ( ).size ( ) <= subject.getContent ( ).size ( ); i++ ) {
31 unsigned j = 0;
32
33 for ( ; j < pattern.getContent ( ).size ( ); j++ )
34 if ( pattern.getContent ( )[j] != subject.getContent ( )[i + j] ) break;
35
36 if ( j == pattern.getContent ( ).size ( ) )
37 occ.insert ( i );
38 }
39
40 return occ;
41}
42
43} /* namespace exact */
44
45} /* namespace stringology */
46
Definition: set.hpp:44
Linear string.
Definition: LinearString.h:57
const ext::vector< SymbolType > & getContent() const &
Definition: LinearString.h:238
Definition: ExactFactorMatch.h:16
static ext::set< unsigned > match(const string::LinearString< SymbolType > &subject, const string::LinearString< SymbolType > &pattern)
Definition: ExactFactorMatch.h:27
int i
Definition: AllEpsilonClosure.h:118
Definition: ArithmeticCompression.h:18