Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
CompactSuffixAutomatonFactors.h
Go to the documentation of this file.
1
7#include <string/LinearString.h>
8
9namespace stringology {
10
11namespace query {
12
14public:
15
16 template < class SymbolType >
18 try {
19 unsigned curState = 0;
20 unsigned index = 0;
21
22 while(index < pattern.getContent ().size()) {
23 curState = a.GetNextState(curState,pattern.getContent(),index);
24 }
26 a.GetAllPathsLen(curState,index,res);
27
28 return res;
29 } catch ( ... ) {
30 return { };
31 }
32 }
33};
34
35} /* namespace query */
36
37} /* namespace stringology */
Definition: set.hpp:44
Definition: CompactSuffixAutomatonTerminatingSymbol.h:33
unsigned GetNextState(unsigned state, const ext::vector< SymbolType > &pattern, unsigned &index) const
Definition: CompactSuffixAutomatonTerminatingSymbol.h:101
void GetAllPathsLen(unsigned state, unsigned curLen, ext::set< unsigned > &res) const
Definition: CompactSuffixAutomatonTerminatingSymbol.h:92
Linear string.
Definition: LinearString.h:57
const ext::vector< SymbolType > & getContent() const &
Definition: LinearString.h:238
Definition: CompactSuffixAutomatonFactors.h:13
static ext::set< unsigned > query(const indexes::stringology::CompactSuffixAutomatonTerminatingSymbol< SymbolType > &a, const string::LinearString< SymbolType > &pattern)
Definition: CompactSuffixAutomatonFactors.h:17
return res
Definition: MinimizeByPartitioning.h:145
Definition: ArithmeticCompression.h:18