25 template <
class StringIndexQueryAlgo,
class SymbolType,
template <
typename >
class StringIndex >
37 for (
const std::pair < unsigned, unsigned > & occurrence : prevOcc ) {
38 rev [ occurrence.second ] = occurrence.first;
41 for (
const std::pair < unsigned, unsigned > & subOccurrence : subOcc ) {
42 if ( rev [ subOccurrence.first ] !=
static_cast < unsigned > ( -1 ) )
43 res.push_back (
std::make_pair ( rev [ subOccurrence.first ], subOccurrence.second ) );
46 for (
const std::pair < unsigned, unsigned > & occurrence : prevOcc ) {
47 rev [ occurrence.second ] =
static_cast < unsigned > ( -1 );
66template <
class SymbolType,
template <
typename >
class StringIndex,
class StringIndexQueryAlgo >
76 treePatternParts.back ( ).push_back ( symbol );
82 for (
unsigned i = 1;
i < treePatternParts.size ( ); ++
i ) {
83 for ( std::pair < unsigned, unsigned > & occurrence : prevOcc )
84 occurrence.second = fullAndLinearIndex.
getJumps ( ) [ occurrence.second ];
86 if ( ! treePatternParts [
i ].empty ( ) )
87 prevOcc = MergeOccurrences ( prevOcc, FullAndLinearIndexPatterns::FindOccurrences < StringIndexQueryAlgo > ( fullAndLinearIndex.
getStringIndex ( ), treePatternParts [
i ] ), rev );
91 for (
const std::pair < unsigned, unsigned > & occurrence : prevOcc ) {
92 res.insert ( occurrence.first );
98template <
class SymbolType,
template <
typename >
class StringIndex,
class StringIndexQueryAlgo >
109 treePatternParts.back ( ).push_back ( * symbolIter );
115 for (
unsigned i = 1;
i < treePatternParts.size ( ); ++
i ) {
116 for ( std::pair < unsigned, unsigned > & occurrence : prevOcc )
117 occurrence.second = fullAndLinearIndex.
getJumps ( ) [ occurrence.second ];
119 if ( ! treePatternParts [
i ].empty ( ) )
120 prevOcc = MergeOccurrences ( prevOcc, FullAndLinearIndexPatterns::FindOccurrences < StringIndexQueryAlgo > ( fullAndLinearIndex.
getStringIndex ( ), treePatternParts [
i ] ), rev );
124 for (
const std::pair < unsigned, unsigned > & occurrence : prevOcc ) {
125 res.insert ( occurrence.first );
Definition: FullAndLinearIndexPatterns.h:24
static ext::set< unsigned > query(const indexes::arbology::FullAndLinearIndex< SymbolType, StringIndex > &fullAndLinearIndex, const tree::PrefixRankedPattern< SymbolType > &pattern)
Definition: FullAndLinearIndexPatterns.h:67
Definition: ranked_symbol.hpp:20
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Full and linear tree index. The index serves as a adaptor of string index so that searching for tree ...
Definition: FullAndLinearIndex.h:49
const StringIndex< common::ranked_symbol< SymbolType > > & getStringIndex() const &
Definition: FullAndLinearIndex.h:179
const ext::vector< int > & getJumps() const &
Definition: FullAndLinearIndex.h:189
Linear string.
Definition: LinearString.h:57
Definition: PositionHeapFactors.h:24
Tree pattern represented as linear sequece as result of preorder traversal with additional bar symbol...
Definition: PrefixRankedBarPattern.h:85
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: PrefixRankedBarPattern.h:202
const ext::vector< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: PrefixRankedBarPattern.h:334
Tree pattern represented as linear sequece as result of preorder traversal. The representation is so ...
Definition: PrefixRankedPattern.h:77
const ext::vector< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: PrefixRankedPattern.h:262
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: PrefixRankedPattern.h:154
Definition: BoyerMooreHorspool.h:22
int i
Definition: AllEpsilonClosure.h:118
return res
Definition: MinimizeByPartitioning.h:145
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79