26#include <ext/iostream>
27#include <ext/algorithm>
32#include <alib/optional>
54template <
class SymbolType = DefaultSymbolType >
55class SuffixTrie final :
public core::Components < SuffixTrie < SymbolType >, ext::set < SymbolType >, component::Set, GeneralAlphabet > {
111 return this->
template accessComponent < GeneralAlphabet > ( ).get ( );
120 return std::move ( this->
template accessComponent < GeneralAlphabet > ( ).
get ( ) );
136 return this->
template accessComponent < GeneralAlphabet > ( ).remove ( symbol );
170 return out <<
"(SuffixTrie " << instance.m_trie <<
")";
182template <
class SymbolType >
186template <
class SymbolType >
188 checkTrie ( this->m_trie );
191template <
class SymbolType >
195template <
class SymbolType >
198 if ( ! getAlphabet ( ).count ( child.first ) )
200 checkTrie ( child.second );
204template <
class SymbolType >
209template <
class SymbolType >
211 return std::move ( m_trie );
214template <
class SymbolType >
217 this->m_trie = std::move ( trie ).clone ( );
231template <
class SymbolType >
244 if ( symbol == child.first || checkTrie ( trie, child.second ) )
290template <
class SymbolType >
static ext::set< DefaultSymbolType > normalizeAlphabet(ext::set< SymbolType > &&symbols)
Definition: SymbolNormalize.h:50
Definition: components.hpp:181
static bool used(const indexes::stringology::SuffixTrie< SymbolType > &index, const SymbolType &symbol)
Definition: SuffixTrie.h:259
static void valid(const indexes::stringology::SuffixTrie< SymbolType > &, const SymbolType &)
Definition: SuffixTrie.h:281
static bool available(const indexes::stringology::SuffixTrie< SymbolType > &, const SymbolType &)
Definition: SuffixTrie.h:271
Definition: setComponents.hpp:26
static bool used(const Derived &object, const ComponentType &element)
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
Class introducing a trie with interface trying to be close to the interface of standard library conta...
Definition: trie.hpp:47
static ext::trie< DefaultSymbolType, unsigned > normalizeTrie(ext::trie< SymbolType, unsigned > &&trie)
Definition: IndexesNormalize.h:60
Suffix trie string index. Tree like representation of all suffixes. Nodes of the trie are optionally ...
Definition: SuffixTrie.h:55
const ext::set< SymbolType > & getAlphabet() const &
Definition: SuffixTrie.h:110
void setTree(ext::trie< SymbolType, std::optional< unsigned > > trie)
Definition: SuffixTrie.h:215
const ext::trie< SymbolType, std::optional< unsigned > > & getRoot() const &
Definition: SuffixTrie.h:205
auto operator<=>(const SuffixTrie &other) const
Definition: SuffixTrie.h:146
bool removeSymbolFromEdgeAlphabet(const SymbolType &symbol)
Definition: SuffixTrie.h:135
SuffixTrie(ext::set< SymbolType > edgeAlphabet)
Definition: SuffixTrie.h:183
ext::set< SymbolType > && getAlphabet() &&
Definition: SuffixTrie.h:119
friend ext::ostream & operator<<(ext::ostream &out, const SuffixTrie &instance)
Definition: SuffixTrie.h:169
bool operator==(const SuffixTrie &other) const
Definition: SuffixTrie.h:157
Definition: BarSymbol.cpp:12
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
Definition: normalize.hpp:10
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
Definition: CompressedBitParallelTreeIndex.h:40
auto & get(ext::ptr_array< Type, N > &tpl)
Specialisation of get function for pointer arrays.
Definition: ptr_array.hpp:693
Definition: ArithmeticCompression.h:18
static indexes::stringology::SuffixTrie< > eval(indexes::stringology::SuffixTrie< SymbolType > &&value)
Definition: SuffixTrie.h:292
Definition: normalize.hpp:13