Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions | Friends
indexes::stringology::SuffixTrie< SymbolType > Class Template Referencefinal

Suffix trie string index. Tree like representation of all suffixes. Nodes of the trie are optionally containing index of the suffix. The parent child relationship of nodes is represented by single symbol. The class does not checks whether the trie actually is suffix trie. More...

#include <SuffixTrie.h>

Inheritance diagram for indexes::stringology::SuffixTrie< SymbolType >:
[legend]
Collaboration diagram for indexes::stringology::SuffixTrie< SymbolType >:
[legend]

Public Member Functions

 SuffixTrie (ext::set< SymbolType > edgeAlphabet)
 
 SuffixTrie (ext::set< SymbolType > edgeAlphabet, ext::trie< SymbolType, std::optional< unsigned > > trie)
 
 SuffixTrie (ext::trie< SymbolType, std::optional< unsigned > > trie)
 
const ext::trie< SymbolType, std::optional< unsigned > > & getRoot () const &
 
ext::trie< SymbolType, std::optional< unsigned > > && getRoot () &&
 
const ext::set< SymbolType > & getAlphabet () const &
 
ext::set< SymbolType > && getAlphabet () &&
 
void setTree (ext::trie< SymbolType, std::optional< unsigned > > trie)
 
bool removeSymbolFromEdgeAlphabet (const SymbolType &symbol)
 
auto operator<=> (const SuffixTrie &other) const
 
bool operator== (const SuffixTrie &other) const
 
- Public Member Functions inherited from core::Components< SuffixTrie< DefaultSymbolType >, ext::set< DefaultSymbolType >, component::Set, GeneralAlphabet >
void accessComponent ()
 

Friends

ext::ostreamoperator<< (ext::ostream &out, const SuffixTrie &instance)
 

Additional Inherited Members

- Static Public Member Functions inherited from core::Components< SuffixTrie< DefaultSymbolType >, ext::set< DefaultSymbolType >, component::Set, GeneralAlphabet >
static void registerComponent ()
 
static void unregisterComponent ()
 

Detailed Description

template<class SymbolType = DefaultSymbolType>
class indexes::stringology::SuffixTrie< SymbolType >

Suffix trie string index. Tree like representation of all suffixes. Nodes of the trie are optionally containing index of the suffix. The parent child relationship of nodes is represented by single symbol. The class does not checks whether the trie actually is suffix trie.

Template Parameters
SymbolTypetype of symbols of indexed string

Constructor & Destructor Documentation

◆ SuffixTrie() [1/3]

template<class SymbolType >
indexes::stringology::SuffixTrie< SymbolType >::SuffixTrie ( ext::set< SymbolType >  edgeAlphabet)
explicit

Creates a new instance of the index over concrete alphabet and content initialized to empty root.

Parameters
edgeAlphabetthe alphabet of symbols on node to node edges.

◆ SuffixTrie() [2/3]

template<class SymbolType >
indexes::stringology::SuffixTrie< SymbolType >::SuffixTrie ( ext::set< SymbolType >  edgeAlphabet,
ext::trie< SymbolType, std::optional< unsigned > >  trie 
)
explicit

Creates a new instance of the index over concrete alphabet and raw suffix trie.

Parameters
edgeAlphabetthe alphabet of symbols on node to node edges.
triethe representation of suffix trie.

◆ SuffixTrie() [3/3]

template<class SymbolType >
indexes::stringology::SuffixTrie< SymbolType >::SuffixTrie ( ext::trie< SymbolType, std::optional< unsigned > >  trie)
explicit

Creates a new instance of the index based on raw suffix trie.

Parameters
triethe representation of suffix trie.

Member Function Documentation

◆ getAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::set< SymbolType > && indexes::stringology::SuffixTrie< SymbolType >::getAlphabet ( ) &&
inline

Getter of the alphabet of the indexed string.

Returns
the alphabet of the indexed string
Here is the call graph for this function:

◆ getAlphabet() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::set< SymbolType > & indexes::stringology::SuffixTrie< SymbolType >::getAlphabet ( ) const &
inline

Getter of the alphabet of the indexed string.

Returns
the alphabet of the indexed string
Here is the caller graph for this function:

◆ getRoot() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::trie< SymbolType, std::optional< unsigned > > && indexes::stringology::SuffixTrie< SymbolType >::getRoot ( ) &&

Getter of the raw suffix trie.

Returns
root node of the trie

◆ getRoot() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::trie< SymbolType, std::optional< unsigned > > & indexes::stringology::SuffixTrie< SymbolType >::getRoot ( ) const &

Getter of the raw suffix trie.

Returns
root node of the trie
Here is the caller graph for this function:

◆ operator<=>()

template<class SymbolType = DefaultSymbolType>
auto indexes::stringology::SuffixTrie< SymbolType >::operator<=> ( const SuffixTrie< SymbolType > &  other) const
inline

The three way comparison implementation

Parameters
otherthe other instance
Returns
the ordering between this object and the other.
Here is the call graph for this function:

◆ operator==()

template<class SymbolType = DefaultSymbolType>
bool indexes::stringology::SuffixTrie< SymbolType >::operator== ( const SuffixTrie< SymbolType > &  other) const
inline

The equality comparison implementation.

Parameters
otherthe other object to compare with.
Returns
true if this and other objects are equal, false othervise
Here is the call graph for this function:

◆ removeSymbolFromEdgeAlphabet()

template<class SymbolType = DefaultSymbolType>
bool indexes::stringology::SuffixTrie< SymbolType >::removeSymbolFromEdgeAlphabet ( const SymbolType &  symbol)
inline

Remover of a symbol from the alphabet.

Parameters
symbola symbol to remove.

◆ setTree()

template<class SymbolType >
void indexes::stringology::SuffixTrie< SymbolType >::setTree ( ext::trie< SymbolType, std::optional< unsigned > >  trie)

Sets the root node of the suffix trie

Parameters
treeroot node to set

Friends And Related Function Documentation

◆ operator<<

template<class SymbolType = DefaultSymbolType>
ext::ostream & operator<< ( ext::ostream out,
const SuffixTrie< SymbolType > &  instance 
)
friend

Print this object as raw representation to ostream.

Parameters
outostream where to print
instanceobject to print
Returns
modified output stream

The documentation for this class was generated from the following file: