14#include <string/LinearString.h>
32 template <
class SymbolType,
class StateType >
37template <
class SymbolType,
class StateType >
42 size_t subjectSize = subject.
getContent ( ).size ( );
45 size_t posInSubject = 0;
47 while ( posInSubject + patternSize <= subjectSize ) {
51 size_t posInPattern = patternSize;
54 while ( posInPattern > 0 && ! fail ) {
55 auto transition = factorOracle.
getTransitions ( ).find ( { currentState, subject.
getContent ( ).
at ( posInSubject + posInPattern - 1 ) } );
60 currentState = transition->second;
67 occ.insert ( posInSubject );
69 posInSubject += posInPattern + 1;
Deterministic finite automaton. Accepts regular languages.
Definition: DFA.h:71
const ext::map< ext::pair< StateType, SymbolType >, StateType > & getTransitions() const &
Definition: DFA.h:473
const StateType & getInitialState() const &
Definition: DFA.h:105
Linear string.
Definition: LinearString.h:57
const ext::vector< SymbolType > & getContent() const &
Definition: LinearString.h:238
static unsigned length(const automaton::DFA< SymbolType, StateType > &automaton)
Definition: BackboneLength.h:40
Definition: BackwardOracleMatching.h:26
static ext::set< unsigned > match(const string::LinearString< SymbolType > &subject, const automaton::DFA< SymbolType, StateType > &factorOracle)
Definition: BackwardOracleMatching.h:38
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
Definition: ArithmeticCompression.h:18