diff --git a/alib2data/src/indexes/stringology/SuffixTrie.h b/alib2data/src/indexes/stringology/SuffixTrie.h
index bd512157689c0eebb8e9f92311fdbf636cbf778f..d6ea4df4a4d6b7c85598c2f23f41ecfdcd3d683c 100644
--- a/alib2data/src/indexes/stringology/SuffixTrie.h
+++ b/alib2data/src/indexes/stringology/SuffixTrie.h
@@ -1,6 +1,22 @@
 /*
  * SuffixTrie.h
  *
+ * This file is part of Algorithms library toolkit.
+ * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
+
+ * Algorithms library toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+
+ * Algorithms library toolkit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with Algorithms library toolkit.  If not, see <http://www.gnu.org/licenses/>.
+ *
  *  Created on: Nov 23, 2013
  *      Author: Jan Travnicek
  */
@@ -50,79 +66,142 @@ namespace stringology {
 class GeneralAlphabet;
 
 /**
- * Represents regular expression parsed from the XML. Regular expression is stored
- * as a tree of RegExpElement.
+ * \brief
+ * Suffix trie string index. Tree like representation of all suffixes. Nodes of the trie are either containing index of the suffix or void. The parent child relationship of nodes is represented by single symbol.
+ *
+ * \tparam SymbolType type of symbols of indexed string
  */
 template < class SymbolType = DefaultSymbolType >
 class SuffixTrie final : public object::ObjectBase, public core::Components < SuffixTrie < SymbolType >, ext::set < SymbolType >, component::Set, GeneralAlphabet > {
-protected:
+	/**
+	 * Representation of the suffix trie.
+	 */
 	ext::trie < SymbolType, ext::variant < void, unsigned > > m_trie;
 
+	/**
+	 * \brief Checks edges of the raw suffix trie, whether they are over the specified alphabet.
+	 *
+	 * \throws exception::CommonException if there is a symbol on trie edges not present in the alphabet.
+	 */
+	void checkTrie ( const ext::trie < SymbolType, ext::variant < void, unsigned > > & trie );
+
 public:
 	/**
-	 * @copydoc SuffixTrie::clone() const
+	 * @copydoc ObjectBase::clone() const
 	 */
-	virtual ObjectBase * clone ( ) const;
+	virtual ObjectBase * clone ( ) const override;
 
 	/**
-	 * @copydoc SuffixTrie::plunder() const
+	 * @copydoc ObjectBase::plunder() &&
 	 */
-	virtual ObjectBase * plunder ( ) &&;
+	virtual ObjectBase * plunder ( ) && override;
 
+	/**
+	 * Creates a new instance of the index over concrete alphabet and content initialized to root containing void.
+	 *
+	 * \param edgeAlphabet the alphabet of symbols on node to node edges.
+	 */
 	explicit SuffixTrie ( ext::set < SymbolType > edgeAlphabet );
+
+	/**
+	 * Creates a new instance of the index over concrete alphabet and raw suffix trie.
+	 *
+	 * \param edgeAlphabet the alphabet of symbols on node to node edges.
+	 * \param trie the representation of suffix trie.
+	 */
 	explicit SuffixTrie ( ext::set < SymbolType > edgeAlphabet, ext::trie < SymbolType, ext::variant < void, unsigned > > trie );
-	explicit SuffixTrie ( ext::trie < SymbolType, ext::variant < void, unsigned > > trie );
 
-	void checkTrie ( const ext::trie < SymbolType, ext::variant < void, unsigned > > & trie );
+	/**
+	 * Creates a new instance of the index based on raw suffix trie.
+	 *
+	 * \param trie the representation of suffix trie.
+	 */
+	explicit SuffixTrie ( ext::trie < SymbolType, ext::variant < void, unsigned > > trie );
 
 	/**
-	 * @return Root node of the trie
+	 * Getter of the raw suffix trie.
+	 *
+	 * \return Root node of the trie
 	 */
 	const ext::trie < SymbolType, ext::variant < void, unsigned > > & getRoot ( ) const &;
 
+	/**
+	 * Getter of the raw suffix trie.
+	 *
+	 * \return Root node of the trie
+	 */
 	ext::trie < SymbolType, ext::variant < void, unsigned > > && getRoot ( ) &&;
 
+	/**
+	 * Getter of the alphabet of the indexed string.
+	 *
+	 * \returns the alphabet of the indexed string
+	 */
 	const ext::set < SymbolType > & getAlphabet ( ) const & {
 		return this->template accessComponent < GeneralAlphabet > ( ).get ( );
 	}
 
+	/**
+	 * Getter of the alphabet of the indexed string.
+	 *
+	 * \returns the alphabet of the indexed string
+	 */
 	ext::set < SymbolType > && getAlphabet ( ) && {
 		return std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) );
 	}
 
 	/**
-	 * Sets the root node of the regular expression tree
-	 * @param tree root node to set
+	 * Sets the root node of the suffix trie
+	 *
+	 * \param tree root node to set
 	 */
 	void setTree ( ext::trie < SymbolType, ext::variant < void, unsigned > > tree );
 
 	/**
-	 * Removes symbol from the alphabet of symbol available in the regular expression
-	 * @param symbol removed symbol from the alphabet
+	 * Sets the root node of the suffix trie
+	 *
+	 * \param tree root node to set
 	 */
 	bool removeSymbolFromEdgeAlphabet ( const SymbolType & symbol ) {
 		return this->template accessComponent < GeneralAlphabet > ( ).remove ( symbol );
 	}
 
 	/**
-	 * Prints XML representation of the tree to the output stream.
-	 * @param out output stream to which print the tree
-	 * @param tree tree to print
+	 * @copydoc alib::CommonBase<ObjectBase>::compare ( const ObjectBase & )
 	 */
-	virtual void operator >>( std::ostream & out ) const;
-
-	virtual int compare ( const ObjectBase & other ) const {
+	virtual int compare ( const ObjectBase & other ) const override {
 		if ( ext::type_index ( typeid ( * this ) ) == ext::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other );
 
 		return ext::type_index ( typeid ( * this ) ) - ext::type_index ( typeid ( other ) );
 	}
 
-	virtual int compare ( const SuffixTrie & other ) const;
+	/**
+	 * The actual compare method
+	 *
+	 * \param other the other instance
+	 *
+	 * \returns the actual relation between two by type same automata instances
+	 */
+	int compare ( const SuffixTrie & other ) const;
 
-	virtual explicit operator std::string ( ) const;
+	/**
+	 * @copydoc alib::CommonBase<ObjectBase>::operator >> ( std::ostream & )
+	 */
+	virtual void operator >>( std::ostream & out ) const override;
 
-	virtual object::ObjectBase * inc ( ) &&;
+	/**
+	 * @copydoc alib::CommonBase<ObjectBase>::operator std::string ( )
+	 */
+	virtual explicit operator std::string ( ) const override;
 
+	/**
+	 * @copydoc alib::ObjectBase::inc()
+	 */
+	virtual object::ObjectBase * inc ( ) && override;
+
+	/**
+	 * Type of normalized index.
+	 */
 	typedef SuffixTrie < > normalized_type;
 };
 
@@ -215,9 +294,22 @@ object::ObjectBase* SuffixTrie < SymbolType >::inc() && {
 
 namespace core {
 
+/**
+ * Helper class specifying constraints for the internal alphabet component of the index.
+ *
+ * \tparam SymbolType type of symbols of indexed string
+ */
 template < class SymbolType >
 class SetConstraint < indexes::stringology::SuffixTrie < SymbolType >, SymbolType, indexes::stringology::GeneralAlphabet > {
 
+	/**
+	 * Recursive implementation of the used constraint checker. Returns true if the symbol is still used on edges of the suffix trie bellow the node specified by parameter.
+	 *
+	 * \param trie the tested subtrie
+	 * \param symbol the tested symbol
+	 *
+	 * \returns true if the symbol is used, false othervise
+	 */
 	static bool used ( const ext::trie < SymbolType, ext::variant < void, unsigned > > & trie, const SymbolType & symbol ) {
 		for ( const std::pair < const SymbolType, ext::trie < SymbolType, ext::variant < void, unsigned > > > & child : trie.getChildren ( ) ) {
 			if ( symbol == child.first || checkTrie ( trie, child.second ) )
@@ -227,18 +319,45 @@ class SetConstraint < indexes::stringology::SuffixTrie < SymbolType >, SymbolTyp
 	}
 
 public:
+	/**
+	 * Returns true if the symbol is still used on edges of the suffix trie.
+	 *
+	 * \param index the tested index
+	 * \param symbol the tested symbol
+	 *
+	 * \returns true if the symbol is used, false othervise
+	 */
 	static bool used ( const indexes::stringology::SuffixTrie < SymbolType > & index, const SymbolType & symbol ) {
 		return used ( index.getRoot ( ), symbol );
 	}
 
+	/**
+	 * Returns true as all symbols are possibly available to be elements of the alphabet.
+	 *
+	 * \param index the tested index
+	 * \param symbol the tested symbol
+	 *
+	 * \returns true
+	 */
 	static bool available ( const indexes::stringology::SuffixTrie < SymbolType > &, const SymbolType & ) {
 		return true;
 	}
 
+	/**
+	 * All symbols are valid as symbols of the alphabet.
+	 *
+	 * \param index the tested index
+	 * \param symbol the tested symbol
+	 */
 	static void valid ( const indexes::stringology::SuffixTrie < SymbolType > &, const SymbolType & ) {
 	}
 };
 
+/**
+ * Helper for normalisation of types specified by templates used as internal datatypes of symbols and states.
+ *
+ * \returns new instance of the automaton with default template parameters or unmodified instance if the template parameters were already the default ones
+ */
 template < class SymbolType >
 struct normalize < indexes::stringology::SuffixTrie < SymbolType >, typename std::enable_if < ! std::is_same < indexes::stringology::SuffixTrie < SymbolType >, indexes::stringology::SuffixTrie < > >::value >::type > {
 	static indexes::stringology::SuffixTrie < > eval ( indexes::stringology::SuffixTrie < SymbolType > && value ) {