From a4cd9127dcb09a2bc28d6f302bac52dac8eaf468 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Fri, 2 Sep 2016 10:05:11 +0200
Subject: [PATCH] make strings templated

---
 aaccess2/src/StringAccess.cpp                 |   8 +-
 aaccess2/src/StringAccess.h                   |   4 +-
 aderivation2/src/aderivation.cpp              |   2 +-
 agenerate2/src/agenerate.cpp                  |   4 +-
 aintegral2/src/aintegral.cpp                  |   2 +-
 alib2algo/src/automaton/run/Accept.cpp        |  30 +--
 alib2algo/src/automaton/run/Accept.h          |  16 +-
 alib2algo/src/automaton/run/Occurrences.cpp   |  22 +-
 alib2algo/src/automaton/run/Occurrences.h     |  12 +-
 alib2algo/src/automaton/run/Result.cpp        |  20 +-
 alib2algo/src/automaton/run/Result.h          |  10 +-
 alib2algo/src/automaton/run/Run.cpp           |  14 +-
 alib2algo/src/automaton/run/Run.h             |  14 +-
 alib2algo/src/automaton/run/Translate.cpp     |  12 +-
 alib2algo/src/automaton/run/Translate.h       |   8 +-
 .../grammar/generate/CockeYoungerKasami.cpp   |   4 +-
 .../src/grammar/generate/CockeYoungerKasami.h |   6 +-
 .../grammar/generate/GenerateUpToLength.cpp   |  20 +-
 .../src/grammar/generate/GenerateUpToLength.h |   6 +-
 .../regexp/convert/ToAutomatonDerivation.cpp  |   4 +-
 .../convert/ToGrammarRightRGDerivation.cpp    |   4 +-
 .../src/regexp/transform/RegExpDerivation.cpp |   6 +-
 .../src/regexp/transform/RegExpDerivation.h   |   8 +-
 .../src/regexp/transform/RegExpIntegral.cpp   |   6 +-
 .../src/regexp/transform/RegExpIntegral.h     |   8 +-
 .../string/generate/RandomStringFactory.cpp   |  10 +-
 .../src/string/generate/RandomStringFactory.h |   6 +-
 .../generate/RandomSubstringFactory.cpp       |   6 +-
 .../string/generate/RandomSubstringFactory.h  |   2 +-
 alib2algo/src/string/naive/ExactCompare.cpp   |   8 +-
 alib2algo/src/string/naive/ExactCompare.h     |   4 +-
 alib2algo/src/string/naive/ExactEqual.cpp     |   8 +-
 alib2algo/src/string/naive/ExactEqual.h       |   4 +-
 .../src/string/simplify/NormalizeAlphabet.cpp |   6 +-
 .../src/string/simplify/NormalizeAlphabet.h   |   2 +-
 .../src/string/simplify/NormalizeRotation.cpp |   6 +-
 .../src/string/simplify/NormalizeRotation.h   |   2 +-
 .../exact/BackwardDAWGMatching.cpp            |   6 +-
 .../stringology/exact/BackwardDAWGMatching.h  |   2 +-
 .../BackwardNondeterministicDAWGMatching.cpp  |  12 +-
 .../BackwardNondeterministicDAWGMatching.hpp  |  10 +-
 .../exact/BackwardOracleMatching.cpp          |   6 +-
 .../exact/BackwardOracleMatching.h            |   2 +-
 .../exact/BadCharacterShiftTable.cpp          |   4 +-
 .../exact/BadCharacterShiftTable.h            |   2 +-
 .../src/stringology/exact/BorderArray.cpp     |   4 +-
 alib2algo/src/stringology/exact/BorderArray.h |   2 +-
 .../stringology/exact/BoyerMooreHorspool.cpp  |   4 +-
 .../stringology/exact/BoyerMooreHorspool.h    |   2 +-
 .../exact/DeadZoneUsingBadCharacterShift.cpp  |   6 +-
 .../exact/DeadZoneUsingBadCharacterShift.h    |   4 +-
 .../exact/ExactFactorAutomaton.cpp            |   4 +-
 .../stringology/exact/ExactFactorAutomaton.h  |   2 +-
 .../stringology/exact/ExactFactorMatch.cpp    |   4 +-
 .../src/stringology/exact/ExactFactorMatch.h  |   2 +-
 .../exact/ExactMatchingAutomaton.cpp          |   4 +-
 .../exact/ExactMatchingAutomaton.h            |   2 +-
 ...tiNondeterministicSubsequenceAutomaton.cpp |   6 +-
 ...ultiNondeterministicSubsequenceAutomaton.h |   2 +-
 ...ctNondeterministicSubsequenceAutomaton.cpp |   4 +-
 ...xactNondeterministicSubsequenceAutomaton.h |   2 +-
 .../exact/ExactSubsequenceAutomaton.cpp       |   4 +-
 .../exact/ExactSubsequenceAutomaton.h         |   2 +-
 .../exact/FactorOracleAutomaton.cpp           |   4 +-
 .../stringology/exact/FactorOracleAutomaton.h |   2 +-
 .../exact/ReversedBadCharacterShiftTable.cpp  |   4 +-
 .../exact/ReversedBadCharacterShiftTable.h    |   2 +-
 .../exact/ReversedBoyerMooreHorspool.cpp      |   4 +-
 .../exact/ReversedBoyerMooreHorspool.h        |   2 +-
 .../src/stringology/exact/SuffixAutomaton.cpp |   6 +-
 .../src/stringology/exact/SuffixAutomaton.h   |   4 +-
 .../src/stringology/indexing/SuffixTrie.cpp   |   4 +-
 .../src/stringology/indexing/SuffixTrie.h     |   2 +-
 .../generate/GrammarGenerateUpToLength.cpp    |  62 +++---
 .../regexp/transform/RegExpDerivationTest.cpp |   2 +-
 .../regexp/transform/RegExpIntegralTest.cpp   |   2 +-
 .../test-src/string/compare/compareTest.cpp   |  28 +--
 .../exact/FactorOracleAutomatonTest.cpp       |   2 +-
 .../stringology/exact/SuffixAutomatonTest.cpp |   2 +-
 alib2data/src/regexp/RegExp.cpp               |  22 +-
 alib2data/src/regexp/RegExp.h                 |   2 +-
 alib2data/src/string/CyclicString.cpp         | 108 +---------
 alib2data/src/string/CyclicString.h           | 150 +++++++++++--
 alib2data/src/string/LinearString.cpp         | 164 ++------------
 alib2data/src/string/LinearString.h           | 201 ++++++++++++++++--
 .../string/LinearStringTerminatingSymbol.cpp  |   2 +-
 .../string/LinearStringTerminatingSymbol.h    |   7 +-
 alib2data/src/string/String.cpp               |  16 +-
 alib2data/src/string/StringFeatures.h         |   3 +
 alib2data/test-src/string/StringTest.cpp      |   4 +-
 alib2raw/src/string/StringFromRawParser.cpp   |   2 +-
 alib2raw/src/string/StringToRawComposer.cpp   |   4 +-
 alib2raw/src/string/StringToRawComposer.h     |   2 +-
 .../src/string/StringFromStringParser.cpp     |   4 +-
 .../src/string/StringToStringComposer.cpp     |   8 +-
 alib2str/src/string/StringToStringComposer.h  |   4 +-
 arand2/src/arand.cpp                          |   2 +-
 arun2/src/arun.cpp                            |   2 +-
 98 files changed, 638 insertions(+), 619 deletions(-)

diff --git a/aaccess2/src/StringAccess.cpp b/aaccess2/src/StringAccess.cpp
index 811ab70790..88b670a2d4 100644
--- a/aaccess2/src/StringAccess.cpp
+++ b/aaccess2/src/StringAccess.cpp
@@ -22,18 +22,18 @@ void StringAccess::access ( const string::String & string, const std::set < Stri
 	dispatch ( string.getData ( ), settings );
 }
 
-void StringAccess::access ( const string::LinearString & string, const std::set < StringSettings::Settings > & settings ) {
+void StringAccess::access ( const string::LinearString < > & string, const std::set < StringSettings::Settings > & settings ) {
 	if ( settings.count ( StringSettings::Settings::ALPHABET ) ) alib::XmlDataFactory::toStdout ( string.getAlphabet ( ) );
 
 	if ( settings.count ( StringSettings::Settings::CONTENT ) ) alib::XmlDataFactory::toStdout ( string.getContent ( ) );
 }
 
-auto StringAccessFormalString = StringAccess::RegistratorWrapper < void, string::LinearString > ( StringAccess::access );
+auto StringAccessFormalString = StringAccess::RegistratorWrapper < void, string::LinearString < > > ( StringAccess::access );
 
-void StringAccess::access ( const string::CyclicString & string, const std::set < StringSettings::Settings > & settings ) {
+void StringAccess::access ( const string::CyclicString < > & string, const std::set < StringSettings::Settings > & settings ) {
 	if ( settings.count ( StringSettings::Settings::ALPHABET ) ) alib::XmlDataFactory::toStdout ( string.getAlphabet ( ) );
 
 	if ( settings.count ( StringSettings::Settings::CONTENT ) ) alib::XmlDataFactory::toStdout ( string.getContent ( ) );
 }
 
-auto StringAccessUnboundedString = StringAccess::RegistratorWrapper < void, string::CyclicString > ( StringAccess::access );
+auto StringAccessUnboundedString = StringAccess::RegistratorWrapper < void, string::CyclicString < > > ( StringAccess::access );
diff --git a/aaccess2/src/StringAccess.h b/aaccess2/src/StringAccess.h
index ecced5ee2f..85e7998e1a 100644
--- a/aaccess2/src/StringAccess.h
+++ b/aaccess2/src/StringAccess.h
@@ -20,8 +20,8 @@ class StringAccess : public std::SingleDispatchLastStaticParam < StringAccess, v
 public:
 	static void access ( const string::String & string, const std::set < StringSettings::Settings > & settings );
 
-	static void access ( const string::LinearString & string, const std::set < StringSettings::Settings > & settings );
-	static void access ( const string::CyclicString & string, const std::set < StringSettings::Settings > & settings );
+	static void access ( const string::LinearString < > & string, const std::set < StringSettings::Settings > & settings );
+	static void access ( const string::CyclicString < > & string, const std::set < StringSettings::Settings > & settings );
 };
 
 #endif /* STRING_ACCESS_H_ */
diff --git a/aderivation2/src/aderivation.cpp b/aderivation2/src/aderivation.cpp
index e4b8010f7e..2b3aa2f478 100644
--- a/aderivation2/src/aderivation.cpp
+++ b/aderivation2/src/aderivation.cpp
@@ -43,7 +43,7 @@ int main(int argc, char** argv) {
 		measurements::start("Overal", measurements::Type::OVERALL);
 		measurements::start("Input read", measurements::Type::AUXILIARY);
 
-		string::LinearString stringData = alib::XmlDataFactory::fromTokens<string::LinearString>(sax::FromXMLParserHelper::parseInput(string));
+		string::LinearString < > stringData = alib::XmlDataFactory::fromTokens<string::LinearString < >>(sax::FromXMLParserHelper::parseInput(string));
 		regexp::RegExp regexpData = alib::XmlDataFactory::fromTokens<regexp::RegExp>(sax::FromXMLParserHelper::parseInput(regexp));
 
 		measurements::end();
diff --git a/agenerate2/src/agenerate.cpp b/agenerate2/src/agenerate.cpp
index 9cb35ea75c..cc0243a7b8 100644
--- a/agenerate2/src/agenerate.cpp
+++ b/agenerate2/src/agenerate.cpp
@@ -67,7 +67,7 @@ int main ( int argc, char * argv[] ) {
 			measurements::end ( );
 			measurements::start ( "Algorithm", measurements::Type::MAIN );
 
-			std::set < string::LinearString > res = grammar::generate::GenerateUpToLength::generate ( grammar, upto.getValue ( ) );
+			std::set < string::LinearString < > > res = grammar::generate::GenerateUpToLength::generate ( grammar, upto.getValue ( ) );
 
 			measurements::end ( );
 			measurements::start ( "Output write", measurements::Type::AUXILIARY );
@@ -75,7 +75,7 @@ int main ( int argc, char * argv[] ) {
 			alib::XmlDataFactory::toStdout ( res );
 		} else if ( type.getValue ( ) == "CYK" ) {
 			grammar::Grammar grammar = alib::XmlDataFactory::fromTokens < grammar::Grammar > ( sax::FromXMLParserHelper::parseInput(grammarInput) );
-			string::LinearString string = alib::XmlDataFactory::fromTokens < string::LinearString > ( sax::FromXMLParserHelper::parseInput(stringInput) );
+			string::LinearString < > string = alib::XmlDataFactory::fromTokens < string::LinearString < > > ( sax::FromXMLParserHelper::parseInput(stringInput) );
 
 			measurements::end ( );
 			measurements::start ( "Algorithm", measurements::Type::MAIN );
diff --git a/aintegral2/src/aintegral.cpp b/aintegral2/src/aintegral.cpp
index 4e7824901e..1a394871f5 100644
--- a/aintegral2/src/aintegral.cpp
+++ b/aintegral2/src/aintegral.cpp
@@ -43,7 +43,7 @@ int main(int argc, char** argv) {
 		measurements::start("Overal", measurements::Type::OVERALL);
 		measurements::start("Input read", measurements::Type::AUXILIARY);
 
-		string::LinearString stringData = alib::XmlDataFactory::fromTokens<string::LinearString>(sax::FromXMLParserHelper::parseInput(string));
+		string::LinearString < > stringData = alib::XmlDataFactory::fromTokens<string::LinearString < >>(sax::FromXMLParserHelper::parseInput(string));
 		regexp::RegExp regexpData = alib::XmlDataFactory::fromTokens<regexp::RegExp>(sax::FromXMLParserHelper::parseInput(regexp));
 
 		measurements::end();
diff --git a/alib2algo/src/automaton/run/Accept.cpp b/alib2algo/src/automaton/run/Accept.cpp
index f8b7772d65..6711981fd5 100644
--- a/alib2algo/src/automaton/run/Accept.cpp
+++ b/alib2algo/src/automaton/run/Accept.cpp
@@ -29,7 +29,7 @@ bool Accept::accept ( const automaton::Automaton & automaton, const alib::Object
 	return dispatch ( automaton.getData ( ), object.getData ( ) );
 }
 
-bool Accept::accept ( const automaton::Automaton & automaton, const string::LinearString & string ) {
+bool Accept::accept ( const automaton::Automaton & automaton, const string::LinearString < > & string ) {
 	return dispatch ( automaton.getData ( ), string );
 }
 
@@ -37,15 +37,15 @@ bool Accept::accept ( const automaton::Automaton & automaton, const tree::Ranked
 	return dispatch ( automaton.getData ( ), tree );
 }
 
-bool Accept::accept ( const automaton::DFA<> & automaton, const string::LinearString & string ) {
+bool Accept::accept ( const automaton::DFA<> & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 0 > ( res ) && automaton.getFinalStates ( ).count ( std::get < 1 > ( res ) );
 }
 
-auto AcceptDFALinearString = Accept::RegistratorWrapper < bool, automaton::DFA<>, string::LinearString > ( Accept::accept );
+auto AcceptDFALinearString = Accept::RegistratorWrapper < bool, automaton::DFA<>, string::LinearString < > > ( Accept::accept );
 
-bool Accept::accept ( const automaton::NFA < > & automaton, const string::LinearString & string ) {
+bool Accept::accept ( const automaton::NFA < > & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, std::set < label::Label >, std::set < unsigned > > res = Run::calculateStates ( automaton, string );
 
 	return std::get < 0 > ( res ) && std::any_of ( std::get < 1 > ( res ).begin ( ), std::get < 1 > ( res ).end ( ), [&] ( const label::Label & state ) {
@@ -53,7 +53,7 @@ bool Accept::accept ( const automaton::NFA < > & automaton, const string::Linear
 			} );
 }
 
-auto AcceptNFALinearString = Accept::RegistratorWrapper < bool, automaton::NFA < > , string::LinearString > ( Accept::accept );
+auto AcceptNFALinearString = Accept::RegistratorWrapper < bool, automaton::NFA < > , string::LinearString < > > ( Accept::accept );
 
 bool Accept::accept ( const automaton::DFTA & automaton, const tree::RankedTree & tree ) {
 	std::tuple < bool, label::Label, std::set < unsigned > > res = Run::calculateState ( automaton, tree );
@@ -73,44 +73,44 @@ bool Accept::accept ( const automaton::NFTA & automaton, const tree::RankedTree
 
 auto AcceptNFTARankedTree = Accept::RegistratorWrapper < bool, automaton::NFTA, tree::RankedTree > ( Accept::accept );
 
-bool Accept::accept ( const automaton::InputDrivenDPDA & automaton, const string::LinearString & string ) {
+bool Accept::accept ( const automaton::InputDrivenDPDA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 0 > ( res ) && ( automaton.getFinalStates ( ).count ( std::get < 1 > ( res ) ) || ( automaton.getFinalStates ( ).size ( ) == 0 && std::get < 3 > ( res ).size ( ) == 0 ) );
 }
 
-auto AcceptInputDrivenDPDALinearString = Accept::RegistratorWrapper < bool, automaton::InputDrivenDPDA, string::LinearString > ( Accept::accept );
+auto AcceptInputDrivenDPDALinearString = Accept::RegistratorWrapper < bool, automaton::InputDrivenDPDA, string::LinearString < > > ( Accept::accept );
 
-bool Accept::accept ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString & string ) {
+bool Accept::accept ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 0 > ( res ) && automaton.getFinalStates ( ).count ( std::get < 1 > ( res ) );
 }
 
-auto AcceptVisiblyPushdownDPDALinearString = Accept::RegistratorWrapper < bool, automaton::VisiblyPushdownDPDA, string::LinearString > ( Accept::accept );
+auto AcceptVisiblyPushdownDPDALinearString = Accept::RegistratorWrapper < bool, automaton::VisiblyPushdownDPDA, string::LinearString < > > ( Accept::accept );
 
-bool Accept::accept ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString & string ) {
+bool Accept::accept ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 0 > ( res ) && automaton.getFinalStates ( ).count ( std::get < 1 > ( res ) );
 }
 
-auto AcceptRealTimeHeightDeterministicDPDALinearString = Accept::RegistratorWrapper < bool, automaton::RealTimeHeightDeterministicDPDA, string::LinearString > ( Accept::accept );
+auto AcceptRealTimeHeightDeterministicDPDALinearString = Accept::RegistratorWrapper < bool, automaton::RealTimeHeightDeterministicDPDA, string::LinearString < > > ( Accept::accept );
 
-bool Accept::accept ( const automaton::DPDA & automaton, const string::LinearString & string ) {
+bool Accept::accept ( const automaton::DPDA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 0 > ( res ) && ( automaton.getFinalStates ( ).count ( std::get < 1 > ( res ) ) || ( automaton.getFinalStates ( ).size ( ) == 0 && std::get < 3 > ( res ).size ( ) == 0 ) );
 }
 
-auto AcceptDPDALinearString = Accept::RegistratorWrapper < bool, automaton::DPDA, string::LinearString > ( Accept::accept );
+auto AcceptDPDALinearString = Accept::RegistratorWrapper < bool, automaton::DPDA, string::LinearString < > > ( Accept::accept );
 
-bool Accept::accept ( const automaton::NPDTA & automaton, const string::LinearString & string ) {
+bool Accept::accept ( const automaton::NPDTA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, std::set < label::Label >, std::set < std::vector < alphabet::Symbol > > > res = Run::calculateStates ( automaton, string );
 	return std::get<0>(res);
 }
 
-auto AcceptNPDTALinearString = Accept::RegistratorWrapper < bool, automaton::NPDTA, string::LinearString > ( Accept::accept );
+auto AcceptNPDTALinearString = Accept::RegistratorWrapper < bool, automaton::NPDTA, string::LinearString < > > ( Accept::accept );
 
 } /* namespace run */
 
diff --git a/alib2algo/src/automaton/run/Accept.h b/alib2algo/src/automaton/run/Accept.h
index 102239ab20..b12fb9c0f7 100644
--- a/alib2algo/src/automaton/run/Accept.h
+++ b/alib2algo/src/automaton/run/Accept.h
@@ -26,18 +26,18 @@ public:
 	 * @return left regular grammar equivalent to source automaton.
 	 */
 	static bool accept ( const automaton::Automaton & automaton, const alib::Object & object );
-	static bool accept ( const automaton::Automaton & automaton, const string::LinearString & string );
+	static bool accept ( const automaton::Automaton & automaton, const string::LinearString < > & string );
 	static bool accept ( const automaton::Automaton & automaton, const tree::RankedTree & string );
 
-	static bool accept ( const automaton::DFA<> & automaton, const string::LinearString & string );
-	static bool accept ( const automaton::NFA < > & automaton, const string::LinearString & string );
+	static bool accept ( const automaton::DFA<> & automaton, const string::LinearString < > & string );
+	static bool accept ( const automaton::NFA < > & automaton, const string::LinearString < > & string );
 	static bool accept ( const automaton::DFTA & automaton, const tree::RankedTree & tree );
 	static bool accept ( const automaton::NFTA & automaton, const tree::RankedTree & tree );
-	static bool accept ( const automaton::InputDrivenDPDA & automaton, const string::LinearString & string );
-	static bool accept ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString & string );
-	static bool accept ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString & string );
-	static bool accept ( const automaton::DPDA & automaton, const string::LinearString & string );
-	static bool accept ( const automaton::NPDTA & automaton, const string::LinearString & string );
+	static bool accept ( const automaton::InputDrivenDPDA & automaton, const string::LinearString < > & string );
+	static bool accept ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString < > & string );
+	static bool accept ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString < > & string );
+	static bool accept ( const automaton::DPDA & automaton, const string::LinearString < > & string );
+	static bool accept ( const automaton::NPDTA & automaton, const string::LinearString < > & string );
 
 };
 
diff --git a/alib2algo/src/automaton/run/Occurrences.cpp b/alib2algo/src/automaton/run/Occurrences.cpp
index 311a7b55e5..bed11e74dc 100644
--- a/alib2algo/src/automaton/run/Occurrences.cpp
+++ b/alib2algo/src/automaton/run/Occurrences.cpp
@@ -25,7 +25,7 @@ std::set < unsigned > Occurrences::occurrences ( const automaton::Automaton & au
 	return dispatch ( automaton.getData ( ), object.getData ( ) );
 }
 
-std::set < unsigned > Occurrences::occurrences ( const automaton::Automaton & automaton, const string::LinearString & string ) {
+std::set < unsigned > Occurrences::occurrences ( const automaton::Automaton & automaton, const string::LinearString < > & string ) {
 	return dispatch ( automaton.getData ( ), string );
 }
 
@@ -33,13 +33,13 @@ std::set < unsigned > Occurrences::occurrences ( const automaton::Automaton & au
 	return dispatch ( automaton.getData ( ), tree );
 }
 
-std::set < unsigned > Occurrences::occurrences ( const automaton::DFA < > & automaton, const string::LinearString & string ) {
+std::set < unsigned > Occurrences::occurrences ( const automaton::DFA < > & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 2 > ( res );
 }
 
-auto OccurrencesDFALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::DFA<>, string::LinearString > ( Occurrences::occurrences );
+auto OccurrencesDFALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::DFA<>, string::LinearString < > > ( Occurrences::occurrences );
 
 std::set < unsigned > Occurrences::occurrences ( const automaton::DFTA & automaton, const tree::RankedTree & tree ) {
 	std::tuple < bool, label::Label, std::set < unsigned > > res = Run::calculateState ( automaton, tree );
@@ -49,37 +49,37 @@ std::set < unsigned > Occurrences::occurrences ( const automaton::DFTA & automat
 
 auto OccurrencesDFTARankedTree = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::DFTA, tree::RankedTree > ( Occurrences::occurrences );
 
-std::set < unsigned > Occurrences::occurrences ( const automaton::InputDrivenDPDA & automaton, const string::LinearString & string ) {
+std::set < unsigned > Occurrences::occurrences ( const automaton::InputDrivenDPDA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 2 > ( res );
 }
 
-auto OccurrencesInputDrivenDPDALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::InputDrivenDPDA, string::LinearString > ( Occurrences::occurrences );
+auto OccurrencesInputDrivenDPDALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::InputDrivenDPDA, string::LinearString < > > ( Occurrences::occurrences );
 
-std::set < unsigned > Occurrences::occurrences ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString & string ) {
+std::set < unsigned > Occurrences::occurrences ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 2 > ( res );
 }
 
-auto OccurrencesVisiblyPushdownDPDALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::VisiblyPushdownDPDA, string::LinearString > ( Occurrences::occurrences );
+auto OccurrencesVisiblyPushdownDPDALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::VisiblyPushdownDPDA, string::LinearString < > > ( Occurrences::occurrences );
 
-std::set < unsigned > Occurrences::occurrences ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString & string ) {
+std::set < unsigned > Occurrences::occurrences ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 2 > ( res );
 }
 
-auto OccurrencesRealTimeHeightDeterministicDPDALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::RealTimeHeightDeterministicDPDA, string::LinearString > ( Occurrences::occurrences );
+auto OccurrencesRealTimeHeightDeterministicDPDALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::RealTimeHeightDeterministicDPDA, string::LinearString < > > ( Occurrences::occurrences );
 
-std::set < unsigned > Occurrences::occurrences ( const automaton::DPDA & automaton, const string::LinearString & string ) {
+std::set < unsigned > Occurrences::occurrences ( const automaton::DPDA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	return std::get < 2 > ( res );
 }
 
-auto OccurrencesDPDALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::DPDA, string::LinearString > ( Occurrences::occurrences );
+auto OccurrencesDPDALinearString = Occurrences::RegistratorWrapper < std::set < unsigned >, automaton::DPDA, string::LinearString < > > ( Occurrences::occurrences );
 
 } /* namespace run */
 
diff --git a/alib2algo/src/automaton/run/Occurrences.h b/alib2algo/src/automaton/run/Occurrences.h
index c89fcad4c3..61d458a9d3 100644
--- a/alib2algo/src/automaton/run/Occurrences.h
+++ b/alib2algo/src/automaton/run/Occurrences.h
@@ -26,15 +26,15 @@ public:
 	 * @return left regular grammar equivalent to source automaton.
 	 */
 	static std::set < unsigned > occurrences ( const automaton::Automaton & automaton, const alib::Object & object );
-	static std::set < unsigned > occurrences ( const automaton::Automaton & automaton, const string::LinearString & string );
+	static std::set < unsigned > occurrences ( const automaton::Automaton & automaton, const string::LinearString < > & string );
 	static std::set < unsigned > occurrences ( const automaton::Automaton & automaton, const tree::RankedTree & string );
 
-	static std::set < unsigned > occurrences ( const automaton::DFA<> & automaton, const string::LinearString & string );
+	static std::set < unsigned > occurrences ( const automaton::DFA<> & automaton, const string::LinearString < > & string );
 	static std::set < unsigned > occurrences ( const automaton::DFTA & automaton, const tree::RankedTree & tree );
-	static std::set < unsigned > occurrences ( const automaton::InputDrivenDPDA & automaton, const string::LinearString & string );
-	static std::set < unsigned > occurrences ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString & string );
-	static std::set < unsigned > occurrences ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString & string );
-	static std::set < unsigned > occurrences ( const automaton::DPDA & automaton, const string::LinearString & string );
+	static std::set < unsigned > occurrences ( const automaton::InputDrivenDPDA & automaton, const string::LinearString < > & string );
+	static std::set < unsigned > occurrences ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString < > & string );
+	static std::set < unsigned > occurrences ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString < > & string );
+	static std::set < unsigned > occurrences ( const automaton::DPDA & automaton, const string::LinearString < > & string );
 
 };
 
diff --git a/alib2algo/src/automaton/run/Result.cpp b/alib2algo/src/automaton/run/Result.cpp
index bca3759288..8a37ce6b4e 100644
--- a/alib2algo/src/automaton/run/Result.cpp
+++ b/alib2algo/src/automaton/run/Result.cpp
@@ -25,7 +25,7 @@ label::Label Result::result ( const automaton::Automaton & automaton, const alib
 	return dispatch ( automaton.getData ( ), object.getData ( ), failLabel );
 }
 
-label::Label Result::result ( const automaton::DFA < > & automaton, const string::LinearString & string, const label::Label & failLabel ) {
+label::Label Result::result ( const automaton::DFA < > & automaton, const string::LinearString < > & string, const label::Label & failLabel ) {
 	std::tuple < bool, label::Label, std::set < unsigned > > res = Run::calculateState ( automaton, string );
 
 	if ( std::get < 0 > ( res ) ) return std::get < 1 > ( res );
@@ -33,7 +33,7 @@ label::Label Result::result ( const automaton::DFA < > & automaton, const string
 	return failLabel;
 }
 
-auto ResultDFALinearString = Result::RegistratorWrapper < label::Label, automaton::DFA<>, string::LinearString > ( Result::result );
+auto ResultDFALinearString = Result::RegistratorWrapper < label::Label, automaton::DFA<>, string::LinearString < > > ( Result::result );
 
 label::Label Result::result ( const automaton::DFTA & automaton, const tree::RankedTree & tree, const label::Label & failLabel ) {
 	std::tuple < bool, label::Label, std::set < unsigned > > res = Run::calculateState ( automaton, tree );
@@ -45,7 +45,7 @@ label::Label Result::result ( const automaton::DFTA & automaton, const tree::Ran
 
 auto ResultDFTARankedTree = Result::RegistratorWrapper < label::Label, automaton::DFTA, tree::RankedTree > ( Result::result );
 
-label::Label Result::result ( const automaton::InputDrivenDPDA & automaton, const string::LinearString & string, const label::Label & failLabel ) {
+label::Label Result::result ( const automaton::InputDrivenDPDA & automaton, const string::LinearString < > & string, const label::Label & failLabel ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	if ( std::get < 0 > ( res ) ) return std::get < 1 > ( res );
@@ -53,9 +53,9 @@ label::Label Result::result ( const automaton::InputDrivenDPDA & automaton, cons
 	return failLabel;
 }
 
-auto ResultInputDrivenDPDALinearString = Result::RegistratorWrapper < label::Label, automaton::InputDrivenDPDA, string::LinearString > ( Result::result );
+auto ResultInputDrivenDPDALinearString = Result::RegistratorWrapper < label::Label, automaton::InputDrivenDPDA, string::LinearString < > > ( Result::result );
 
-label::Label Result::result ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString & string, const label::Label & failLabel ) {
+label::Label Result::result ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString < > & string, const label::Label & failLabel ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	if ( std::get < 0 > ( res ) ) return std::get < 1 > ( res );
@@ -63,9 +63,9 @@ label::Label Result::result ( const automaton::VisiblyPushdownDPDA & automaton,
 	return failLabel;
 }
 
-auto ResultVisiblyPushdownDPDALinearString = Result::RegistratorWrapper < label::Label, automaton::VisiblyPushdownDPDA, string::LinearString > ( Result::result );
+auto ResultVisiblyPushdownDPDALinearString = Result::RegistratorWrapper < label::Label, automaton::VisiblyPushdownDPDA, string::LinearString < > > ( Result::result );
 
-label::Label Result::result ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString & string, const label::Label & failLabel ) {
+label::Label Result::result ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString < > & string, const label::Label & failLabel ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	if ( std::get < 0 > ( res ) ) return std::get < 1 > ( res );
@@ -73,9 +73,9 @@ label::Label Result::result ( const automaton::RealTimeHeightDeterministicDPDA &
 	return failLabel;
 }
 
-auto ResultRealTimeHeightDeterministicDPDALinearString = Result::RegistratorWrapper < label::Label, automaton::RealTimeHeightDeterministicDPDA, string::LinearString > ( Result::result );
+auto ResultRealTimeHeightDeterministicDPDALinearString = Result::RegistratorWrapper < label::Label, automaton::RealTimeHeightDeterministicDPDA, string::LinearString < > > ( Result::result );
 
-label::Label Result::result ( const automaton::DPDA & automaton, const string::LinearString & string, const label::Label & failLabel ) {
+label::Label Result::result ( const automaton::DPDA & automaton, const string::LinearString < > & string, const label::Label & failLabel ) {
 	std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > res = Run::calculateState ( automaton, string );
 
 	if ( std::get < 0 > ( res ) ) return std::get < 1 > ( res );
@@ -83,7 +83,7 @@ label::Label Result::result ( const automaton::DPDA & automaton, const string::L
 	return failLabel;
 }
 
-auto ResultDPDALinearString = Result::RegistratorWrapper < label::Label, automaton::DPDA, string::LinearString > ( Result::result );
+auto ResultDPDALinearString = Result::RegistratorWrapper < label::Label, automaton::DPDA, string::LinearString < > > ( Result::result );
 
 } /* namespace run */
 
diff --git a/alib2algo/src/automaton/run/Result.h b/alib2algo/src/automaton/run/Result.h
index b8b7f765ee..93154c9c99 100644
--- a/alib2algo/src/automaton/run/Result.h
+++ b/alib2algo/src/automaton/run/Result.h
@@ -29,12 +29,12 @@ public:
 	 */
 	static label::Label result ( const automaton::Automaton & automaton, const alib::Object & object, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
 
-	static label::Label result ( const automaton::DFA < > & automaton, const string::LinearString & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
+	static label::Label result ( const automaton::DFA < > & automaton, const string::LinearString < > & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
 	static label::Label result ( const automaton::DFTA & automaton, const tree::RankedTree & tree, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
-	static label::Label result ( const automaton::InputDrivenDPDA & automaton, const string::LinearString & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
-	static label::Label result ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
-	static label::Label result ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
-	static label::Label result ( const automaton::DPDA & automaton, const string::LinearString & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
+	static label::Label result ( const automaton::InputDrivenDPDA & automaton, const string::LinearString < > & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
+	static label::Label result ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString < > & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
+	static label::Label result ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString < > & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
+	static label::Label result ( const automaton::DPDA & automaton, const string::LinearString < > & string, const label::Label & failLabel = label::FailStateLabel::FAIL_STATE_LABEL );
 
 };
 
diff --git a/alib2algo/src/automaton/run/Run.cpp b/alib2algo/src/automaton/run/Run.cpp
index e2a7f5fafd..e429191c1e 100644
--- a/alib2algo/src/automaton/run/Run.cpp
+++ b/alib2algo/src/automaton/run/Run.cpp
@@ -29,7 +29,7 @@ namespace run {
 
 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-std::tuple < bool, label::Label, std::set < unsigned > > Run::calculateState ( const automaton::DFA < > & automaton, const string::LinearString & string ) {
+std::tuple < bool, label::Label, std::set < unsigned > > Run::calculateState ( const automaton::DFA < > & automaton, const string::LinearString < > & string ) {
 	bool res = true;
 	unsigned i = 0;
 	std::set < unsigned > occurrences;
@@ -64,7 +64,7 @@ std::tuple < bool, label::Label, std::set < unsigned > > Run::calculateState ( c
 
 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-std::tuple < bool, std::set < label::Label >, std::set < unsigned > > Run::calculateStates ( const automaton::NFA < > & automaton, const string::LinearString & string ) {
+std::tuple < bool, std::set < label::Label >, std::set < unsigned > > Run::calculateStates ( const automaton::NFA < > & automaton, const string::LinearString < > & string ) {
 	bool res = true;
 	unsigned i = 0;
 	std::set < unsigned > occurrences;
@@ -217,7 +217,7 @@ bool Run::canPop ( const std::deque < alphabet::Symbol > & pushdownStore, const
 
 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > Run::calculateState ( const automaton::InputDrivenDPDA & automaton, const string::LinearString & string ) {
+std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > Run::calculateState ( const automaton::InputDrivenDPDA & automaton, const string::LinearString < > & string ) {
 	label::Label state = automaton.getInitialState ( );
 	std::deque < alphabet::Symbol > pushdownStore {
 		automaton.getInitialSymbol ( )
@@ -266,7 +266,7 @@ std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::S
 
 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > Run::calculateState ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString & string ) {
+std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > Run::calculateState ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString < > & string ) {
 	label::Label state = automaton.getInitialState ( );
 	std::deque < alphabet::Symbol > pushdownStore {
 		automaton.getBottomOfTheStackSymbol ( )
@@ -331,7 +331,7 @@ std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::S
 
 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > Run::calculateState ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString & string ) {
+std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > Run::calculateState ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString < > & string ) {
 	label::Label state = automaton.getInitialState ( );
 	std::deque < alphabet::Symbol > pushdownStore {
 		automaton.getBottomOfTheStackSymbol ( )
@@ -413,7 +413,7 @@ std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::S
 
 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > Run::calculateState ( const automaton::DPDA & automaton, const string::LinearString & string ) {
+std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > Run::calculateState ( const automaton::DPDA & automaton, const string::LinearString < > & string ) {
 	label::Label state = automaton.getInitialState ( );
 	std::deque < alphabet::Symbol > pushdownStore {
 		automaton.getInitialSymbol ( )
@@ -479,7 +479,7 @@ struct graphStructuredStack {
 	alphabet::Symbol data;
 };
 
-std::tuple < bool, std::set < label::Label >, std::set < std::vector < alphabet::Symbol > > > Run::calculateStates ( const automaton::NPDTA & automaton, const string::LinearString & string ) {
+std::tuple < bool, std::set < label::Label >, std::set < std::vector < alphabet::Symbol > > > Run::calculateStates ( const automaton::NPDTA & automaton, const string::LinearString < > & string ) {
 	bool res = false;
 	unsigned i = 0;
 	std::set < unsigned > occurrences;
diff --git a/alib2algo/src/automaton/run/Run.h b/alib2algo/src/automaton/run/Run.h
index 61df7941aa..a9e196fd59 100644
--- a/alib2algo/src/automaton/run/Run.h
+++ b/alib2algo/src/automaton/run/Run.h
@@ -25,15 +25,15 @@ class Run {
 	static bool canPop ( const std::deque < alphabet::Symbol > & pushdownStore, const std::vector < alphabet::Symbol > & pop );
 
 public:
-	static std::tuple < bool, label::Label, std::set < unsigned > > calculateState ( const automaton::DFA < > & automaton, const string::LinearString & string );
-	static std::tuple < bool, std::set < label::Label >, std::set < unsigned > > calculateStates ( const automaton::NFA < > & automaton, const string::LinearString & string );
+	static std::tuple < bool, label::Label, std::set < unsigned > > calculateState ( const automaton::DFA < > & automaton, const string::LinearString < > & string );
+	static std::tuple < bool, std::set < label::Label >, std::set < unsigned > > calculateStates ( const automaton::NFA < > & automaton, const string::LinearString < > & string );
 	static std::tuple < bool, label::Label, std::set < unsigned > > calculateState ( const automaton::DFTA & automaton, const tree::RankedTree & tree );
 	static std::tuple < bool, std::set < label::Label >, std::set < unsigned > > calculateStates ( const automaton::NFTA & automaton, const tree::RankedTree & tree );
-	static std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > calculateState ( const automaton::InputDrivenDPDA & automaton, const string::LinearString & string );
-	static std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > calculateState ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString & string );
-	static std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > calculateState ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString & string );
-	static std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > calculateState ( const automaton::DPDA & automaton, const string::LinearString & string );
-	static std::tuple < bool, std::set < label::Label >, std::set < std::vector < alphabet::Symbol > > > calculateStates ( const automaton::NPDTA & automaton, const string::LinearString & string );
+	static std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > calculateState ( const automaton::InputDrivenDPDA & automaton, const string::LinearString < > & string );
+	static std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > calculateState ( const automaton::VisiblyPushdownDPDA & automaton, const string::LinearString < > & string );
+	static std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > calculateState ( const automaton::RealTimeHeightDeterministicDPDA & automaton, const string::LinearString < > & string );
+	static std::tuple < bool, label::Label, std::set < unsigned >, std::deque < alphabet::Symbol > > calculateState ( const automaton::DPDA & automaton, const string::LinearString < > & string );
+	static std::tuple < bool, std::set < label::Label >, std::set < std::vector < alphabet::Symbol > > > calculateStates ( const automaton::NPDTA & automaton, const string::LinearString < > & string );
 };
 
 } /* namespace run */
diff --git a/alib2algo/src/automaton/run/Translate.cpp b/alib2algo/src/automaton/run/Translate.cpp
index 4cb73977fb..285f05f9ee 100644
--- a/alib2algo/src/automaton/run/Translate.cpp
+++ b/alib2algo/src/automaton/run/Translate.cpp
@@ -16,25 +16,25 @@ namespace automaton {
 
 namespace run {
 
-std::set < string::LinearString > Translate::translate ( const automaton::Automaton & automaton, const alib::Object & object ) {
+std::set < string::LinearString < > > Translate::translate ( const automaton::Automaton & automaton, const alib::Object & object ) {
 	return dispatch ( automaton.getData ( ), object.getData ( ) );
 }
 
-std::set < string::LinearString > Translate::translate ( const automaton::Automaton & automaton, const string::LinearString & string ) {
+std::set < string::LinearString < > > Translate::translate ( const automaton::Automaton & automaton, const string::LinearString < > & string ) {
 	return dispatch ( automaton.getData ( ), string );
 }
 
-std::set < string::LinearString > Translate::translate ( const automaton::NPDTA & automaton, const string::LinearString & string ) {
+std::set < string::LinearString < > > Translate::translate ( const automaton::NPDTA & automaton, const string::LinearString < > & string ) {
 	std::tuple < bool, std::set < label::Label >, std::set < std::vector < alphabet::Symbol > > > res = Run::calculateStates ( automaton, string );
-	std::set < string::LinearString > strings;
+	std::set < string::LinearString < > > strings;
 	for ( auto iter = std::get<2>(res).begin(); iter != std::get<2>(res).end(); iter ++ ) {
-		string::LinearString str (* iter);
+		string::LinearString < > str (* iter);
 		strings . insert ( str );
 	}
 	return strings;
 }
 
-auto TranslateNPDTALinearString = Translate::RegistratorWrapper < std::set < string::LinearString >, automaton::NPDTA, string::LinearString > ( Translate::translate );
+auto TranslateNPDTALinearString = Translate::RegistratorWrapper < std::set < string::LinearString < > >, automaton::NPDTA, string::LinearString < > > ( Translate::translate );
 
 } /* namespace run */
 
diff --git a/alib2algo/src/automaton/run/Translate.h b/alib2algo/src/automaton/run/Translate.h
index 5bf6eae988..2c338877e5 100644
--- a/alib2algo/src/automaton/run/Translate.h
+++ b/alib2algo/src/automaton/run/Translate.h
@@ -19,16 +19,16 @@ namespace automaton {
 
 namespace run {
 
-class Translate : public std::DoubleDispatch < Translate, std::set < string::LinearString >, automaton::AutomatonBase, alib::ObjectBase > {
+class Translate : public std::DoubleDispatch < Translate, std::set < string::LinearString < > >, automaton::AutomatonBase, alib::ObjectBase > {
 public:
 	/**
 	 * Performs conversion.
 	 * @return left regular grammar equivalent to source automaton.
 	 */
-	static std::set < string::LinearString > translate ( const automaton::Automaton & automaton, const alib::Object & object );
-	static std::set < string::LinearString > translate ( const automaton::Automaton & automaton, const string::LinearString & string );
+	static std::set < string::LinearString < > > translate ( const automaton::Automaton & automaton, const alib::Object & object );
+	static std::set < string::LinearString < > > translate ( const automaton::Automaton & automaton, const string::LinearString < > & string );
 
-	static std::set < string::LinearString > translate ( const automaton::NPDTA & automaton, const string::LinearString & string );
+	static std::set < string::LinearString < > > translate ( const automaton::NPDTA & automaton, const string::LinearString < > & string );
 
 };
 
diff --git a/alib2algo/src/grammar/generate/CockeYoungerKasami.cpp b/alib2algo/src/grammar/generate/CockeYoungerKasami.cpp
index 653c542743..76e4b3b977 100644
--- a/alib2algo/src/grammar/generate/CockeYoungerKasami.cpp
+++ b/alib2algo/src/grammar/generate/CockeYoungerKasami.cpp
@@ -12,7 +12,7 @@ namespace grammar {
 
 namespace generate {
 
-bool CockeYoungerKasami::generate ( const grammar::CNF & grammar, const string::LinearString & string ) {
+bool CockeYoungerKasami::generate ( const grammar::CNF & grammar, const string::LinearString < > & string ) {
 	unsigned stringSize = string.getContent ( ).size ( );
 
 	if ( ( stringSize == 0 ) && grammar.getGeneratesEpsilon ( ) ) return true;
@@ -78,7 +78,7 @@ bool CockeYoungerKasami::generate ( const grammar::CNF & grammar, const string::
 
 auto CockeYoungerKasamiCNF = CockeYoungerKasami::RegistratorWrapper < bool, grammar::CNF > ( CockeYoungerKasami::generate );
 
-bool CockeYoungerKasami::generate ( const grammar::Grammar & grammar, const string::LinearString & string ) {
+bool CockeYoungerKasami::generate ( const grammar::Grammar & grammar, const string::LinearString < > & string ) {
 	return dispatch ( grammar.getData ( ), string );
 }
 
diff --git a/alib2algo/src/grammar/generate/CockeYoungerKasami.h b/alib2algo/src/grammar/generate/CockeYoungerKasami.h
index f2a4086f28..45e5db61d6 100644
--- a/alib2algo/src/grammar/generate/CockeYoungerKasami.h
+++ b/alib2algo/src/grammar/generate/CockeYoungerKasami.h
@@ -21,11 +21,11 @@ namespace generate {
 /**
  * Implements algorithms from Melichar, chapter 3.3
  */
-class CockeYoungerKasami : public std::SingleDispatchLastStaticParam < CockeYoungerKasami, bool, grammar::GrammarBase, const string::LinearString & > {
+class CockeYoungerKasami : public std::SingleDispatchLastStaticParam < CockeYoungerKasami, bool, grammar::GrammarBase, const string::LinearString < > & > {
 public:
-	static bool generate ( const grammar::Grammar & grammar, const string::LinearString & string );
+	static bool generate ( const grammar::Grammar & grammar, const string::LinearString < > & string );
 
-	static bool generate ( const grammar::CNF & grammar, const string::LinearString & string );
+	static bool generate ( const grammar::CNF & grammar, const string::LinearString < > & string );
 
 };
 
diff --git a/alib2algo/src/grammar/generate/GenerateUpToLength.cpp b/alib2algo/src/grammar/generate/GenerateUpToLength.cpp
index b115a89c8a..93631bb7b1 100644
--- a/alib2algo/src/grammar/generate/GenerateUpToLength.cpp
+++ b/alib2algo/src/grammar/generate/GenerateUpToLength.cpp
@@ -20,12 +20,12 @@ namespace grammar {
 namespace generate {
 
 template<class T>
-std::set<string::LinearString> GenerateUpToLength::generate( const T & grammar, unsigned length ) {
-	std::set<string::LinearString> res;
+std::set<string::LinearString < >> GenerateUpToLength::generate( const T & grammar, unsigned length ) {
+	std::set<string::LinearString < >> res;
 
 	std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules = grammar.getRawRules();
 	if(grammar.getGeneratesEpsilon()) {
-		res.insert(string::LinearString {});
+		res.insert(string::LinearString < > {});
 		rules[grammar.getInitialSymbol()].erase(std::vector<alphabet::Symbol> {});
 	}
 
@@ -52,7 +52,7 @@ std::set<string::LinearString> GenerateUpToLength::generate( const T & grammar,
 			}
 
 			if(newStack.empty()) {
-				res.insert(string::LinearString(newString));
+				res.insert(string::LinearString < >(newString));
 			} else {
 				data.push_back(std::make_pair(std::move(newString), std::move(newStack)));
 			}
@@ -61,13 +61,13 @@ std::set<string::LinearString> GenerateUpToLength::generate( const T & grammar,
 	return res;
 }
 
-auto GenerateUpToLengthEpsilonFreeCFG = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString>, grammar::EpsilonFreeCFG>(GenerateUpToLength::generate);
-auto GenerateUpToLengthGNF = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString>, grammar::GNF>(GenerateUpToLength::generate);
-auto GenerateUpToLengthCNF = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString>, grammar::CNF>(GenerateUpToLength::generate);
-auto GenerateUpToLengthLeftRG = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString>, grammar::LeftRG>(GenerateUpToLength::generate);
-auto GenerateUpToLengthRightRG = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString>, grammar::RightRG>(GenerateUpToLength::generate);
+auto GenerateUpToLengthEpsilonFreeCFG = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString < >>, grammar::EpsilonFreeCFG>(GenerateUpToLength::generate);
+auto GenerateUpToLengthGNF = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString < >>, grammar::GNF>(GenerateUpToLength::generate);
+auto GenerateUpToLengthCNF = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString < >>, grammar::CNF>(GenerateUpToLength::generate);
+auto GenerateUpToLengthLeftRG = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString < >>, grammar::LeftRG>(GenerateUpToLength::generate);
+auto GenerateUpToLengthRightRG = GenerateUpToLength::RegistratorWrapper<std::set<string::LinearString < >>, grammar::RightRG>(GenerateUpToLength::generate);
 
-std::set<string::LinearString> GenerateUpToLength::generate(const grammar::Grammar& grammar, unsigned length) {
+std::set<string::LinearString < >> GenerateUpToLength::generate(const grammar::Grammar& grammar, unsigned length) {
 	return dispatch(grammar.getData(), length);
 }
 
diff --git a/alib2algo/src/grammar/generate/GenerateUpToLength.h b/alib2algo/src/grammar/generate/GenerateUpToLength.h
index afc67f0b30..70913f28ae 100644
--- a/alib2algo/src/grammar/generate/GenerateUpToLength.h
+++ b/alib2algo/src/grammar/generate/GenerateUpToLength.h
@@ -21,12 +21,12 @@ namespace generate {
 /**
  * Implements algorithms from Melichar, chapter 3.3
  */
-class GenerateUpToLength : public std::SingleDispatchLastStaticParam<GenerateUpToLength, std::set<string::LinearString>, grammar::GrammarBase, unsigned> {
+class GenerateUpToLength : public std::SingleDispatchLastStaticParam<GenerateUpToLength, std::set<string::LinearString < >>, grammar::GrammarBase, unsigned> {
 public:
-	static std::set<string::LinearString> generate( const grammar::Grammar & grammar, unsigned length );
+	static std::set<string::LinearString < >> generate( const grammar::Grammar & grammar, unsigned length );
 
 	template<class T>
-	static std::set<string::LinearString> generate( const T & grammar, unsigned length );
+	static std::set<string::LinearString < >> generate( const T & grammar, unsigned length );
 };
 
 } /* namespace generate */
diff --git a/alib2algo/src/regexp/convert/ToAutomatonDerivation.cpp b/alib2algo/src/regexp/convert/ToAutomatonDerivation.cpp
index 662c92a23f..95bd4c0f56 100644
--- a/alib2algo/src/regexp/convert/ToAutomatonDerivation.cpp
+++ b/alib2algo/src/regexp/convert/ToAutomatonDerivation.cpp
@@ -48,7 +48,7 @@ automaton::DFA<> ToAutomatonDerivation::convert(const T& regexp) {
 			regexp::RegExpDerivation deriv;
 
 			for(const auto& a : regexp.getAlphabet()) {
-				string::LinearString string(std::vector<alphabet::Symbol>{a});
+				string::LinearString < > string(std::vector<alphabet::Symbol>{a});
 				regexp::RegExp derived = deriv.derivation(dregexp, string);
 				derived = regexp::simplify::RegExpOptimize::optimize(derived);
 
@@ -85,7 +85,7 @@ automaton::DFA<> ToAutomatonDerivation::convert(const T& regexp) {
 		regexp::RegExpDerivation deriv;
 
 		for(const auto& a: regexp.getAlphabet()) {
-			string::LinearString string(std::vector<alphabet::Symbol>{a});
+			string::LinearString < > string(std::vector<alphabet::Symbol>{a});
 			regexp::RegExp derived = deriv.derivation(r, string);
 			derived = regexp::simplify::RegExpOptimize::optimize(derived);
 
diff --git a/alib2algo/src/regexp/convert/ToGrammarRightRGDerivation.cpp b/alib2algo/src/regexp/convert/ToGrammarRightRGDerivation.cpp
index 5d688cae8f..7abbca785f 100644
--- a/alib2algo/src/regexp/convert/ToGrammarRightRGDerivation.cpp
+++ b/alib2algo/src/regexp/convert/ToGrammarRightRGDerivation.cpp
@@ -47,7 +47,7 @@ grammar::RightRG ToGrammarRightRGDerivation::convert(const T& regexp) {
 
 		for(const auto & dregexp : Ni.at( i - 1 )) {
 			for(const auto & a : regexp.getAlphabet()) {
-				string::LinearString string(std::vector<alphabet::Symbol>{a});
+				string::LinearString < > string(std::vector<alphabet::Symbol>{a});
 				regexp::RegExp derived = regexp::RegExpDerivation::derivation(dregexp, string);
 				derived = regexp::simplify::RegExpOptimize::optimize(derived);
 
@@ -83,7 +83,7 @@ grammar::RightRG ToGrammarRightRGDerivation::convert(const T& regexp) {
 
 	for(const auto & r : N) {
 		for(const auto & a : regexp.getAlphabet()) {
-			string::LinearString string(std::vector<alphabet::Symbol>{a});
+			string::LinearString < > string(std::vector<alphabet::Symbol>{a});
 			regexp::RegExp derived = regexp::RegExpDerivation::derivation(r, string);
 			derived = regexp::simplify::RegExpOptimize::optimize(derived);
 
diff --git a/alib2algo/src/regexp/transform/RegExpDerivation.cpp b/alib2algo/src/regexp/transform/RegExpDerivation.cpp
index 1c132c81bc..0464ea4f9d 100644
--- a/alib2algo/src/regexp/transform/RegExpDerivation.cpp
+++ b/alib2algo/src/regexp/transform/RegExpDerivation.cpp
@@ -14,11 +14,11 @@
 namespace regexp
 {
 
-regexp::RegExp RegExpDerivation::derivation(const regexp::RegExp& regexp, const string::LinearString& string) {
+regexp::RegExp RegExpDerivation::derivation(const regexp::RegExp& regexp, const string::LinearString < >& string) {
 	return dispatch(regexp.getData(), string);
 }
 
-regexp::FormalRegExp RegExpDerivation::derivation(const regexp::FormalRegExp& regexp, const string::LinearString& string) {
+regexp::FormalRegExp RegExpDerivation::derivation(const regexp::FormalRegExp& regexp, const string::LinearString < >& string) {
 	std::unique_ptr < regexp::FormalRegExpElement > newRegExp ( regexp.getRegExp().clone() );
 
 	for(const auto& symbol : string.getContent()) {
@@ -32,7 +32,7 @@ regexp::FormalRegExp RegExpDerivation::derivation(const regexp::FormalRegExp& re
 
 auto RegExpDerivationFormalRegExp = RegExpDerivation::RegistratorWrapper<regexp::FormalRegExp, regexp::FormalRegExp>(RegExpDerivation::derivation);
 
-regexp::UnboundedRegExp RegExpDerivation::derivation(const regexp::UnboundedRegExp& regexp, const string::LinearString& string) {
+regexp::UnboundedRegExp RegExpDerivation::derivation(const regexp::UnboundedRegExp& regexp, const string::LinearString < >& string) {
 	std::unique_ptr < regexp::UnboundedRegExpElement > newRegExp ( regexp.getRegExp().clone() );
 
 	for(const auto& symbol : string.getContent()) {
diff --git a/alib2algo/src/regexp/transform/RegExpDerivation.h b/alib2algo/src/regexp/transform/RegExpDerivation.h
index 6649a57ea2..c7caabf24b 100644
--- a/alib2algo/src/regexp/transform/RegExpDerivation.h
+++ b/alib2algo/src/regexp/transform/RegExpDerivation.h
@@ -27,7 +27,7 @@ namespace regexp {
  *  - Melichar, definition 2.91 in chapter 2.4.3
  *  - Brzozowski, J. A. - Derivatives of regular expressions (1964)
  */
-class RegExpDerivation : public std::SingleDispatchLastStaticParam<RegExpDerivation, regexp::RegExp, regexp::RegExpBase, const string::LinearString&>, regexp::FormalRegExpElementVisitor, regexp::UnboundedRegExpElementVisitor {
+class RegExpDerivation : public std::SingleDispatchLastStaticParam<RegExpDerivation, regexp::RegExp, regexp::RegExpBase, const string::LinearString < >&>, regexp::FormalRegExpElementVisitor, regexp::UnboundedRegExpElementVisitor {
 public:
 	RegExpDerivation() {}
 
@@ -36,10 +36,10 @@ public:
 	 * @param string String to derivate given RegExp over
 	 * @return derivative of regexp
 	 */
-	static regexp::RegExp derivation(const regexp::RegExp& regexp, const string::LinearString& string);
+	static regexp::RegExp derivation(const regexp::RegExp& regexp, const string::LinearString < >& string);
 
-	static regexp::FormalRegExp derivation(const regexp::FormalRegExp& regexp, const string::LinearString& string);
-	static regexp::UnboundedRegExp derivation(const regexp::UnboundedRegExp& regexp, const string::LinearString& string);
+	static regexp::FormalRegExp derivation(const regexp::FormalRegExp& regexp, const string::LinearString < >& string);
+	static regexp::UnboundedRegExp derivation(const regexp::UnboundedRegExp& regexp, const string::LinearString < >& string);
 
 private:
 	void Visit(void*, const regexp::FormalRegExpAlternation& alternation) const;
diff --git a/alib2algo/src/regexp/transform/RegExpIntegral.cpp b/alib2algo/src/regexp/transform/RegExpIntegral.cpp
index 80444ede0f..a8493826d7 100644
--- a/alib2algo/src/regexp/transform/RegExpIntegral.cpp
+++ b/alib2algo/src/regexp/transform/RegExpIntegral.cpp
@@ -11,11 +11,11 @@
 
 namespace regexp{
 
-regexp::RegExp RegExpIntegral::integral(const regexp::RegExp& regexp, const string::LinearString& string) {
+regexp::RegExp RegExpIntegral::integral(const regexp::RegExp& regexp, const string::LinearString < >& string) {
 	return dispatch(regexp.getData(), string);
 }
 
-regexp::FormalRegExp RegExpIntegral::integral(const regexp::FormalRegExp& regexp, const string::LinearString& string) {
+regexp::FormalRegExp RegExpIntegral::integral(const regexp::FormalRegExp& regexp, const string::LinearString < >& string) {
 	std::unique_ptr < regexp::FormalRegExpElement > newRegExp ( regexp.getRegExp().clone() );
 
 	for(const auto& symbol : string.getContent()) {
@@ -29,7 +29,7 @@ regexp::FormalRegExp RegExpIntegral::integral(const regexp::FormalRegExp& regexp
 
 auto RegExpIntegralFormalRegExp = RegExpIntegral::RegistratorWrapper<regexp::FormalRegExp, regexp::FormalRegExp>(RegExpIntegral::integral);
 
-regexp::UnboundedRegExp RegExpIntegral::integral(const regexp::UnboundedRegExp& regexp, const string::LinearString& string) {
+regexp::UnboundedRegExp RegExpIntegral::integral(const regexp::UnboundedRegExp& regexp, const string::LinearString < >& string) {
 	std::unique_ptr < regexp::UnboundedRegExpElement > newRegExp ( regexp.getRegExp().clone() );
 
 	for(const auto& symbol : string.getContent()) {
diff --git a/alib2algo/src/regexp/transform/RegExpIntegral.h b/alib2algo/src/regexp/transform/RegExpIntegral.h
index 3f201c2029..392129bb47 100644
--- a/alib2algo/src/regexp/transform/RegExpIntegral.h
+++ b/alib2algo/src/regexp/transform/RegExpIntegral.h
@@ -25,7 +25,7 @@ namespace regexp
  * Calculates integral of regular expression
  * Source: Melichar definition 2.93 in chapter 2.4.4
  */
-class RegExpIntegral : public std::SingleDispatchLastStaticParam<RegExpIntegral, regexp::RegExp, regexp::RegExpBase, const string::LinearString&>, regexp::FormalRegExpElementVisitor, regexp::UnboundedRegExpElementVisitor
+class RegExpIntegral : public std::SingleDispatchLastStaticParam<RegExpIntegral, regexp::RegExp, regexp::RegExpBase, const string::LinearString < >&>, regexp::FormalRegExpElementVisitor, regexp::UnboundedRegExpElementVisitor
 {
 public:
 	RegExpIntegral() {}
@@ -35,10 +35,10 @@ public:
 	 * @param string String to integrate given RegExp over
 	 * @return integral of regexp
 	 */
-	static regexp::RegExp integral(const regexp::RegExp& regexp, const string::LinearString& string);
+	static regexp::RegExp integral(const regexp::RegExp& regexp, const string::LinearString < >& string);
 
-	static regexp::FormalRegExp integral(const regexp::FormalRegExp& regexp, const string::LinearString& string);
-	static regexp::UnboundedRegExp integral(const regexp::UnboundedRegExp& regexp, const string::LinearString& string);
+	static regexp::FormalRegExp integral(const regexp::FormalRegExp& regexp, const string::LinearString < >& string);
+	static regexp::UnboundedRegExp integral(const regexp::UnboundedRegExp& regexp, const string::LinearString < >& string);
 
 private:
 	void Visit(void*, const regexp::FormalRegExpAlternation& alternation) const;
diff --git a/alib2algo/src/string/generate/RandomStringFactory.cpp b/alib2algo/src/string/generate/RandomStringFactory.cpp
index 17c925014a..1c1e45f3de 100644
--- a/alib2algo/src/string/generate/RandomStringFactory.cpp
+++ b/alib2algo/src/string/generate/RandomStringFactory.cpp
@@ -17,7 +17,7 @@ namespace string {
 
 namespace generate {
 
-string::LinearString RandomStringFactory::generateLinearString ( size_t size, size_t alphabetSize, bool randomizedAlphabet, bool integerSymbols ) {
+string::LinearString < > RandomStringFactory::generateLinearString ( size_t size, size_t alphabetSize, bool randomizedAlphabet, bool integerSymbols ) {
 	if ( !integerSymbols ) return generateLinearString ( size, alphabetSize, randomizedAlphabet );
 
 	if ( alphabetSize <= 0 )
@@ -28,10 +28,10 @@ string::LinearString RandomStringFactory::generateLinearString ( size_t size, si
 	for ( size_t i = 0; i < size; i++ )
 		elems.push_back ( alphabet::symbolFrom ( static_cast < int > ( std::random_devices::semirandom ( ) % alphabetSize ) ) );
 
-	return string::LinearString ( elems );
+	return string::LinearString < > ( elems );
 }
 
-string::LinearString RandomStringFactory::generateLinearString ( size_t size, size_t alphabetSize, bool randomizedAlphabet ) {
+string::LinearString < > RandomStringFactory::generateLinearString ( size_t size, size_t alphabetSize, bool randomizedAlphabet ) {
 	if ( alphabetSize > 26 )
 		throw exception::CommonException ( "Too big alphabet." );
 
@@ -49,7 +49,7 @@ string::LinearString RandomStringFactory::generateLinearString ( size_t size, si
 	return RandomStringFactory::generateLinearString ( size, alphabet );
 }
 
-string::LinearString RandomStringFactory::generateLinearString ( size_t size, std::set < alphabet::Symbol > alphabet ) {
+string::LinearString < > RandomStringFactory::generateLinearString ( size_t size, std::set < alphabet::Symbol > alphabet ) {
 
 	if ( alphabet.size ( ) > 26 )
 		throw exception::CommonException ( "Too big alphabet." );
@@ -63,7 +63,7 @@ string::LinearString RandomStringFactory::generateLinearString ( size_t size, st
 	for ( size_t i = 0; i < size; i++ )
 		elems.push_back ( alphabetList[std::random_devices::semirandom ( ) % alphabetList.size ( )] );
 
-	return string::LinearString ( elems );
+	return string::LinearString < > ( elems );
 }
 
 } /* namespace generate */
diff --git a/alib2algo/src/string/generate/RandomStringFactory.h b/alib2algo/src/string/generate/RandomStringFactory.h
index 39f1a8e394..9fe6c00e66 100644
--- a/alib2algo/src/string/generate/RandomStringFactory.h
+++ b/alib2algo/src/string/generate/RandomStringFactory.h
@@ -17,9 +17,9 @@ namespace generate {
 
 class RandomStringFactory {
 public:
-	static string::LinearString generateLinearString ( size_t size, size_t alphabetSize, bool randomizedAlphabet, bool integerSymbols );
-	static string::LinearString generateLinearString ( size_t size, size_t alphabetSize, bool randomizedAlphabet );
-	static string::LinearString generateLinearString ( size_t size, std::set < alphabet::Symbol > alphabet );
+	static string::LinearString < > generateLinearString ( size_t size, size_t alphabetSize, bool randomizedAlphabet, bool integerSymbols );
+	static string::LinearString < > generateLinearString ( size_t size, size_t alphabetSize, bool randomizedAlphabet );
+	static string::LinearString < > generateLinearString ( size_t size, std::set < alphabet::Symbol > alphabet );
 };
 
 } /* namespace generate */
diff --git a/alib2algo/src/string/generate/RandomSubstringFactory.cpp b/alib2algo/src/string/generate/RandomSubstringFactory.cpp
index 4c2d212cd4..2f945b3da6 100644
--- a/alib2algo/src/string/generate/RandomSubstringFactory.cpp
+++ b/alib2algo/src/string/generate/RandomSubstringFactory.cpp
@@ -21,7 +21,7 @@ string::String RandomSubstringFactory::generateSubstring ( size_t size, const st
 	return dispatch ( size, v.getData ( ) );
 }
 
-string::LinearString RandomSubstringFactory::generateSubstring ( size_t size, const string::LinearString & string ) {
+string::LinearString < > RandomSubstringFactory::generateSubstring ( size_t size, const string::LinearString < > & string ) {
 	if ( size > string.getContent ( ).size ( ) )
 		throw exception::CommonException ( "String not long enough" );
 
@@ -29,12 +29,12 @@ string::LinearString RandomSubstringFactory::generateSubstring ( size_t size, co
 
 	std::vector < alphabet::Symbol > data ( string.getContent ( ).begin ( ) + begin, string.getContent ( ).begin ( ) + begin + size );
 
-	return LinearString {
+	return LinearString < > {
 			   string.getAlphabet ( ), data
 	};
 }
 
-auto RandomSubstringFactoryLinearString = RandomSubstringFactory::RegistratorWrapper < string::LinearString, string::LinearString > ( RandomSubstringFactory::generateSubstring );
+auto RandomSubstringFactoryLinearString = RandomSubstringFactory::RegistratorWrapper < string::LinearString < >, string::LinearString < > > ( RandomSubstringFactory::generateSubstring );
 
 } /* namespace generate */
 
diff --git a/alib2algo/src/string/generate/RandomSubstringFactory.h b/alib2algo/src/string/generate/RandomSubstringFactory.h
index e9e8304a27..0e83f3fcec 100644
--- a/alib2algo/src/string/generate/RandomSubstringFactory.h
+++ b/alib2algo/src/string/generate/RandomSubstringFactory.h
@@ -20,7 +20,7 @@ class RandomSubstringFactory : public std::SingleDispatchFirstStaticParam < Rand
 public:
 	static string::String generateSubstring ( size_t size, const string::String & );
 
-	static string::LinearString generateSubstring ( size_t size, const string::LinearString & );
+	static string::LinearString < > generateSubstring ( size_t size, const string::LinearString < > & );
 
 };
 
diff --git a/alib2algo/src/string/naive/ExactCompare.cpp b/alib2algo/src/string/naive/ExactCompare.cpp
index 6b6ccee2cc..d3bc8d3ef5 100644
--- a/alib2algo/src/string/naive/ExactCompare.cpp
+++ b/alib2algo/src/string/naive/ExactCompare.cpp
@@ -24,7 +24,7 @@ int ExactCompare::compare ( const string::Epsilon < > &, const string::Epsilon <
 
 auto ExactCompareEpsilon = ExactCompare::RegistratorWrapper < int, string::Epsilon < > > ( ExactCompare::compare );
 
-int ExactCompare::compare ( const string::LinearString & u, const string::LinearString & v ) {
+int ExactCompare::compare ( const string::LinearString < > & u, const string::LinearString < > & v ) {
 	int n = ( int ) u.getContent ( ).size ( ), m = ( int ) v.getContent ( ).size ( );
 	int k = 0;
 
@@ -42,9 +42,9 @@ int ExactCompare::compare ( const string::LinearString & u, const string::Linear
 		return 1;
 }
 
-auto ExactCompareLinearString = ExactCompare::RegistratorWrapper < int, string::LinearString > ( ExactCompare::compare );
+auto ExactCompareLinearString = ExactCompare::RegistratorWrapper < int, string::LinearString < > > ( ExactCompare::compare );
 
-int ExactCompare::compare ( const string::CyclicString & u, const string::CyclicString & v ) {
+int ExactCompare::compare ( const string::CyclicString < > & u, const string::CyclicString < > & v ) {
 	int n = ( int ) u.getContent ( ).size ( ), m = ( int ) v.getContent ( ).size ( );
 	int i = -1, j = -1, k;
 
@@ -68,7 +68,7 @@ int ExactCompare::compare ( const string::CyclicString & u, const string::Cyclic
 	return last ? 1 : -1;
 }
 
-auto ExactCompareCyclicString = ExactCompare::RegistratorWrapper < int, string::CyclicString > ( ExactCompare::compare );
+auto ExactCompareCyclicString = ExactCompare::RegistratorWrapper < int, string::CyclicString < > > ( ExactCompare::compare );
 
 } /* namespace naive */
 
diff --git a/alib2algo/src/string/naive/ExactCompare.h b/alib2algo/src/string/naive/ExactCompare.h
index 5f0419b669..19a05e3265 100644
--- a/alib2algo/src/string/naive/ExactCompare.h
+++ b/alib2algo/src/string/naive/ExactCompare.h
@@ -21,8 +21,8 @@ public:
 	static int compare(const string::String& u, const string::String& v);
 
 	static int compare(const string::Epsilon < >& u, const string::Epsilon < >& v);
-	static int compare(const string::LinearString& u, const string::LinearString& v);
-	static int compare(const string::CyclicString& u, const string::CyclicString& v);
+	static int compare(const string::LinearString < >& u, const string::LinearString < >& v);
+	static int compare(const string::CyclicString < >& u, const string::CyclicString < >& v);
 };
 
 } /* namespace naive */
diff --git a/alib2algo/src/string/naive/ExactEqual.cpp b/alib2algo/src/string/naive/ExactEqual.cpp
index 43572b11f1..89d3c05b7f 100644
--- a/alib2algo/src/string/naive/ExactEqual.cpp
+++ b/alib2algo/src/string/naive/ExactEqual.cpp
@@ -24,7 +24,7 @@ bool ExactEqual::equals ( const string::Epsilon < > &, const string::Epsilon < >
 
 auto ExactEqualEpsilon = ExactEqual::RegistratorWrapper < bool, string::Epsilon < > > ( ExactEqual::equals );
 
-bool ExactEqual::equals ( const string::LinearString & u, const string::LinearString & v ) {
+bool ExactEqual::equals ( const string::LinearString < > & u, const string::LinearString < > & v ) {
 	int n = ( int ) u.getContent ( ).size ( ), m = ( int ) v.getContent ( ).size ( );
 	int k = 0;
 
@@ -36,9 +36,9 @@ bool ExactEqual::equals ( const string::LinearString & u, const string::LinearSt
 		return false;
 }
 
-auto ExactEqualLinearString = ExactEqual::RegistratorWrapper < bool, string::LinearString > ( ExactEqual::equals );
+auto ExactEqualLinearString = ExactEqual::RegistratorWrapper < bool, string::LinearString < > > ( ExactEqual::equals );
 
-bool ExactEqual::equals ( const string::CyclicString & u, const string::CyclicString & v ) {
+bool ExactEqual::equals ( const string::CyclicString < > & u, const string::CyclicString < > & v ) {
 	int n = ( int ) u.getContent ( ).size ( );
 	int i = -1, j = -1, k;
 
@@ -60,7 +60,7 @@ bool ExactEqual::equals ( const string::CyclicString & u, const string::CyclicSt
 	return false;
 }
 
-auto ExactEqualCyclicString = ExactEqual::RegistratorWrapper < bool, string::CyclicString > ( ExactEqual::equals );
+auto ExactEqualCyclicString = ExactEqual::RegistratorWrapper < bool, string::CyclicString < > > ( ExactEqual::equals );
 
 } /* namespace naive */
 
diff --git a/alib2algo/src/string/naive/ExactEqual.h b/alib2algo/src/string/naive/ExactEqual.h
index aa13df39ac..94f9a2f117 100644
--- a/alib2algo/src/string/naive/ExactEqual.h
+++ b/alib2algo/src/string/naive/ExactEqual.h
@@ -21,8 +21,8 @@ public:
 	static bool equals(const string::String& u, const string::String& v);
 
 	static bool equals(const string::Epsilon < >& u, const string::Epsilon < >& v);
-	static bool equals(const string::LinearString& u, const string::LinearString& v);
-	static bool equals(const string::CyclicString& u, const string::CyclicString& v);
+	static bool equals(const string::LinearString < >& u, const string::LinearString < >& v);
+	static bool equals(const string::CyclicString < >& u, const string::CyclicString < >& v);
 };
 
 } /* namespace naive */
diff --git a/alib2algo/src/string/simplify/NormalizeAlphabet.cpp b/alib2algo/src/string/simplify/NormalizeAlphabet.cpp
index bfb81842b0..9e41d1cc3b 100644
--- a/alib2algo/src/string/simplify/NormalizeAlphabet.cpp
+++ b/alib2algo/src/string/simplify/NormalizeAlphabet.cpp
@@ -21,7 +21,7 @@ string::String NormalizeAlphabet::normalize(const string::String& string) {
 	return dispatch(string.getData());
 }
 
-string::LinearString NormalizeAlphabet::normalize(const string::LinearString& string) {
+string::LinearString < > NormalizeAlphabet::normalize(const string::LinearString < >& string) {
 	int counter = 0;
 	std::map<alphabet::Symbol, char > normalizationData;
 
@@ -41,11 +41,11 @@ string::LinearString NormalizeAlphabet::normalize(const string::LinearString& st
 		data.push_back(alphabet::symbolFrom((char) (normalizationData.find(symbol)->second + 'a')));
 	}
 
-	string::LinearString result(alphabet, data);
+	string::LinearString < > result(alphabet, data);
 	return result;
 }
 
-auto NormalizeAlphabetLinearString = NormalizeAlphabet::RegistratorWrapper<string::LinearString, string::LinearString>(NormalizeAlphabet::normalize);
+auto NormalizeAlphabetLinearString = NormalizeAlphabet::RegistratorWrapper<string::LinearString < >, string::LinearString < >>(NormalizeAlphabet::normalize);
 
 } /* namespace simplify */
 
diff --git a/alib2algo/src/string/simplify/NormalizeAlphabet.h b/alib2algo/src/string/simplify/NormalizeAlphabet.h
index 72260afaa5..c92ef87992 100644
--- a/alib2algo/src/string/simplify/NormalizeAlphabet.h
+++ b/alib2algo/src/string/simplify/NormalizeAlphabet.h
@@ -24,7 +24,7 @@ public:
 	 */
 	static string::String normalize(const string::String& str);
 
-	static string::LinearString normalize(const string::LinearString& str);
+	static string::LinearString < > normalize(const string::LinearString < >& str);
 };
 
 } /* namespace simplify */
diff --git a/alib2algo/src/string/simplify/NormalizeRotation.cpp b/alib2algo/src/string/simplify/NormalizeRotation.cpp
index b55f435850..a2d3adc831 100644
--- a/alib2algo/src/string/simplify/NormalizeRotation.cpp
+++ b/alib2algo/src/string/simplify/NormalizeRotation.cpp
@@ -17,7 +17,7 @@ string::String NormalizeRotation::normalize(const string::String& string) {
 	return dispatch(string.getData());
 }
 
-string::CyclicString NormalizeRotation::normalize(const string::CyclicString& string) {
+string::CyclicString < > NormalizeRotation::normalize(const string::CyclicString < >& string) {
 	/**
 	 * Lexicographically least circular substrings
 	 * Kellogg S. Booth
@@ -51,10 +51,10 @@ string::CyclicString NormalizeRotation::normalize(const string::CyclicString& st
 		rotated.push_back(data[l % data.size()]);
 	}
 
-	return string::CyclicString { string.getAlphabet(), rotated };
+	return string::CyclicString < > { string.getAlphabet(), rotated };
 }
 
-auto NormalizeRotationCyclicString = NormalizeRotation::RegistratorWrapper<string::CyclicString, string::CyclicString>(NormalizeRotation::normalize);
+auto NormalizeRotationCyclicString = NormalizeRotation::RegistratorWrapper<string::CyclicString < >, string::CyclicString < >>(NormalizeRotation::normalize);
 
 } /* namespace simplify */
 
diff --git a/alib2algo/src/string/simplify/NormalizeRotation.h b/alib2algo/src/string/simplify/NormalizeRotation.h
index 4352a866bd..adb1e28ac9 100644
--- a/alib2algo/src/string/simplify/NormalizeRotation.h
+++ b/alib2algo/src/string/simplify/NormalizeRotation.h
@@ -25,7 +25,7 @@ public:
 	 */
 	static string::String normalize(const string::String& string);
 
-	static string::CyclicString normalize(const string::CyclicString& string);
+	static string::CyclicString < > normalize(const string::CyclicString < >& string);
 };
 
 } /* namespace simplify */
diff --git a/alib2algo/src/stringology/exact/BackwardDAWGMatching.cpp b/alib2algo/src/stringology/exact/BackwardDAWGMatching.cpp
index 15adaa4eb0..e31c88aeae 100644
--- a/alib2algo/src/stringology/exact/BackwardDAWGMatching.cpp
+++ b/alib2algo/src/stringology/exact/BackwardDAWGMatching.cpp
@@ -21,7 +21,7 @@ std::set < unsigned > BackwardDAWGMatching::match ( const string::String & subje
     return dispatch ( subject.getData ( ), pattern.getData ( ) );
 }
 
-std::set < unsigned > BackwardDAWGMatching::match ( const string::LinearString & subject, const string::LinearString & pattern ) {
+std::set < unsigned > BackwardDAWGMatching::match ( const string::LinearString < > & subject, const string::LinearString < > & pattern ) {
     std::set < unsigned > occ;
 
     measurements::start ( "Preprocess", measurements::Type::PREPROCESS );
@@ -30,7 +30,7 @@ std::set < unsigned > BackwardDAWGMatching::match ( const string::LinearString &
 
     reverse ( patternData.begin ( ), patternData.end ( ) );
 
-    const string::LinearString reversedPattern ( std::move ( patternData ) );
+    const string::LinearString < > reversedPattern ( std::move ( patternData ) );
 
     automaton::DFA<> suffixAutomaton = SuffixAutomaton::construct ( reversedPattern );
 
@@ -75,7 +75,7 @@ std::set < unsigned > BackwardDAWGMatching::match ( const string::LinearString &
     return occ;
 }
 
-auto BackwardDAWGMatchingLinearStringLinearString = BackwardDAWGMatching::RegistratorWrapper < std::set < unsigned >, string::LinearString, string::LinearString > ( BackwardDAWGMatching::match );
+auto BackwardDAWGMatchingLinearStringLinearString = BackwardDAWGMatching::RegistratorWrapper < std::set < unsigned >, string::LinearString < >, string::LinearString < > > ( BackwardDAWGMatching::match );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/BackwardDAWGMatching.h b/alib2algo/src/stringology/exact/BackwardDAWGMatching.h
index 0e7a1291d8..ec745f4120 100644
--- a/alib2algo/src/stringology/exact/BackwardDAWGMatching.h
+++ b/alib2algo/src/stringology/exact/BackwardDAWGMatching.h
@@ -25,7 +25,7 @@ public:
      * @return set set of occurences
      */
     static std::set < unsigned > match ( const string::String & subject, const string::String & pattern );
-    static std::set < unsigned > match ( const string::LinearString & subject, const string::LinearString & pattern );
+    static std::set < unsigned > match ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/BackwardNondeterministicDAWGMatching.cpp b/alib2algo/src/stringology/exact/BackwardNondeterministicDAWGMatching.cpp
index 13281689cf..43982f7d2e 100644
--- a/alib2algo/src/stringology/exact/BackwardNondeterministicDAWGMatching.cpp
+++ b/alib2algo/src/stringology/exact/BackwardNondeterministicDAWGMatching.cpp
@@ -21,7 +21,7 @@ std::set < unsigned > BackwardNondeterministicDAWGMatching::matchTemplate ( cons
 }
 
 template < size_t BitmaskBitCount >
-std::set < unsigned > BackwardNondeterministicDAWGMatching::matchTemplate ( const string::LinearString & subject, const string::LinearString & pattern ) {
+std::set < unsigned > BackwardNondeterministicDAWGMatching::matchTemplate ( const string::LinearString < > & subject, const string::LinearString < > & pattern ) {
     std::set < unsigned > occ;
 
      // Setup helper variables
@@ -95,7 +95,7 @@ std::set < unsigned > BackwardNondeterministicDAWGMatching::match ( const string
     return BackwardNondeterministicDAWGMatching::match32 ( subject, pattern );
 }
 
-std::set < unsigned > BackwardNondeterministicDAWGMatching::match ( const string::LinearString & subject, const string::LinearString & pattern ) {
+std::set < unsigned > BackwardNondeterministicDAWGMatching::match ( const string::LinearString < > & subject, const string::LinearString < > & pattern ) {
     return BackwardNondeterministicDAWGMatching::match32 ( subject, pattern );
 }
 
@@ -103,7 +103,7 @@ std::set < unsigned > BackwardNondeterministicDAWGMatching::match32 ( const stri
     return BackwardNondeterministicDAWGMatching::matchTemplate < 32 > ( subject, pattern );
 }
 
-std::set < unsigned > BackwardNondeterministicDAWGMatching::match32 ( const string::LinearString & subject, const string::LinearString & pattern ) {
+std::set < unsigned > BackwardNondeterministicDAWGMatching::match32 ( const string::LinearString < > & subject, const string::LinearString < > & pattern ) {
     return BackwardNondeterministicDAWGMatching::matchTemplate < 32 > ( subject, pattern );
 }
 
@@ -111,7 +111,7 @@ std::set < unsigned > BackwardNondeterministicDAWGMatching::match64 ( const stri
     return BackwardNondeterministicDAWGMatching::matchTemplate < 64 > ( subject, pattern );
 }
 
-std::set < unsigned > BackwardNondeterministicDAWGMatching::match64 ( const string::LinearString & subject, const string::LinearString & pattern ) {
+std::set < unsigned > BackwardNondeterministicDAWGMatching::match64 ( const string::LinearString < > & subject, const string::LinearString < > & pattern ) {
     return BackwardNondeterministicDAWGMatching::matchTemplate < 64 > ( subject, pattern );
 }
 
@@ -119,11 +119,11 @@ std::set < unsigned > BackwardNondeterministicDAWGMatching::match128 ( const str
     return BackwardNondeterministicDAWGMatching::matchTemplate < 128 > ( subject, pattern );
 }
 
-std::set < unsigned > BackwardNondeterministicDAWGMatching::match128 ( const string::LinearString & subject, const string::LinearString & pattern ) {
+std::set < unsigned > BackwardNondeterministicDAWGMatching::match128 ( const string::LinearString < > & subject, const string::LinearString < > & pattern ) {
     return BackwardNondeterministicDAWGMatching::matchTemplate < 128 > ( subject, pattern );
 }
 
-auto BackwardNondeterministicDAWGMatchingLinearStringLinearString = BackwardNondeterministicDAWGMatching::RegistratorWrapper < std::set < unsigned >, string::LinearString, string::LinearString > ( BackwardNondeterministicDAWGMatching::match );
+auto BackwardNondeterministicDAWGMatchingLinearStringLinearString = BackwardNondeterministicDAWGMatching::RegistratorWrapper < std::set < unsigned >, string::LinearString < >, string::LinearString < > > ( BackwardNondeterministicDAWGMatching::match );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/BackwardNondeterministicDAWGMatching.hpp b/alib2algo/src/stringology/exact/BackwardNondeterministicDAWGMatching.hpp
index d428ca01a5..1c2ea27fe5 100644
--- a/alib2algo/src/stringology/exact/BackwardNondeterministicDAWGMatching.hpp
+++ b/alib2algo/src/stringology/exact/BackwardNondeterministicDAWGMatching.hpp
@@ -28,21 +28,21 @@ private:
     static std::set < unsigned > matchTemplate ( const string::String & subject, const string::String & pattern );
 
     template <size_t BitmaskBitCount >
-    static std::set < unsigned > matchTemplate ( const string::LinearString & subject, const string::LinearString & pattern );
+    static std::set < unsigned > matchTemplate ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 public:
 
     // Defaults to 32 bits
     static std::set < unsigned > match ( const string::String & subject, const string::String & pattern );
-    static std::set < unsigned > match ( const string::LinearString & subject, const string::LinearString & pattern );
+    static std::set < unsigned > match ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 
     static std::set < unsigned > match32 ( const string::String & subject, const string::String & pattern );
-    static std::set < unsigned > match32 ( const string::LinearString & subject, const string::LinearString & pattern );
+    static std::set < unsigned > match32 ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 
     static std::set < unsigned > match64 ( const string::String & subject, const string::String & pattern );
-    static std::set < unsigned > match64 ( const string::LinearString & subject, const string::LinearString & pattern );
+    static std::set < unsigned > match64 ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 
     static std::set < unsigned > match128 ( const string::String & subject, const string::String & pattern );
-    static std::set < unsigned > match128 ( const string::LinearString & subject, const string::LinearString & pattern );
+    static std::set < unsigned > match128 ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/BackwardOracleMatching.cpp b/alib2algo/src/stringology/exact/BackwardOracleMatching.cpp
index 1dc04f5c89..ffb2f5513a 100644
--- a/alib2algo/src/stringology/exact/BackwardOracleMatching.cpp
+++ b/alib2algo/src/stringology/exact/BackwardOracleMatching.cpp
@@ -21,7 +21,7 @@ std::set < unsigned > BackwardOracleMatching::match ( const string::String & sub
     return dispatch ( subject.getData ( ), pattern.getData ( ) );
 }
 
-std::set < unsigned > BackwardOracleMatching::match ( const string::LinearString & subject, const string::LinearString & pattern ) {
+std::set < unsigned > BackwardOracleMatching::match ( const string::LinearString < > & subject, const string::LinearString < > & pattern ) {
     std::set < unsigned > occ;
 
     measurements::start ( "Preprocess", measurements::Type::PREPROCESS );
@@ -30,7 +30,7 @@ std::set < unsigned > BackwardOracleMatching::match ( const string::LinearString
 
     reverse ( patternData.begin ( ), patternData.end ( ) );
 
-    const string::LinearString reversedPattern ( std::move ( patternData ) );
+    const string::LinearString < > reversedPattern ( std::move ( patternData ) );
 
     automaton::DFA<> factorOracle = FactorOracleAutomaton::construct ( reversedPattern );
 
@@ -71,7 +71,7 @@ std::set < unsigned > BackwardOracleMatching::match ( const string::LinearString
     return occ;
 }
 
-auto BackwardOracleMatchingLinearStringLinearString = BackwardOracleMatching::RegistratorWrapper < std::set < unsigned >, string::LinearString, string::LinearString > ( BackwardOracleMatching::match );
+auto BackwardOracleMatchingLinearStringLinearString = BackwardOracleMatching::RegistratorWrapper < std::set < unsigned >, string::LinearString < >, string::LinearString < > > ( BackwardOracleMatching::match );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/BackwardOracleMatching.h b/alib2algo/src/stringology/exact/BackwardOracleMatching.h
index d602d2fd03..9661283dae 100644
--- a/alib2algo/src/stringology/exact/BackwardOracleMatching.h
+++ b/alib2algo/src/stringology/exact/BackwardOracleMatching.h
@@ -25,7 +25,7 @@ public:
      * @return set set of occurences
      */
     static std::set < unsigned > match ( const string::String & subject, const string::String & pattern );
-    static std::set < unsigned > match ( const string::LinearString & subject, const string::LinearString & pattern );
+    static std::set < unsigned > match ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/BadCharacterShiftTable.cpp b/alib2algo/src/stringology/exact/BadCharacterShiftTable.cpp
index ae0a9a84ac..9b0cca0bd6 100644
--- a/alib2algo/src/stringology/exact/BadCharacterShiftTable.cpp
+++ b/alib2algo/src/stringology/exact/BadCharacterShiftTable.cpp
@@ -18,7 +18,7 @@ std::map<alphabet::Symbol, size_t> BadCharacterShiftTable::bcs(const string::Str
 	return dispatch(pattern.getData());
 }
 
-std::map<alphabet::Symbol, size_t> BadCharacterShiftTable::bcs(const string::LinearString& pattern) {
+std::map<alphabet::Symbol, size_t> BadCharacterShiftTable::bcs(const string::LinearString < >& pattern) {
 	const std::set<alphabet::Symbol>& alphabet = pattern.getAlphabet();
 	std::map<alphabet::Symbol, size_t> bcs;
 
@@ -40,7 +40,7 @@ std::map<alphabet::Symbol, size_t> BadCharacterShiftTable::bcs(const string::Lin
 	return bcs;
 }
 
-auto BadCharacterShiftTableLinearString = BadCharacterShiftTable::RegistratorWrapper<std::map<alphabet::Symbol, size_t>, string::LinearString>(BadCharacterShiftTable::bcs);
+auto BadCharacterShiftTableLinearString = BadCharacterShiftTable::RegistratorWrapper<std::map<alphabet::Symbol, size_t>, string::LinearString < >>(BadCharacterShiftTable::bcs);
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/BadCharacterShiftTable.h b/alib2algo/src/stringology/exact/BadCharacterShiftTable.h
index b8f97bc5f4..ba68c20b2f 100644
--- a/alib2algo/src/stringology/exact/BadCharacterShiftTable.h
+++ b/alib2algo/src/stringology/exact/BadCharacterShiftTable.h
@@ -31,7 +31,7 @@ public:
 	 */
 	static std::map < alphabet::Symbol, size_t > bcs ( const string::String & pattern );
 
-	static std::map < alphabet::Symbol, size_t > bcs ( const string::LinearString & pattern );
+	static std::map < alphabet::Symbol, size_t > bcs ( const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/BorderArray.cpp b/alib2algo/src/stringology/exact/BorderArray.cpp
index 2b2ad25be7..8ca9734ab7 100644
--- a/alib2algo/src/stringology/exact/BorderArray.cpp
+++ b/alib2algo/src/stringology/exact/BorderArray.cpp
@@ -21,7 +21,7 @@ std::vector<unsigned> BorderArray::construct(const string::String& string) {
 	return dispatch(string.getData());
 }
 
-std::vector<unsigned> BorderArray::construct(const string::LinearString& string) {
+std::vector<unsigned> BorderArray::construct(const string::LinearString < >& string) {
 	const auto& w = string.getContent();
 	std::vector<unsigned> res(w.size() + 1);
 
@@ -41,7 +41,7 @@ std::vector<unsigned> BorderArray::construct(const string::LinearString& string)
 	return res;
 }
 
-auto BorderArrayLinearString = BorderArray::RegistratorWrapper<std::vector<unsigned>, string::LinearString>(BorderArray::construct);
+auto BorderArrayLinearString = BorderArray::RegistratorWrapper<std::vector<unsigned>, string::LinearString < >>(BorderArray::construct);
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/BorderArray.h b/alib2algo/src/stringology/exact/BorderArray.h
index 8e526ccbe7..e60236e6a5 100644
--- a/alib2algo/src/stringology/exact/BorderArray.h
+++ b/alib2algo/src/stringology/exact/BorderArray.h
@@ -25,7 +25,7 @@ public:
 	 */
 	static std::vector<unsigned> construct(const string::String& string);
 
-	static std::vector<unsigned> construct(const string::LinearString& string);
+	static std::vector<unsigned> construct(const string::LinearString < >& string);
 };
 
 } /* namespace exact */
diff --git a/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp b/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp
index c3e084ddb0..01c0fae31c 100644
--- a/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp
+++ b/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp
@@ -22,7 +22,7 @@ std::set<unsigned> BoyerMooreHorspool::match(const string::String& subject, cons
 	return dispatch(subject.getData(), pattern.getData());
 }
 
-std::set<unsigned> BoyerMooreHorspool::match(const string::LinearString& string, const string::LinearString& pattern)
+std::set<unsigned> BoyerMooreHorspool::match(const string::LinearString < >& string, const string::LinearString < >& pattern)
 {
 	std::set<unsigned> occ;
 
@@ -48,7 +48,7 @@ std::set<unsigned> BoyerMooreHorspool::match(const string::LinearString& string,
 	return occ;
 }
 
-auto BoyerMooreHorpoolLinearStringLinearString = BoyerMooreHorspool::RegistratorWrapper<std::set<unsigned>, string::LinearString, string::LinearString>(BoyerMooreHorspool::match);
+auto BoyerMooreHorpoolLinearStringLinearString = BoyerMooreHorspool::RegistratorWrapper<std::set<unsigned>, string::LinearString < >, string::LinearString < >>(BoyerMooreHorspool::match);
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/BoyerMooreHorspool.h b/alib2algo/src/stringology/exact/BoyerMooreHorspool.h
index f6faba17bd..fc5e5205ec 100644
--- a/alib2algo/src/stringology/exact/BoyerMooreHorspool.h
+++ b/alib2algo/src/stringology/exact/BoyerMooreHorspool.h
@@ -29,7 +29,7 @@ public:
 	 */
 	static std::set < unsigned > match ( const string::String & subject, const string::String & pattern );
 
-	static std::set < unsigned > match ( const string::LinearString & subject, const string::LinearString & pattern );
+	static std::set < unsigned > match ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.cpp b/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.cpp
index e52bbe2d26..38ae488a66 100644
--- a/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.cpp
+++ b/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.cpp
@@ -22,7 +22,7 @@ std::set < unsigned > DeadZoneUsingBadCharacterShift::match ( const string::Stri
 	return dispatch ( subject.getData ( ), pattern.getData ( ) );
 }
 
-std::set < unsigned > DeadZoneUsingBadCharacterShift::match ( const string::LinearString & string, const string::LinearString & pattern ) {
+std::set < unsigned > DeadZoneUsingBadCharacterShift::match ( const string::LinearString < > & string, const string::LinearString < > & pattern ) {
 	std::set < unsigned > occ;
 	std::map < alphabet::Symbol, size_t > fbcs = BadCharacterShiftTable::bcs ( pattern );     // NOTE: the subjects alphabet must be a subset or equal to the pattern
 	std::map < alphabet::Symbol, size_t > bbcs = ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern
@@ -31,7 +31,7 @@ std::set < unsigned > DeadZoneUsingBadCharacterShift::match ( const string::Line
 	return occ;
 }
 
-void DeadZoneUsingBadCharacterShift::match_rec ( std::set < unsigned > & occ, const string::LinearString & string, const string::LinearString & pattern, std::map < alphabet::Symbol, size_t > & fbcs, std::map < alphabet::Symbol, size_t > & bbcs, int low, int high ) {
+void DeadZoneUsingBadCharacterShift::match_rec ( std::set < unsigned > & occ, const string::LinearString < > & string, const string::LinearString < > & pattern, std::map < alphabet::Symbol, size_t > & fbcs, std::map < alphabet::Symbol, size_t > & bbcs, int low, int high ) {
 	if ( low >= high ) return;
 
 	int middle = ( low + high ) / 2;
@@ -47,7 +47,7 @@ void DeadZoneUsingBadCharacterShift::match_rec ( std::set < unsigned > & occ, co
 	match_rec ( occ, string, pattern, fbcs, bbcs, middle + fbcs[string.getContent ( )[middle + pattern.getContent ( ).size ( ) - 1]], high );
 }
 
-auto DeadZoneUsingBadCharacterShiftLinearStringLinearString = DeadZoneUsingBadCharacterShift::RegistratorWrapper < std::set < unsigned >, string::LinearString, string::LinearString > ( DeadZoneUsingBadCharacterShift::match );
+auto DeadZoneUsingBadCharacterShiftLinearStringLinearString = DeadZoneUsingBadCharacterShift::RegistratorWrapper < std::set < unsigned >, string::LinearString < >, string::LinearString < > > ( DeadZoneUsingBadCharacterShift::match );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.h b/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.h
index 0e8f178a79..a6977adc87 100644
--- a/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.h
+++ b/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.h
@@ -28,8 +28,8 @@ public:
 	 */
 	static std::set < unsigned > match ( const string::String & subject, const string::String & pattern );
 
-	static std::set < unsigned > match ( const string::LinearString & subject, const string::LinearString & pattern );
-	static void match_rec ( std::set < unsigned > & occ, const string::LinearString & string, const string::LinearString & pattern, std::map < alphabet::Symbol, size_t > & fbcs, std::map < alphabet::Symbol, size_t > & bbcs, int low, int high );
+	static std::set < unsigned > match ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
+	static void match_rec ( std::set < unsigned > & occ, const string::LinearString < > & string, const string::LinearString < > & pattern, std::map < alphabet::Symbol, size_t > & fbcs, std::map < alphabet::Symbol, size_t > & bbcs, int low, int high );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/ExactFactorAutomaton.cpp b/alib2algo/src/stringology/exact/ExactFactorAutomaton.cpp
index 5a679c9889..2dad610664 100644
--- a/alib2algo/src/stringology/exact/ExactFactorAutomaton.cpp
+++ b/alib2algo/src/stringology/exact/ExactFactorAutomaton.cpp
@@ -19,7 +19,7 @@ automaton::Automaton ExactFactorAutomaton::construct(const string::String& text)
 	return dispatch(text.getData());
 }
 
-automaton::EpsilonNFA < > ExactFactorAutomaton::construct(const string::LinearString& text) {
+automaton::EpsilonNFA < > ExactFactorAutomaton::construct(const string::LinearString < >& text) {
 	automaton::EpsilonNFA < > res(label::labelFrom(0));
 	res.addFinalState(label::labelFrom(0));
 	res.setInputAlphabet(text.getAlphabet());
@@ -34,7 +34,7 @@ automaton::EpsilonNFA < > ExactFactorAutomaton::construct(const string::LinearSt
 	return res;
 }
 
-auto ExactFactorAutomatonLinearString = ExactFactorAutomaton::RegistratorWrapper<automaton::EpsilonNFA < >, string::LinearString>(ExactFactorAutomaton::construct);
+auto ExactFactorAutomatonLinearString = ExactFactorAutomaton::RegistratorWrapper<automaton::EpsilonNFA < >, string::LinearString < >>(ExactFactorAutomaton::construct);
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/ExactFactorAutomaton.h b/alib2algo/src/stringology/exact/ExactFactorAutomaton.h
index ba7d395db4..5a80647854 100644
--- a/alib2algo/src/stringology/exact/ExactFactorAutomaton.h
+++ b/alib2algo/src/stringology/exact/ExactFactorAutomaton.h
@@ -26,7 +26,7 @@ public:
 	 */
 	static automaton::Automaton construct(const string::String& text);
 
-	static automaton::EpsilonNFA < > construct(const string::LinearString& text);
+	static automaton::EpsilonNFA < > construct(const string::LinearString < >& text);
 };
 
 } /* namespace exact */
diff --git a/alib2algo/src/stringology/exact/ExactFactorMatch.cpp b/alib2algo/src/stringology/exact/ExactFactorMatch.cpp
index 5172a2c4e0..1afd9953be 100644
--- a/alib2algo/src/stringology/exact/ExactFactorMatch.cpp
+++ b/alib2algo/src/stringology/exact/ExactFactorMatch.cpp
@@ -18,7 +18,7 @@ std::set < unsigned > ExactFactorMatch::match ( const string::String & subject,
 	return dispatch ( subject.getData ( ), pattern.getData ( ) );
 }
 
-std::set < unsigned > ExactFactorMatch::match ( const string::LinearString & subject, const string::LinearString & pattern ) {
+std::set < unsigned > ExactFactorMatch::match ( const string::LinearString < > & subject, const string::LinearString < > & pattern ) {
 	std::set < unsigned > occ;
 
 	for ( unsigned i = 0; i + pattern.getContent ( ).size ( ) <= subject.getContent ( ).size ( ); i++ ) {
@@ -34,7 +34,7 @@ std::set < unsigned > ExactFactorMatch::match ( const string::LinearString & sub
 	return occ;
 }
 
-auto ExactFactorMatchLinearString = ExactFactorMatch::RegistratorWrapper < std::set < unsigned >, string::LinearString > ( ExactFactorMatch::match );
+auto ExactFactorMatchLinearString = ExactFactorMatch::RegistratorWrapper < std::set < unsigned >, string::LinearString < > > ( ExactFactorMatch::match );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/ExactFactorMatch.h b/alib2algo/src/stringology/exact/ExactFactorMatch.h
index 4acb2883f1..6251ec8f54 100644
--- a/alib2algo/src/stringology/exact/ExactFactorMatch.h
+++ b/alib2algo/src/stringology/exact/ExactFactorMatch.h
@@ -25,7 +25,7 @@ public:
 	 */
 	static std::set<unsigned> match(const string::String& subject, const string::String& pattern);
 
-	static std::set<unsigned> match(const string::LinearString& subject, const string::LinearString& pattern);
+	static std::set<unsigned> match(const string::LinearString < >& subject, const string::LinearString < >& pattern);
 };
 
 } /* namespace exact */
diff --git a/alib2algo/src/stringology/exact/ExactMatchingAutomaton.cpp b/alib2algo/src/stringology/exact/ExactMatchingAutomaton.cpp
index 3e1a8ae623..e419a65b1f 100644
--- a/alib2algo/src/stringology/exact/ExactMatchingAutomaton.cpp
+++ b/alib2algo/src/stringology/exact/ExactMatchingAutomaton.cpp
@@ -19,7 +19,7 @@ automaton::Automaton ExactMatchingAutomaton::construct(const string::String& pat
 	return dispatch(pattern.getData());
 }
 
-automaton::NFA < > ExactMatchingAutomaton::construct(const string::LinearString& pattern) {
+automaton::NFA < > ExactMatchingAutomaton::construct(const string::LinearString < >& pattern) {
 	automaton::NFA < > res(label::labelFrom(0));
 	res.setInputAlphabet(pattern.getAlphabet());
 	for(const alphabet::Symbol& symbol : pattern.getAlphabet()) {
@@ -35,7 +35,7 @@ automaton::NFA < > ExactMatchingAutomaton::construct(const string::LinearString&
 	return res;
 }
 
-auto ExactMatchingAutomatonLinearString = ExactMatchingAutomaton::RegistratorWrapper<automaton::NFA < > , string::LinearString>(ExactMatchingAutomaton::construct);
+auto ExactMatchingAutomatonLinearString = ExactMatchingAutomaton::RegistratorWrapper<automaton::NFA < > , string::LinearString < >>(ExactMatchingAutomaton::construct);
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/ExactMatchingAutomaton.h b/alib2algo/src/stringology/exact/ExactMatchingAutomaton.h
index 8d166f803f..36c0a72fb0 100644
--- a/alib2algo/src/stringology/exact/ExactMatchingAutomaton.h
+++ b/alib2algo/src/stringology/exact/ExactMatchingAutomaton.h
@@ -26,7 +26,7 @@ public:
 	 */
 	static automaton::Automaton construct(const string::String& pattern);
 
-	static automaton::NFA < > construct(const string::LinearString& pattern);
+	static automaton::NFA < > construct(const string::LinearString < >& pattern);
 };
 
 } /* namespace exact */
diff --git a/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.cpp b/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.cpp
index 7449a5b0ee..0939794375 100644
--- a/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.cpp
+++ b/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.cpp
@@ -15,15 +15,15 @@ namespace stringology {
 namespace exact {
 
 automaton::Automaton ExactMultiNondeterministicSubsequenceAutomaton::construct(const std::set<string::String>& texts) {
-	return automaton::Automaton(ExactMultiNondeterministicSubsequenceAutomaton::construct(common::ContainerConverter<std::set<string::LinearString>, std::set<string::String>, string::LinearString>::convert(texts)));
+	return automaton::Automaton(ExactMultiNondeterministicSubsequenceAutomaton::construct(common::ContainerConverter<std::set<string::LinearString < >>, std::set<string::String>, string::LinearString < >>::convert(texts)));
 }
 
-automaton::EpsilonNFA < > ExactMultiNondeterministicSubsequenceAutomaton::construct(const std::set<string::LinearString>& texts) {
+automaton::EpsilonNFA < > ExactMultiNondeterministicSubsequenceAutomaton::construct(const std::set<string::LinearString < >>& texts) {
 	automaton::EpsilonNFA < > res(label::labelFrom(0));
 	res.addFinalState(label::labelFrom(0));
 
 	int j = 0;
-	for(const string::LinearString& text : texts) {
+	for(const string::LinearString < >& text : texts) {
 		res.addInputSymbols(text.getAlphabet());
 
 		res.addState(label::labelFrom(0, j));
diff --git a/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.h b/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.h
index 746e0f2cb9..af468031cc 100644
--- a/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.h
+++ b/alib2algo/src/stringology/exact/ExactMultiNondeterministicSubsequenceAutomaton.h
@@ -25,7 +25,7 @@ public:
 	 */
 	static automaton::Automaton construct(const std::set<string::String>& text);
 
-	static automaton::EpsilonNFA < > construct(const std::set<string::LinearString>& text);
+	static automaton::EpsilonNFA < > construct(const std::set<string::LinearString < >>& text);
 };
 
 } /* namespace exact */
diff --git a/alib2algo/src/stringology/exact/ExactNondeterministicSubsequenceAutomaton.cpp b/alib2algo/src/stringology/exact/ExactNondeterministicSubsequenceAutomaton.cpp
index 48bbd2e973..4ff89c5b07 100644
--- a/alib2algo/src/stringology/exact/ExactNondeterministicSubsequenceAutomaton.cpp
+++ b/alib2algo/src/stringology/exact/ExactNondeterministicSubsequenceAutomaton.cpp
@@ -19,7 +19,7 @@ automaton::Automaton ExactNondeterministicSubsequenceAutomaton::construct(const
 	return dispatch(text.getData());
 }
 
-automaton::EpsilonNFA < > ExactNondeterministicSubsequenceAutomaton::construct(const string::LinearString& text) {
+automaton::EpsilonNFA < > ExactNondeterministicSubsequenceAutomaton::construct(const string::LinearString < >& text) {
 	automaton::EpsilonNFA < > res(label::labelFrom(0));
 	res.addFinalState(label::labelFrom(0));
 	res.setInputAlphabet(text.getAlphabet());
@@ -36,7 +36,7 @@ automaton::EpsilonNFA < > ExactNondeterministicSubsequenceAutomaton::construct(c
 	return res;
 }
 
-auto ExactNondeterministicSubsequenceAutomatonLinearString = ExactNondeterministicSubsequenceAutomaton::RegistratorWrapper<automaton::EpsilonNFA < >, string::LinearString>( ExactNondeterministicSubsequenceAutomaton::construct );
+auto ExactNondeterministicSubsequenceAutomatonLinearString = ExactNondeterministicSubsequenceAutomaton::RegistratorWrapper<automaton::EpsilonNFA < >, string::LinearString < >>( ExactNondeterministicSubsequenceAutomaton::construct );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/ExactNondeterministicSubsequenceAutomaton.h b/alib2algo/src/stringology/exact/ExactNondeterministicSubsequenceAutomaton.h
index 77846c7d38..5912d0bdb2 100644
--- a/alib2algo/src/stringology/exact/ExactNondeterministicSubsequenceAutomaton.h
+++ b/alib2algo/src/stringology/exact/ExactNondeterministicSubsequenceAutomaton.h
@@ -26,7 +26,7 @@ public:
 	 */
 	static automaton::Automaton construct(const string::String& text);
 
-	static automaton::EpsilonNFA < > construct(const string::LinearString& text);
+	static automaton::EpsilonNFA < > construct(const string::LinearString < >& text);
 };
 
 } /* namespace exact */
diff --git a/alib2algo/src/stringology/exact/ExactSubsequenceAutomaton.cpp b/alib2algo/src/stringology/exact/ExactSubsequenceAutomaton.cpp
index 1f8e55d7bb..bded235021 100644
--- a/alib2algo/src/stringology/exact/ExactSubsequenceAutomaton.cpp
+++ b/alib2algo/src/stringology/exact/ExactSubsequenceAutomaton.cpp
@@ -19,7 +19,7 @@ automaton::Automaton ExactSubsequenceAutomaton::construct(const string::String&
 	return dispatch(text.getData());
 }
 
-automaton::DFA<> ExactSubsequenceAutomaton::construct(const string::LinearString& text) {
+automaton::DFA<> ExactSubsequenceAutomaton::construct(const string::LinearString < >& text) {
 	std::map<alphabet::Symbol, int> f;
 	for(const alphabet::Symbol& symbol : text.getAlphabet()) {
 		f[symbol] = 0;
@@ -43,7 +43,7 @@ automaton::DFA<> ExactSubsequenceAutomaton::construct(const string::LinearString
 	return res;
 }
 
-auto ExactSubsequenceAutomatonLinearString = ExactSubsequenceAutomaton::RegistratorWrapper<automaton::DFA<>, string::LinearString>(ExactSubsequenceAutomaton::construct);
+auto ExactSubsequenceAutomatonLinearString = ExactSubsequenceAutomaton::RegistratorWrapper<automaton::DFA<>, string::LinearString < >>(ExactSubsequenceAutomaton::construct);
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/ExactSubsequenceAutomaton.h b/alib2algo/src/stringology/exact/ExactSubsequenceAutomaton.h
index 371c0c4771..dc7a758d66 100644
--- a/alib2algo/src/stringology/exact/ExactSubsequenceAutomaton.h
+++ b/alib2algo/src/stringology/exact/ExactSubsequenceAutomaton.h
@@ -26,7 +26,7 @@ public:
 	 */
 	static automaton::Automaton construct(const string::String& text);
 
-	static automaton::DFA<> construct(const string::LinearString& text);
+	static automaton::DFA<> construct(const string::LinearString < >& text);
 };
 
 } /* namespace exact */
diff --git a/alib2algo/src/stringology/exact/FactorOracleAutomaton.cpp b/alib2algo/src/stringology/exact/FactorOracleAutomaton.cpp
index 2c11770e9e..8f4571cd7d 100644
--- a/alib2algo/src/stringology/exact/FactorOracleAutomaton.cpp
+++ b/alib2algo/src/stringology/exact/FactorOracleAutomaton.cpp
@@ -13,7 +13,7 @@ automaton::Automaton FactorOracleAutomaton::construct ( const string::String & p
     return dispatch ( pattern.getData ( ) );
 }
 
-automaton::DFA<> FactorOracleAutomaton::construct ( const string::LinearString & pattern ) {
+automaton::DFA<> FactorOracleAutomaton::construct ( const string::LinearString < > & pattern ) {
     automaton::DFA<> oracle ( label::labelFrom ( 0 ) );
 
     oracle.addFinalState ( oracle.getInitialState ( ) );
@@ -53,7 +53,7 @@ void FactorOracleAutomaton::oracleAddLetter ( automaton::DFA<> & oracle, const a
     supplyFunction.insert( { newState, supplyState } );
 }
 
-auto FactorOracleAutomatonLinearString = FactorOracleAutomaton::RegistratorWrapper < automaton::DFA<>, string::LinearString > ( FactorOracleAutomaton::construct );
+auto FactorOracleAutomatonLinearString = FactorOracleAutomaton::RegistratorWrapper < automaton::DFA<>, string::LinearString < > > ( FactorOracleAutomaton::construct );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/FactorOracleAutomaton.h b/alib2algo/src/stringology/exact/FactorOracleAutomaton.h
index d72f09681c..0be180afba 100644
--- a/alib2algo/src/stringology/exact/FactorOracleAutomaton.h
+++ b/alib2algo/src/stringology/exact/FactorOracleAutomaton.h
@@ -26,7 +26,7 @@ public:
      */
     static automaton::Automaton construct ( const string::String & pattern );
 
-    static automaton::DFA<> construct ( const string::LinearString & pattern );
+    static automaton::DFA<> construct ( const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.cpp b/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.cpp
index 5332c673a0..81c74bf1c0 100644
--- a/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.cpp
+++ b/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.cpp
@@ -18,7 +18,7 @@ std::map < alphabet::Symbol, size_t > ReversedBadCharacterShiftTable::bcs ( cons
 	return dispatch ( pattern.getData ( ) );
 }
 
-std::map < alphabet::Symbol, size_t > ReversedBadCharacterShiftTable::bcs ( const string::LinearString & pattern ) {
+std::map < alphabet::Symbol, size_t > ReversedBadCharacterShiftTable::bcs ( const string::LinearString < > & pattern ) {
 	const std::set < alphabet::Symbol > & alphabet = pattern.getAlphabet ( );
 	std::map < alphabet::Symbol, size_t > bcs;
 
@@ -33,7 +33,7 @@ std::map < alphabet::Symbol, size_t > ReversedBadCharacterShiftTable::bcs ( cons
 	return bcs;
 }
 
-auto ReversedBadCharacterShiftTableLinearString = ReversedBadCharacterShiftTable::RegistratorWrapper < std::map < alphabet::Symbol, size_t >, string::LinearString > ( ReversedBadCharacterShiftTable::bcs );
+auto ReversedBadCharacterShiftTableLinearString = ReversedBadCharacterShiftTable::RegistratorWrapper < std::map < alphabet::Symbol, size_t >, string::LinearString < > > ( ReversedBadCharacterShiftTable::bcs );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.h b/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.h
index 4bdc76cd2f..c7fd6c5050 100644
--- a/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.h
+++ b/alib2algo/src/stringology/exact/ReversedBadCharacterShiftTable.h
@@ -31,7 +31,7 @@ public:
 	 */
 	static std::map < alphabet::Symbol, size_t > bcs ( const string::String & pattern );
 
-	static std::map < alphabet::Symbol, size_t > bcs ( const string::LinearString & pattern );
+	static std::map < alphabet::Symbol, size_t > bcs ( const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.cpp b/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.cpp
index 9e601ca367..9b00bd4db0 100644
--- a/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.cpp
+++ b/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.cpp
@@ -21,7 +21,7 @@ std::set < unsigned > ReversedBoyerMooreHorspool::match ( const string::String &
 	return dispatch ( subject.getData ( ), pattern.getData ( ) );
 }
 
-std::set < unsigned > ReversedBoyerMooreHorspool::match ( const string::LinearString & string, const string::LinearString & pattern ) {
+std::set < unsigned > ReversedBoyerMooreHorspool::match ( const string::LinearString < > & string, const string::LinearString < > & pattern ) {
 	std::set < unsigned > occ;
 	std::map < alphabet::Symbol, size_t > bcs = ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern
 
@@ -44,7 +44,7 @@ std::set < unsigned > ReversedBoyerMooreHorspool::match ( const string::LinearSt
 	return occ;
 }
 
-auto ReversedBoyerMooreHorpoolLinearStringLinearString = ReversedBoyerMooreHorspool::RegistratorWrapper < std::set < unsigned >, string::LinearString, string::LinearString > ( ReversedBoyerMooreHorspool::match );
+auto ReversedBoyerMooreHorpoolLinearStringLinearString = ReversedBoyerMooreHorspool::RegistratorWrapper < std::set < unsigned >, string::LinearString < >, string::LinearString < > > ( ReversedBoyerMooreHorspool::match );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.h b/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.h
index 3e06417f4a..e398066892 100644
--- a/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.h
+++ b/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.h
@@ -29,7 +29,7 @@ public:
 	 */
 	static std::set < unsigned > match ( const string::String & subject, const string::String & pattern );
 
-	static std::set < unsigned > match ( const string::LinearString & subject, const string::LinearString & pattern );
+	static std::set < unsigned > match ( const string::LinearString < > & subject, const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/exact/SuffixAutomaton.cpp b/alib2algo/src/stringology/exact/SuffixAutomaton.cpp
index 2b62126453..e7e47e426e 100644
--- a/alib2algo/src/stringology/exact/SuffixAutomaton.cpp
+++ b/alib2algo/src/stringology/exact/SuffixAutomaton.cpp
@@ -17,7 +17,7 @@ automaton::Automaton SuffixAutomaton::naiveConstruct ( const string::String & pa
     return dispatch ( pattern.getData ( ) );
 }
 
-automaton::DFA<> SuffixAutomaton::naiveConstruct ( const string::LinearString & pattern ) {
+automaton::DFA<> SuffixAutomaton::naiveConstruct ( const string::LinearString < > & pattern ) {
     automaton::EpsilonNFA < > nfaSuffixAutomaton ( label::labelFrom ( 0 ) );
 
     nfaSuffixAutomaton.setInputAlphabet ( pattern.getAlphabet ( ) );
@@ -52,7 +52,7 @@ automaton::Automaton SuffixAutomaton::construct ( const string::String & pattern
     return dispatch ( pattern.getData ( ) );
 }
 
-automaton::DFA<> SuffixAutomaton::construct ( const string::LinearString & pattern ) {
+automaton::DFA<> SuffixAutomaton::construct ( const string::LinearString < > & pattern ) {
     automaton::DFA<> suffixAutomaton ( label::labelFrom ( 0 ) );
 
     suffixAutomaton.setInputAlphabet ( pattern.getAlphabet ( ) );
@@ -123,7 +123,7 @@ void SuffixAutomaton::suffixAutomatonAddSymbol ( automaton::DFA<> & suffixAutoma
     lastState = newState;
 }
 
-auto SuffixAutomatonLinearString = SuffixAutomaton::RegistratorWrapper < automaton::DFA<>, string::LinearString > ( SuffixAutomaton::construct );
+auto SuffixAutomatonLinearString = SuffixAutomaton::RegistratorWrapper < automaton::DFA<>, string::LinearString < > > ( SuffixAutomaton::construct );
 
 } /* namespace exact */
 
diff --git a/alib2algo/src/stringology/exact/SuffixAutomaton.h b/alib2algo/src/stringology/exact/SuffixAutomaton.h
index 1e793cb7d3..02a4c2ca9b 100644
--- a/alib2algo/src/stringology/exact/SuffixAutomaton.h
+++ b/alib2algo/src/stringology/exact/SuffixAutomaton.h
@@ -27,7 +27,7 @@ public:
      */
     static automaton::Automaton naiveConstruct ( const string::String & pattern );
 
-    static automaton::DFA<> naiveConstruct ( const string::LinearString & pattern );
+    static automaton::DFA<> naiveConstruct ( const string::LinearString < > & pattern );
 
      /**
      * Linear time on-line construction of minimal suffix automaton for given pattern.
@@ -35,7 +35,7 @@ public:
      */
     static automaton::Automaton construct ( const string::String & pattern );
 
-    static automaton::DFA<> construct ( const string::LinearString & pattern );
+    static automaton::DFA<> construct ( const string::LinearString < > & pattern );
 
 };
 
diff --git a/alib2algo/src/stringology/indexing/SuffixTrie.cpp b/alib2algo/src/stringology/indexing/SuffixTrie.cpp
index dcf497ef2e..e2d021b853 100644
--- a/alib2algo/src/stringology/indexing/SuffixTrie.cpp
+++ b/alib2algo/src/stringology/indexing/SuffixTrie.cpp
@@ -20,7 +20,7 @@ indexes::SuffixTrieFinalMark SuffixTrie::construct ( const string::String & stri
 	return dispatch ( string.getData ( ) );
 }
 
-indexes::SuffixTrieFinalMark SuffixTrie::construct ( const string::LinearString & w ) {
+indexes::SuffixTrieFinalMark SuffixTrie::construct ( const string::LinearString < > & w ) {
 	indexes::SuffixTrieFinalMark res ( w.getAlphabet ( ) );
 
 	for ( unsigned int i = 0; i < w.getContent ( ).size ( ); i++ ) {
@@ -40,7 +40,7 @@ indexes::SuffixTrieFinalMark SuffixTrie::construct ( const string::LinearString
 	return res;
 }
 
-auto SuffixTrieLinearString = SuffixTrie::RegistratorWrapper < indexes::SuffixTrieFinalMark, string::LinearString > ( SuffixTrie::construct );
+auto SuffixTrieLinearString = SuffixTrie::RegistratorWrapper < indexes::SuffixTrieFinalMark, string::LinearString < > > ( SuffixTrie::construct );
 
 indexes::SuffixTrieTerminatingSymbol SuffixTrie::construct ( const string::LinearStringTerminatingSymbol & w ) {
 	indexes::SuffixTrieTerminatingSymbol res ( w.getAlphabet ( ), w.getTerminatingSymbol ( ) );
diff --git a/alib2algo/src/stringology/indexing/SuffixTrie.h b/alib2algo/src/stringology/indexing/SuffixTrie.h
index ca75df33e4..ce370de9a9 100644
--- a/alib2algo/src/stringology/indexing/SuffixTrie.h
+++ b/alib2algo/src/stringology/indexing/SuffixTrie.h
@@ -34,7 +34,7 @@ public:
 	 */
 	static indexes::SuffixTrieFinalMark construct ( const string::String & string );
 
-	static indexes::SuffixTrieFinalMark construct ( const string::LinearString & string );
+	static indexes::SuffixTrieFinalMark construct ( const string::LinearString < > & string );
 	static indexes::SuffixTrieTerminatingSymbol construct ( const string::LinearStringTerminatingSymbol & string );
 
 };
diff --git a/alib2algo/test-src/grammar/generate/GrammarGenerateUpToLength.cpp b/alib2algo/test-src/grammar/generate/GrammarGenerateUpToLength.cpp
index 55189e5ec5..7c1058f32b 100644
--- a/alib2algo/test-src/grammar/generate/GrammarGenerateUpToLength.cpp
+++ b/alib2algo/test-src/grammar/generate/GrammarGenerateUpToLength.cpp
@@ -33,7 +33,7 @@ void GrammarGenerateUpToLength::testGenerate1() {
 	grammar1.setTerminalAlphabet({a, b});
 	grammar1.setGeneratesEpsilon(false);
 
-	std::set<string::LinearString> strings;
+	std::set<string::LinearString < >> strings;
 
 	CPPUNIT_ASSERT(strings == grammar::generate::GenerateUpToLength::generate(grammar1, 5));
 }
@@ -69,25 +69,25 @@ void GrammarGenerateUpToLength::testGenerate2() {
 	grammar1.addRule({D}, {d});
 	grammar1.setGeneratesEpsilon(true);
 
-	std::set<string::LinearString> strings;
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c, c}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c, c, c}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{d, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{d, d, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{a, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{a, d, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{b, c}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{b, c, c}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c, c, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c, d, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{a, c, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{b, c, d}));
-
-	for(const string::LinearString& str : grammar::generate::GenerateUpToLength::generate(grammar1, 3)) {
+	std::set<string::LinearString < >> strings;
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c, c}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c, c, c}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{d, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{d, d, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{a, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{a, d, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{b, c}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{b, c, c}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c, c, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c, d, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{a, c, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{b, c, d}));
+
+	for(const string::LinearString < >& str : grammar::generate::GenerateUpToLength::generate(grammar1, 3)) {
 		std::cout << alib::StringDataFactory::toString(string::String(str)) << std::endl;
 	}
 
@@ -123,17 +123,17 @@ void GrammarGenerateUpToLength::testGenerate3() {
 	grammar1.addRule({D}, {d, D});
 	grammar1.addRule({D}, {d});
 
-	std::set<string::LinearString> strings;
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{d, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{d, d, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{a, d, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c, c, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{c, d, d}));
-	strings.insert(string::LinearString(std::vector<alphabet::Symbol>{b, c, d}));
-
-	for(const string::LinearString& str : grammar::generate::GenerateUpToLength::generate(grammar1, 3)) {
+	std::set<string::LinearString < >> strings;
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{d, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{d, d, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{a, d, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c, c, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{c, d, d}));
+	strings.insert(string::LinearString < >(std::vector<alphabet::Symbol>{b, c, d}));
+
+	for(const string::LinearString < >& str : grammar::generate::GenerateUpToLength::generate(grammar1, 3)) {
 		std::cout << alib::StringDataFactory::toString(string::String(str)) << std::endl;
 	}
 
diff --git a/alib2algo/test-src/regexp/transform/RegExpDerivationTest.cpp b/alib2algo/test-src/regexp/transform/RegExpDerivationTest.cpp
index 9a773011a8..520884ec47 100644
--- a/alib2algo/test-src/regexp/transform/RegExpDerivationTest.cpp
+++ b/alib2algo/test-src/regexp/transform/RegExpDerivationTest.cpp
@@ -33,7 +33,7 @@ void RegExpDerivationTest::testRegExpDerivation() {
 void RegExpDerivationTest::ExecSingleTest(std::string regexp_str, std::string string_str, std::string result) {
     regexp::RegExp regexp = alib::StringDataFactory::fromString<regexp::RegExp>(regexp_str);
 
-    string::LinearString string = static_cast<const string::LinearString&>(alib::StringDataFactory::fromString<string::String>("\"" + string_str + "\"").getData());
+    string::LinearString < > string = static_cast<const string::LinearString < >&>(alib::StringDataFactory::fromString<string::String>("\"" + string_str + "\"").getData());
 
     std::cout << alib::StringDataFactory::toString<regexp::RegExp>(regexp::RegExpDerivation::derivation(regexp, string)) << " == " << std::endl << result << std::endl << std::endl;
 
diff --git a/alib2algo/test-src/regexp/transform/RegExpIntegralTest.cpp b/alib2algo/test-src/regexp/transform/RegExpIntegralTest.cpp
index b708f3f82e..ea0665f25c 100644
--- a/alib2algo/test-src/regexp/transform/RegExpIntegralTest.cpp
+++ b/alib2algo/test-src/regexp/transform/RegExpIntegralTest.cpp
@@ -25,7 +25,7 @@ void RegExpIntegralTest::testRegExpIntegral() {
 void RegExpIntegralTest::ExecSingleTest(std::string regexp_str, std::string string_str, std::string result) {
     regexp::RegExp regexp = alib::StringDataFactory::fromString<regexp::RegExp>(regexp_str);
 
-    string::LinearString string = static_cast<const string::LinearString&>(alib::StringDataFactory::fromString<string::String>("\"" + string_str + "\"").getData());
+    string::LinearString < > string = static_cast<const string::LinearString < >&>(alib::StringDataFactory::fromString<string::String>("\"" + string_str + "\"").getData());
 
     std::cout << alib::StringDataFactory::toString<regexp::RegExp>(regexp::RegExpIntegral::integral(regexp, string)) << " == " << result << std::endl;
 
diff --git a/alib2algo/test-src/string/compare/compareTest.cpp b/alib2algo/test-src/string/compare/compareTest.cpp
index 306f299f49..18a6924f53 100644
--- a/alib2algo/test-src/string/compare/compareTest.cpp
+++ b/alib2algo/test-src/string/compare/compareTest.cpp
@@ -20,8 +20,8 @@ void compareTest::tearDown() {
 }
 
 void compareTest::testCyclicStringCompareBoolean() {
-	string::CyclicString str1("alfa");
-	string::CyclicString str2("aalf");
+	string::CyclicString < > str1("alfa");
+	string::CyclicString < > str2("aalf");
 	str2.extendAlphabet(str1.getAlphabet());
 	str1.extendAlphabet(str2.getAlphabet());
 
@@ -29,15 +29,15 @@ void compareTest::testCyclicStringCompareBoolean() {
 }
 
 void compareTest::testCyclicStringCompareInt() {
-	string::CyclicString str1("alfa");
-	string::CyclicString str2("aalf");
+	string::CyclicString < > str1("alfa");
+	string::CyclicString < > str2("aalf");
 	str2.extendAlphabet(str1.getAlphabet());
 	str1.extendAlphabet(str2.getAlphabet());
 
 	CPPUNIT_ASSERT(string::naive::ExactCompare::compare(str1, str2) == 0);
 
-	string::CyclicString str3("ccbcccb");
-	string::CyclicString str4("cbcccbc");
+	string::CyclicString < > str3("ccbcccb");
+	string::CyclicString < > str4("cbcccbc");
 	str2.extendAlphabet(str1.getAlphabet());
 	str1.extendAlphabet(str2.getAlphabet());
 
@@ -45,16 +45,16 @@ void compareTest::testCyclicStringCompareInt() {
 }
 
 void compareTest::testCompareCyclic() {
-	string::CyclicString cyclic1({alphabet::symbolFrom(0), alphabet::symbolFrom(1), alphabet::symbolFrom(2)});
-	string::CyclicString cyclic2({alphabet::symbolFrom(1), alphabet::symbolFrom(2), alphabet::symbolFrom(0)});
-	string::CyclicString cyclic3({alphabet::symbolFrom(2), alphabet::symbolFrom(0), alphabet::symbolFrom(1)});
+	string::CyclicString < > cyclic1({alphabet::symbolFrom(0), alphabet::symbolFrom(1), alphabet::symbolFrom(2)});
+	string::CyclicString < > cyclic2({alphabet::symbolFrom(1), alphabet::symbolFrom(2), alphabet::symbolFrom(0)});
+	string::CyclicString < > cyclic3({alphabet::symbolFrom(2), alphabet::symbolFrom(0), alphabet::symbolFrom(1)});
 
-	string::CyclicString cyclic4({alphabet::symbolFrom(2), alphabet::symbolFrom(1), alphabet::symbolFrom(0)});
+	string::CyclicString < > cyclic4({alphabet::symbolFrom(2), alphabet::symbolFrom(1), alphabet::symbolFrom(0)});
 
-	string::CyclicString cyclic1n = string::simplify::NormalizeRotation::normalize(cyclic1);
-	string::CyclicString cyclic2n = string::simplify::NormalizeRotation::normalize(cyclic2);
-	string::CyclicString cyclic3n = string::simplify::NormalizeRotation::normalize(cyclic3);
-	string::CyclicString cyclic4n = string::simplify::NormalizeRotation::normalize(cyclic4);
+	string::CyclicString < > cyclic1n = string::simplify::NormalizeRotation::normalize(cyclic1);
+	string::CyclicString < > cyclic2n = string::simplify::NormalizeRotation::normalize(cyclic2);
+	string::CyclicString < > cyclic3n = string::simplify::NormalizeRotation::normalize(cyclic3);
+	string::CyclicString < > cyclic4n = string::simplify::NormalizeRotation::normalize(cyclic4);
 
 
 	CPPUNIT_ASSERT(cyclic1n == cyclic2n);
diff --git a/alib2algo/test-src/stringology/exact/FactorOracleAutomatonTest.cpp b/alib2algo/test-src/stringology/exact/FactorOracleAutomatonTest.cpp
index 6ab3780e61..3c799c3b50 100644
--- a/alib2algo/test-src/stringology/exact/FactorOracleAutomatonTest.cpp
+++ b/alib2algo/test-src/stringology/exact/FactorOracleAutomatonTest.cpp
@@ -21,7 +21,7 @@ void FactorOracleAutomatonTest::tearDown ( ) {
 
 void FactorOracleAutomatonTest::testFactorOracleConstruction ( ) {
 
-    string::LinearString pattern ( "atatac" );
+    string::LinearString < > pattern ( "atatac" );
 
     automaton::DFA<> oracle = stringology::exact::FactorOracleAutomaton::construct ( pattern );
 
diff --git a/alib2algo/test-src/stringology/exact/SuffixAutomatonTest.cpp b/alib2algo/test-src/stringology/exact/SuffixAutomatonTest.cpp
index b26ae278c7..47d90bc1c7 100644
--- a/alib2algo/test-src/stringology/exact/SuffixAutomatonTest.cpp
+++ b/alib2algo/test-src/stringology/exact/SuffixAutomatonTest.cpp
@@ -21,7 +21,7 @@ void SuffixAutomatonTest::tearDown ( ) {
 
 void SuffixAutomatonTest::testSuffixAutomatonConstruction ( ) {
 
-    string::LinearString pattern ( "atatac" );
+    string::LinearString < > pattern ( "atatac" );
 
     automaton::DFA<> suffixAutomaton = stringology::exact::SuffixAutomaton::construct ( pattern );
 
diff --git a/alib2data/src/regexp/RegExp.cpp b/alib2data/src/regexp/RegExp.cpp
index 5092fb1044..c56a4684b7 100644
--- a/alib2data/src/regexp/RegExp.cpp
+++ b/alib2data/src/regexp/RegExp.cpp
@@ -22,11 +22,11 @@ const std::set < alphabet::Symbol > & RegExp::getAlphabet ( ) const {
 }
 
 regexp::RegExp regexpFrom ( const std::string & string ) {
-	return regexpFrom ( string::LinearString ( string ) );
+	return regexpFrom ( string::LinearString < > ( string ) );
 }
 
 regexp::RegExp regexpFrom ( const char * string ) {
-	return regexpFrom ( string::LinearString ( string ) );
+	return regexpFrom ( string::LinearString < > ( string ) );
 }
 
 regexp::RegExp regexpFrom ( std::vector < alphabet::Symbol > string ) {
@@ -35,32 +35,24 @@ regexp::RegExp regexpFrom ( std::vector < alphabet::Symbol > string ) {
 	for ( auto & symbol : string )
 		con.appendElement ( regexp::UnboundedRegExpSymbol ( symbol ) );
 
-	return regexp::RegExp {
-			   regexp::UnboundedRegExp ( std::move ( con ) )
-	};
+	return regexp::RegExp { regexp::UnboundedRegExp ( std::move ( con ) ) };
 }
 
-regexp::RegExp regexpFrom ( string::LinearString string ) {
+regexp::RegExp regexpFrom ( string::LinearString < > string ) {
 	regexp::UnboundedRegExpConcatenation con;
 
 	for ( auto & symbol : string.getContent ( ) )
 		con.appendElement ( regexp::UnboundedRegExpSymbol ( symbol ) );
 
-	return regexp::RegExp {
-			   regexp::UnboundedRegExp ( std::move ( con ) )
-	};
+	return regexp::RegExp { regexp::UnboundedRegExp ( std::move ( con ) ) };
 }
 
 regexp::RegExp regexpFrom ( alphabet::Symbol symbol ) {
-	return regexp::RegExp {
-			   regexp::UnboundedRegExp ( regexp::UnboundedRegExpSymbol ( std::move ( symbol ) ) )
-	};
+	return regexp::RegExp { regexp::UnboundedRegExp ( regexp::UnboundedRegExpSymbol ( std::move ( symbol ) ) ) };
 }
 
 regexp::RegExp regexpFrom ( ) {
-	return regexp::RegExp {
-			   regexp::UnboundedRegExp ( regexp::UnboundedRegExpEmpty { } )
-	};
+	return regexp::RegExp { regexp::UnboundedRegExp ( regexp::UnboundedRegExpEmpty { } ) };
 }
 
 } /* namespace regexp */
diff --git a/alib2data/src/regexp/RegExp.h b/alib2data/src/regexp/RegExp.h
index 33f79991f5..d46a011fcb 100644
--- a/alib2data/src/regexp/RegExp.h
+++ b/alib2data/src/regexp/RegExp.h
@@ -39,7 +39,7 @@ regexp::RegExp regexpFrom ( const std::string & string );
 
 regexp::RegExp regexpFrom ( const char * string );
 
-regexp::RegExp regexpFrom ( string::LinearString string );
+regexp::RegExp regexpFrom ( string::LinearString < > string );
 
 regexp::RegExp regexpFrom ( std::vector < alphabet::Symbol > string );
 
diff --git a/alib2data/src/string/CyclicString.cpp b/alib2data/src/string/CyclicString.cpp
index ee48fc2c25..3dbbcb0aa9 100644
--- a/alib2data/src/string/CyclicString.cpp
+++ b/alib2data/src/string/CyclicString.cpp
@@ -6,117 +6,17 @@
  */
 
 #include "CyclicString.h"
-#include "Epsilon.h"
-#include <exception/CommonException.h>
-
-#include <sstream>
-#include <algorithm>
-
-#include <sax/FromXMLParserHelper.h>
-#include "common/StringFromXMLParser.h"
-#include "common/StringToXMLComposer.h"
-#include "common/StringAuxiliary.h"
 #include "String.h"
 #include <object/Object.h>
 #include <XmlApi.hpp>
 #include <cast/CastApi.hpp>
 
-namespace string {
-
-CyclicString::CyclicString(std::set<alphabet::Symbol> alphabet, std::vector<alphabet::Symbol> data) : std::Components < CyclicString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) {
-	setContent(std::move(data));
-}
-
-CyclicString::CyclicString() : CyclicString ( std::set < alphabet::Symbol > ( ), std::vector < alphabet::Symbol > ( ) ) {
-}
-
-CyclicString::CyclicString(std::vector<alphabet::Symbol> data) : CyclicString ( std::set < alphabet::Symbol> ( data.begin(), data.end() ), data ) {
-}
-
-CyclicString::CyclicString(const std::string& string) : CyclicString ( StringAuxiliary::toInternal ( string ) ) {
-}
-
-CyclicString::CyclicString(const char* string) : CyclicString((std::string) string) {
-}
-
-CyclicString::CyclicString(const Epsilon < > & epsilon) : CyclicString ( epsilon.getAlphabet( ), std::vector < alphabet::Symbol > ( ) ) {
-}
-
-StringBase* CyclicString::clone() const {
-	return new CyclicString(*this);
-}
-
-StringBase* CyclicString::plunder() && {
-	return new CyclicString(std::move(*this));
-}
-
-const std::vector<alphabet::Symbol>& CyclicString::getContent() const {
-	return this->m_Data;
-}
-
-//serves as both move and copy content setter
-void CyclicString::setContent(std::vector<alphabet::Symbol> data) {
-	std::set<alphabet::Symbol> minimalAlphabet(data.begin(), data.end());
-	std::set<alphabet::Symbol> unknownSymbols;
-	std::set_difference(minimalAlphabet.begin(), minimalAlphabet.end(), getAlphabet().begin(), getAlphabet().end(), std::inserter(unknownSymbols, unknownSymbols.end()));
-
-	if(unknownSymbols.size() > 0)
-		throw exception::CommonException("Input symbols not in the alphabet.");
-
-	m_Data = std::move(data);
-}
-
-bool CyclicString::isEmpty() const {
-	return this->m_Data.size() == 0;
-}
-
-int CyclicString::compare(const CyclicString& other) const {
-	auto first = std::tie ( m_Data, getAlphabet ( ) );
-	auto second = std::tie ( other.m_Data, other.getAlphabet ( ) );
-
-	std::compare<decltype(first)> comp;
-	return comp(first, second);
-}
-
-void CyclicString::operator >>(std::ostream& out) const {
-	out << "(CyclicString ";
-	for(const alphabet::Symbol& symbol : this->m_Data)
-		out << symbol;
-	out << ")";
-}
-
-CyclicString::operator std::string () const {
-	std::stringstream ss;
-	ss << "<";
-	for(const alphabet::Symbol& symbol : this->m_Data)
-		ss << symbol;
-	ss << ">";
-	return std::move(ss).str();
-}
-
-CyclicString CyclicString::parse(std::deque<sax::Token>::iterator& input) {
-	sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::START_ELEMENT, CyclicString::getXmlTagName());
-	std::set<alphabet::Symbol> alphabet = StringFromXMLParser::parseAlphabet < alphabet::Symbol > (input);
-	std::vector<alphabet::Symbol> content = StringFromXMLParser::parseContent < alphabet::Symbol > (input);
-	sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, CyclicString::getXmlTagName());
-	return CyclicString ( std::move ( alphabet ), std::move ( content ) );
-}
-
-void CyclicString::compose(std::deque<sax::Token>& out) const {
-	out.emplace_back(CyclicString::getXmlTagName(), sax::Token::TokenType::START_ELEMENT);
-	StringToXMLComposer::compose(out, getAlphabet());
-	StringToXMLComposer::compose(out, m_Data);
-	out.emplace_back(CyclicString::getXmlTagName(), sax::Token::TokenType::END_ELEMENT);
-}
-
-} /* namespace string */
-
 namespace alib {
 
-auto cyclicStringParserRegister = xmlApi<string::String>::ParserRegister<string::CyclicString>();
-auto cyclicStringParserRegister2 = xmlApi<alib::Object>::ParserRegister<string::CyclicString>();
+auto cyclicStringParserRegister = xmlApi<string::String>::ParserRegister<string::CyclicString < > >();
+auto cyclicStringParserRegister2 = xmlApi<alib::Object>::ParserRegister<string::CyclicString < > >();
 
-auto CyclicStringFromEpsilon = castApi::CastRegister<string::CyclicString, string::Epsilon < > >();
-auto CyclicStringCastBinder = castApi::CastPoolStringBinder<string::CyclicString>(string::CyclicString::getXmlTagName());
+auto CyclicStringFromEpsilon = castApi::CastRegister<string::CyclicString < >, string::Epsilon < > >();
+auto CyclicStringCastBinder = castApi::CastPoolStringBinder<string::CyclicString < > >(string::CyclicString < >::getXmlTagName());
 
 } /* namespace alib */
diff --git a/alib2data/src/string/CyclicString.h b/alib2data/src/string/CyclicString.h
index cc9810b135..0afd702dc4 100644
--- a/alib2data/src/string/CyclicString.h
+++ b/alib2data/src/string/CyclicString.h
@@ -8,13 +8,22 @@
 #ifndef CYCLIC_STRING_H_
 #define CYCLIC_STRING_H_
 
-#include "StringBase.h"
 #include <set>
 #include <vector>
+#include <sstream>
+#include <algorithm>
 
-#include "StringFeatures.h"
-#include "../alphabet/Symbol.h"
 #include <core/components.hpp>
+#include <sax/FromXMLParserHelper.h>
+
+#include "StringBase.h"
+#include "StringFeatures.h"
+#include "common/StringFromXMLParser.h"
+#include "common/StringToXMLComposer.h"
+#include "common/StringAuxiliary.h"
+#include <exception/CommonException.h>
+
+#include "Epsilon.h"
 
 namespace string {
 
@@ -24,13 +33,14 @@ class GeneralAlphabet;
  * Represents regular expression parsed from the XML. Regular expression is stored
  * as a tree of CyclicStringElement.
  */
-class CyclicString : public StringBase, public std::Components < CyclicString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > {
-	std::vector < alphabet::Symbol > m_Data;
+template < class SymbolType >
+class CyclicString : public StringBase, public std::Components < CyclicString < SymbolType >, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > {
+	std::vector < SymbolType > m_Data;
 
 public:
 	explicit CyclicString ( );
-	explicit CyclicString ( std::set < alphabet::Symbol > alphabet, std::vector < alphabet::Symbol > data );
-	explicit CyclicString ( std::vector < alphabet::Symbol > data );
+	explicit CyclicString ( std::set < SymbolType > alphabet, std::vector < SymbolType > data );
+	explicit CyclicString ( std::vector < SymbolType > data );
 	explicit CyclicString ( const std::string & string );
 	explicit CyclicString ( const char * string );
 	explicit CyclicString ( const Epsilon < > & epsilon );
@@ -38,20 +48,20 @@ public:
 	virtual StringBase * clone ( ) const;
 	virtual StringBase * plunder ( ) &&;
 
-	virtual const std::set < alphabet::Symbol > & getAlphabet ( ) const {
-		return accessComponent < GeneralAlphabet > ( ).get ( );
+	virtual const std::set < SymbolType > & getAlphabet ( ) const {
+		return this->template accessComponent < GeneralAlphabet > ( ).get ( );
 	}
 
-	void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
-		accessComponent < GeneralAlphabet > ( ).add( symbols );
+	void extendAlphabet ( const std::set < SymbolType > & symbols ) {
+		this->template accessComponent < GeneralAlphabet > ( ).add( symbols );
 	}
 
 	/**
 	 * @return List of symbols forming string (const version).
 	 */
-	const std::vector < alphabet::Symbol > & getContent ( ) const;
+	const std::vector < SymbolType > & getContent ( ) const;
 
-	void setContent ( std::vector < alphabet::Symbol > data );
+	void setContent ( std::vector < SymbolType > data );
 
 	/**
 	 * @return true if string is an empty word (vector length is 0)
@@ -81,23 +91,125 @@ public:
 	void compose ( std::deque < sax::Token > & out ) const;
 };
 
+template < class SymbolType >
+CyclicString < SymbolType >::CyclicString(std::set<SymbolType> alphabet, std::vector<SymbolType> data) : std::Components < CyclicString < SymbolType >, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) {
+	setContent(std::move(data));
+}
+
+template < class SymbolType >
+CyclicString < SymbolType >::CyclicString() : CyclicString ( std::set < SymbolType > ( ), std::vector < SymbolType > ( ) ) {
+}
+
+template < class SymbolType >
+CyclicString < SymbolType >::CyclicString(std::vector<SymbolType> data) : CyclicString ( std::set < SymbolType> ( data.begin(), data.end() ), data ) {
+}
+
+template < class SymbolType >
+CyclicString < SymbolType >::CyclicString(const std::string& string) : CyclicString ( StringAuxiliary::toInternal ( string ) ) {
+}
+
+template < class SymbolType >
+CyclicString < SymbolType >::CyclicString(const char* string) : CyclicString((std::string) string) {
+}
+
+template < class SymbolType >
+CyclicString < SymbolType >::CyclicString(const Epsilon < > & epsilon) : CyclicString ( epsilon.getAlphabet( ), std::vector < SymbolType > ( ) ) {
+}
+
+template < class SymbolType >
+StringBase* CyclicString < SymbolType >::clone() const {
+	return new CyclicString(*this);
+}
+
+template < class SymbolType >
+StringBase* CyclicString < SymbolType >::plunder() && {
+	return new CyclicString(std::move(*this));
+}
+
+template < class SymbolType >
+const std::vector<SymbolType>& CyclicString < SymbolType >::getContent() const {
+	return this->m_Data;
+}
+
+//serves as both move and copy content setter
+template < class SymbolType >
+void CyclicString < SymbolType >::setContent(std::vector<SymbolType> data) {
+	std::set<SymbolType> minimalAlphabet(data.begin(), data.end());
+	std::set<SymbolType> unknownSymbols;
+	std::set_difference(minimalAlphabet.begin(), minimalAlphabet.end(), getAlphabet().begin(), getAlphabet().end(), std::inserter(unknownSymbols, unknownSymbols.end()));
+
+	if(unknownSymbols.size() > 0)
+		throw exception::CommonException("Input symbols not in the alphabet.");
+
+	m_Data = std::move(data);
+}
+
+template < class SymbolType >
+bool CyclicString < SymbolType >::isEmpty() const {
+	return this->m_Data.size() == 0;
+}
+
+template < class SymbolType >
+int CyclicString < SymbolType >::compare(const CyclicString& other) const {
+	auto first = std::tie ( m_Data, getAlphabet ( ) );
+	auto second = std::tie ( other.m_Data, other.getAlphabet ( ) );
+
+	std::compare<decltype(first)> comp;
+	return comp(first, second);
+}
+
+template < class SymbolType >
+void CyclicString < SymbolType >::operator >>(std::ostream& out) const {
+	out << "(CyclicString ";
+	for(const SymbolType& symbol : this->m_Data)
+		out << symbol;
+	out << ")";
+}
+
+template < class SymbolType >
+CyclicString < SymbolType >::operator std::string () const {
+	std::stringstream ss;
+	ss << "<";
+	for(const SymbolType& symbol : this->m_Data)
+		ss << symbol;
+	ss << ">";
+	return std::move(ss).str();
+}
+
+template < class SymbolType >
+CyclicString < SymbolType > CyclicString < SymbolType >::parse(std::deque<sax::Token>::iterator& input) {
+	sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::START_ELEMENT, CyclicString < >::getXmlTagName());
+	std::set<SymbolType> alphabet = StringFromXMLParser::parseAlphabet < SymbolType > (input);
+	std::vector<SymbolType> content = StringFromXMLParser::parseContent < SymbolType > (input);
+	sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, CyclicString < >::getXmlTagName());
+	return CyclicString < SymbolType > ( std::move ( alphabet ), std::move ( content ) );
+}
+
+template < class SymbolType >
+void CyclicString < SymbolType >::compose(std::deque<sax::Token>& out) const {
+	out.emplace_back(CyclicString::getXmlTagName(), sax::Token::TokenType::START_ELEMENT);
+	StringToXMLComposer::compose(out, getAlphabet());
+	StringToXMLComposer::compose(out, m_Data);
+	out.emplace_back(CyclicString::getXmlTagName(), sax::Token::TokenType::END_ELEMENT);
+}
+
 } /* namespace string */
 
 namespace std {
 
-template < >
-class ComponentConstraint< ::string::CyclicString, alphabet::Symbol, ::string::GeneralAlphabet > {
+template < class SymbolType >
+class ComponentConstraint< ::string::CyclicString < SymbolType >, SymbolType, ::string::GeneralAlphabet > {
 public:
-	static bool used ( const ::string::CyclicString & string, const alphabet::Symbol & symbol ) {
-		const std::vector<alphabet::Symbol>& content = string.getContent ( );
+	static bool used ( const ::string::CyclicString < SymbolType > & string, const SymbolType & symbol ) {
+		const std::vector<SymbolType>& content = string.getContent ( );
 		return std::find(content.begin(), content.end(), symbol) != content.end();
 	}
 
-	static bool available ( const ::string::CyclicString &, const alphabet::Symbol & ) {
+	static bool available ( const ::string::CyclicString < SymbolType > &, const SymbolType & ) {
 		return true;
 	}
 
-	static void valid ( const ::string::CyclicString &, const alphabet::Symbol & ) {
+	static void valid ( const ::string::CyclicString < SymbolType > &, const SymbolType & ) {
 	}
 };
 
diff --git a/alib2data/src/string/LinearString.cpp b/alib2data/src/string/LinearString.cpp
index 74e4a39e90..2abfe6aaea 100644
--- a/alib2data/src/string/LinearString.cpp
+++ b/alib2data/src/string/LinearString.cpp
@@ -6,165 +6,25 @@
  */
 
 #include "LinearString.h"
-#include "Epsilon.h"
-#include "../tree/ranked/PrefixRankedTree.h"
-#include "../tree/ranked/PrefixRankedPattern.h"
-#include "../tree/ranked/PrefixRankedNonlinearPattern.h"
-#include "../tree/ranked/PrefixRankedBarTree.h"
-#include "../tree/ranked/PrefixRankedBarPattern.h"
-#include "../tree/ranked/PrefixRankedBarNonlinearPattern.h"
-#include "../tree/unranked/PrefixBarTree.h"
-#include "../tree/common/TreeAuxiliary.h"
-#include <exception/CommonException.h>
 
-#include <sstream>
-#include <algorithm>
-
-#include <sax/FromXMLParserHelper.h>
-#include "common/StringFromXMLParser.h"
-#include "common/StringToXMLComposer.h"
-#include "common/StringAuxiliary.h"
 #include "String.h"
 #include <object/Object.h>
 #include <XmlApi.hpp>
 #include <cast/CastApi.hpp>
 
-namespace string {
-
-LinearString::LinearString(std::set<alphabet::Symbol> alphabet, std::vector<alphabet::Symbol> data) : std::Components < LinearString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) {
-	setContent(std::move(data));
-}
-
-LinearString::LinearString() : LinearString ( std::set < alphabet::Symbol > ( ), std::vector < alphabet::Symbol > ( ) ) {
-}
-
-LinearString::LinearString(std::vector<alphabet::Symbol> data) : LinearString ( std::set < alphabet::Symbol> ( data.begin(), data.end() ), data ) {
-}
-
-LinearString::LinearString(const std::string& string) : LinearString ( StringAuxiliary::toInternal ( string ) ) {
-}
-
-LinearString::LinearString(const char* string) : LinearString((std::string) string) {
-}
-
-LinearString::LinearString(const Epsilon < > & epsilon) : LinearString ( epsilon.getAlphabet( ), std::vector < alphabet::Symbol > ( ) ) {
-}
-
-LinearString::LinearString ( const tree::PrefixRankedTree & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
-}
-
-LinearString::LinearString ( const tree::PrefixRankedPattern & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
-}
-
-LinearString::LinearString ( const tree::PrefixRankedNonlinearPattern & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
-}
-
-LinearString::LinearString ( const tree::PrefixRankedBarTree & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
-}
-
-LinearString::LinearString ( const tree::PrefixRankedBarPattern & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
-}
-
-LinearString::LinearString ( const tree::PrefixRankedBarNonlinearPattern & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
-}
-
-LinearString::LinearString ( const tree::PrefixBarTree & tree ) : LinearString ( tree.getAlphabet ( ), tree.getContent ( ) ) {
-}
-
-StringBase * LinearString::clone ( ) const {
-	return new LinearString ( * this );
-}
-
-StringBase * LinearString::plunder ( ) && {
-	return new LinearString ( std::move ( * this ) );
-}
-
-void LinearString::appendSymbol ( alphabet::Symbol symbol ) {
-	if ( getAlphabet().count ( symbol ) == 0 )
-		throw exception::CommonException ( "Input symbol \"" + std::to_string ( symbol ) + "\" not in the alphabet." );
-
-	m_Data.push_back ( std::move ( symbol ) );
-}
-
-const std::vector < alphabet::Symbol > & LinearString::getContent ( ) const {
-	return this->m_Data;
-}
-
-void LinearString::setContent ( std::vector < alphabet::Symbol > data ) {
-	std::set < alphabet::Symbol > minimalAlphabet ( data.begin ( ), data.end ( ) );
-	std::set < alphabet::Symbol > unknownSymbols;
-	std::set_difference ( minimalAlphabet.begin ( ), minimalAlphabet.end ( ), getAlphabet().begin ( ), getAlphabet().end ( ), std::inserter ( unknownSymbols, unknownSymbols.end ( ) ) );
-
-	if ( unknownSymbols.size ( ) > 0 )
-		throw exception::CommonException ( "Input symbols not in the alphabet." );
-
-	this->m_Data = std::move ( data );
-}
-
-bool LinearString::isEmpty ( ) const {
-	return this->m_Data.size ( ) == 0;
-}
-
-int LinearString::compare ( const LinearString & other ) const {
-	auto first = std::tie ( m_Data, getAlphabet() );
-	auto second = std::tie ( other.m_Data, other.getAlphabet() );
-
-	std::compare < decltype ( first ) > comp;
-
-	return comp ( first, second );
-}
-
-void LinearString::operator >>( std::ostream & out ) const {
-	out << "(LinearString ";
-
-	for ( const alphabet::Symbol & symbol : this->m_Data )
-		out << symbol;
-
-	out << ")";
-}
-
-LinearString::operator std::string ( ) const {
-	std::stringstream ss;
-	ss << "\"";
-
-	for ( const alphabet::Symbol & symbol : this->m_Data )
-		ss << symbol;
-
-	ss << "\"";
-	return std::move ( ss ).str ( );
-}
-
-LinearString LinearString::parse ( std::deque < sax::Token >::iterator & input ) {
-	sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, LinearString::getXmlTagName() );
-	std::set < alphabet::Symbol > alphabet = StringFromXMLParser::parseAlphabet < alphabet::Symbol > ( input );
-	std::vector < alphabet::Symbol > content = StringFromXMLParser::parseContent < alphabet::Symbol > ( input );
-	sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, LinearString::getXmlTagName() );
-
-	return LinearString ( alphabet, content );
-}
-
-void LinearString::compose ( std::deque < sax::Token > & out ) const {
-	out.emplace_back ( LinearString::getXmlTagName(), sax::Token::TokenType::START_ELEMENT );
-	StringToXMLComposer::compose ( out, getAlphabet() );
-	StringToXMLComposer::compose ( out, m_Data );
-	out.emplace_back ( LinearString::getXmlTagName(), sax::Token::TokenType::END_ELEMENT );
-}
-
-} /* namespace string */
-
 namespace alib {
 
-auto linearStringParserRegister = xmlApi < string::String >::ParserRegister < string::LinearString > ();
-auto linearStringParserRegister2 = xmlApi < alib::Object >::ParserRegister < string::LinearString > ();
-
-auto LinearStringFromEpsilon = castApi::CastRegister < string::LinearString, string::Epsilon < > > ( );
-auto LinearStringFromPrefixRankedTree = castApi::CastRegister < string::LinearString, tree::PrefixRankedTree > ( );
-auto LinearStringFromPrefixRankedPattern = castApi::CastRegister < string::LinearString, tree::PrefixRankedPattern > ( );
-auto LinearStringFromPrefixRankedNonlinearPattern = castApi::CastRegister < string::LinearString, tree::PrefixRankedNonlinearPattern > ( );
-auto LinearStringFromPrefixRankedBarTree = castApi::CastRegister < string::LinearString, tree::PrefixRankedBarTree > ( );
-auto LinearStringFromPrefixRankedBarPattern = castApi::CastRegister < string::LinearString, tree::PrefixRankedBarPattern > ( );
-auto LinearStringFromPrefixRankedBarNonlinearPattern = castApi::CastRegister < string::LinearString, tree::PrefixRankedBarNonlinearPattern > ( );
-auto LinearStringFromPrefixBarTree = castApi::CastRegister < string::LinearString, tree::PrefixBarTree > ( );
-auto LinearStringCastBinder = castApi::CastPoolStringBinder < string::LinearString > ( string::LinearString::getXmlTagName() );
+auto linearStringParserRegister = xmlApi < string::String >::ParserRegister < string::LinearString < > > ();
+auto linearStringParserRegister2 = xmlApi < alib::Object >::ParserRegister < string::LinearString < > > ();
+
+auto LinearStringFromEpsilon = castApi::CastRegister < string::LinearString < >, string::Epsilon < > > ( );
+auto LinearStringFromPrefixRankedTree = castApi::CastRegister < string::LinearString < >, tree::PrefixRankedTree > ( );
+auto LinearStringFromPrefixRankedPattern = castApi::CastRegister < string::LinearString < >, tree::PrefixRankedPattern > ( );
+auto LinearStringFromPrefixRankedNonlinearPattern = castApi::CastRegister < string::LinearString < >, tree::PrefixRankedNonlinearPattern > ( );
+auto LinearStringFromPrefixRankedBarTree = castApi::CastRegister < string::LinearString < >, tree::PrefixRankedBarTree > ( );
+auto LinearStringFromPrefixRankedBarPattern = castApi::CastRegister < string::LinearString < >, tree::PrefixRankedBarPattern > ( );
+auto LinearStringFromPrefixRankedBarNonlinearPattern = castApi::CastRegister < string::LinearString < >, tree::PrefixRankedBarNonlinearPattern > ( );
+auto LinearStringFromPrefixBarTree = castApi::CastRegister < string::LinearString < >, tree::PrefixBarTree > ( );
+auto LinearStringCastBinder = castApi::CastPoolStringBinder < string::LinearString < > > ( string::LinearString < >::getXmlTagName() );
 
 } /* namespace alib */
diff --git a/alib2data/src/string/LinearString.h b/alib2data/src/string/LinearString.h
index ea89ac8b45..98d14ca298 100644
--- a/alib2data/src/string/LinearString.h
+++ b/alib2data/src/string/LinearString.h
@@ -8,14 +8,31 @@
 #ifndef LINEAR_STRING_H_
 #define LINEAR_STRING_H_
 
-#include "StringBase.h"
 #include <set>
 #include <vector>
+#include <sstream>
+#include <algorithm>
 
-#include "StringFeatures.h"
-#include "../alphabet/Symbol.h"
+#include <sax/FromXMLParserHelper.h>
 #include <core/components.hpp>
 
+#include "StringBase.h"
+#include "StringFeatures.h"
+#include "common/StringFromXMLParser.h"
+#include "common/StringToXMLComposer.h"
+#include "common/StringAuxiliary.h"
+#include <exception/CommonException.h>
+
+#include "Epsilon.h"
+#include "../tree/ranked/PrefixRankedTree.h"
+#include "../tree/ranked/PrefixRankedPattern.h"
+#include "../tree/ranked/PrefixRankedNonlinearPattern.h"
+#include "../tree/ranked/PrefixRankedBarTree.h"
+#include "../tree/ranked/PrefixRankedBarPattern.h"
+#include "../tree/ranked/PrefixRankedBarNonlinearPattern.h"
+#include "../tree/unranked/PrefixBarTree.h"
+#include "../tree/common/TreeAuxiliary.h"
+
 namespace tree {
 
 class PrefixRankedTree;
@@ -36,8 +53,9 @@ class GeneralAlphabet;
  * Represents regular expression parsed from the XML. Regular expression is stored
  * as a tree of LinearStringElement.
  */
-class LinearString : public StringBase, public std::Components < LinearString, alphabet::Symbol, std::tuple < GeneralAlphabet >, std::tuple < > > {
-	std::vector < alphabet::Symbol > m_Data;
+template < class SymbolType >
+class LinearString : public StringBase, public std::Components < LinearString < SymbolType >, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > {
+	std::vector < SymbolType > m_Data;
 
 public:
 	explicit LinearString ( );
@@ -48,8 +66,8 @@ public:
 	explicit LinearString ( const tree::PrefixRankedBarPattern & tree );
 	explicit LinearString ( const tree::PrefixRankedBarNonlinearPattern & tree );
 	explicit LinearString ( const tree::PrefixBarTree & tree );
-	explicit LinearString ( std::set < alphabet::Symbol > alphabet, std::vector < alphabet::Symbol > data );
-	explicit LinearString ( std::vector < alphabet::Symbol > data );
+	explicit LinearString ( std::set < SymbolType > alphabet, std::vector < SymbolType > data );
+	explicit LinearString ( std::vector < SymbolType > data );
 	explicit LinearString ( const std::string & string );
 	explicit LinearString ( const char * string );
 	explicit LinearString ( const Epsilon < > & epsilon );
@@ -57,25 +75,25 @@ public:
 	virtual StringBase * clone ( ) const;
 	virtual StringBase * plunder ( ) &&;
 
-	virtual const std::set < alphabet::Symbol > & getAlphabet ( ) const {
-		return accessComponent < GeneralAlphabet > ( ).get ( );
+	virtual const std::set < SymbolType > & getAlphabet ( ) const {
+		return this->template accessComponent < GeneralAlphabet > ( ).get ( );
 	}
 
-	void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
-		accessComponent < GeneralAlphabet > ( ).add( symbols );
+	void extendAlphabet ( const std::set < SymbolType > & symbols ) {
+		this->template accessComponent < GeneralAlphabet > ( ).add( symbols );
 	}
 
 	/**
 	 * @param element to append
 	 */
-	void appendSymbol ( alphabet::Symbol symbol );
+	void appendSymbol ( SymbolType symbol );
 
 	/**
 	 * @return List of symbols forming string (const version).
 	 */
-	const std::vector < alphabet::Symbol > & getContent ( ) const;
+	const std::vector < SymbolType > & getContent ( ) const;
 
-	void setContent ( std::vector < alphabet::Symbol > data );
+	void setContent ( std::vector < SymbolType > data );
 
 	/**
 	 * @return true if string is an empty word (vector length is 0)
@@ -105,23 +123,166 @@ public:
 	void compose ( std::deque < sax::Token > & out ) const;
 };
 
+template < class SymbolType >
+LinearString < SymbolType >::LinearString(std::set<SymbolType> alphabet, std::vector<SymbolType> data) : std::Components < LinearString < SymbolType >, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ) {
+	setContent(std::move(data));
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString() : LinearString ( std::set < SymbolType > ( ), std::vector < SymbolType > ( ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString(std::vector<SymbolType> data) : LinearString ( std::set < SymbolType> ( data.begin(), data.end() ), data ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString(const std::string& string) : LinearString ( StringAuxiliary::toInternal ( string ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString(const char* string) : LinearString((std::string) string) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString(const Epsilon < > & epsilon) : LinearString ( epsilon.getAlphabet( ), std::vector < SymbolType > ( ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString ( const tree::PrefixRankedTree & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString ( const tree::PrefixRankedPattern & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString ( const tree::PrefixRankedNonlinearPattern & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString ( const tree::PrefixRankedBarTree & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString ( const tree::PrefixRankedBarPattern & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString ( const tree::PrefixRankedBarNonlinearPattern & tree ) : LinearString ( StringAuxiliary::wrapSymbols ( tree.getAlphabet ( ) ), StringAuxiliary::wrapSymbols ( tree.getContent ( ) ) ) {
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::LinearString ( const tree::PrefixBarTree & tree ) : LinearString ( tree.getAlphabet ( ), tree.getContent ( ) ) {
+}
+
+template < class SymbolType >
+StringBase * LinearString < SymbolType >::clone ( ) const {
+	return new LinearString ( * this );
+}
+
+template < class SymbolType >
+StringBase * LinearString < SymbolType >::plunder ( ) && {
+	return new LinearString ( std::move ( * this ) );
+}
+
+template < class SymbolType >
+void LinearString < SymbolType >::appendSymbol ( SymbolType symbol ) {
+	if ( getAlphabet().count ( symbol ) == 0 )
+		throw exception::CommonException ( "Input symbol \"" + std::to_string ( symbol ) + "\" not in the alphabet." );
+
+	m_Data.push_back ( std::move ( symbol ) );
+}
+
+template < class SymbolType >
+const std::vector < SymbolType > & LinearString < SymbolType >::getContent ( ) const {
+	return this->m_Data;
+}
+
+template < class SymbolType >
+void LinearString < SymbolType >::setContent ( std::vector < SymbolType > data ) {
+	std::set < SymbolType > minimalAlphabet ( data.begin ( ), data.end ( ) );
+	std::set < SymbolType > unknownSymbols;
+	std::set_difference ( minimalAlphabet.begin ( ), minimalAlphabet.end ( ), getAlphabet().begin ( ), getAlphabet().end ( ), std::inserter ( unknownSymbols, unknownSymbols.end ( ) ) );
+
+	if ( unknownSymbols.size ( ) > 0 )
+		throw exception::CommonException ( "Input symbols not in the alphabet." );
+
+	this->m_Data = std::move ( data );
+}
+
+template < class SymbolType >
+bool LinearString < SymbolType >::isEmpty ( ) const {
+	return this->m_Data.size ( ) == 0;
+}
+
+template < class SymbolType >
+int LinearString < SymbolType >::compare ( const LinearString & other ) const {
+	auto first = std::tie ( m_Data, getAlphabet() );
+	auto second = std::tie ( other.m_Data, other.getAlphabet() );
+
+	std::compare < decltype ( first ) > comp;
+
+	return comp ( first, second );
+}
+
+template < class SymbolType >
+void LinearString < SymbolType >::operator >>( std::ostream & out ) const {
+	out << "(LinearString ";
+
+	for ( const SymbolType & symbol : this->m_Data )
+		out << symbol;
+
+	out << ")";
+}
+
+template < class SymbolType >
+LinearString < SymbolType >::operator std::string ( ) const {
+	std::stringstream ss;
+	ss << "\"";
+
+	for ( const SymbolType & symbol : this->m_Data )
+		ss << symbol;
+
+	ss << "\"";
+	return std::move ( ss ).str ( );
+}
+
+template < class SymbolType >
+LinearString < SymbolType > LinearString < SymbolType >::parse ( std::deque < sax::Token >::iterator & input ) {
+	sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, LinearString::getXmlTagName() );
+	std::set < SymbolType > alphabet = StringFromXMLParser::parseAlphabet < SymbolType > ( input );
+	std::vector < SymbolType > content = StringFromXMLParser::parseContent < SymbolType > ( input );
+	sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, LinearString::getXmlTagName() );
+
+	return LinearString < SymbolType > ( alphabet, content );
+}
+
+template < class SymbolType >
+void LinearString < SymbolType >::compose ( std::deque < sax::Token > & out ) const {
+	out.emplace_back ( LinearString::getXmlTagName(), sax::Token::TokenType::START_ELEMENT );
+	StringToXMLComposer::compose ( out, getAlphabet() );
+	StringToXMLComposer::compose ( out, m_Data );
+	out.emplace_back ( LinearString::getXmlTagName(), sax::Token::TokenType::END_ELEMENT );
+}
+
 } /* namespace string */
 
 namespace std {
 
-template < >
-class ComponentConstraint< ::string::LinearString, alphabet::Symbol, ::string::GeneralAlphabet > {
+template < class SymbolType >
+class ComponentConstraint< ::string::LinearString < SymbolType >, SymbolType, ::string::GeneralAlphabet > {
 public:
-	static bool used ( const ::string::LinearString & string, const alphabet::Symbol & symbol ) {
-		const std::vector<alphabet::Symbol>& content = string.getContent ( );
+	static bool used ( const ::string::LinearString < SymbolType > & string, const SymbolType & symbol ) {
+		const std::vector<SymbolType>& content = string.getContent ( );
 		return std::find(content.begin(), content.end(), symbol) != content.end();
 	}
 
-	static bool available ( const ::string::LinearString &, const alphabet::Symbol & ) {
+	static bool available ( const ::string::LinearString < SymbolType > &, const SymbolType & ) {
 		return true;
 	}
 
-	static void valid ( const ::string::LinearString &, const alphabet::Symbol & ) {
+	static void valid ( const ::string::LinearString < SymbolType > &, const SymbolType & ) {
 	}
 };
 
diff --git a/alib2data/src/string/LinearStringTerminatingSymbol.cpp b/alib2data/src/string/LinearStringTerminatingSymbol.cpp
index 034992a55a..c8b24c956e 100644
--- a/alib2data/src/string/LinearStringTerminatingSymbol.cpp
+++ b/alib2data/src/string/LinearStringTerminatingSymbol.cpp
@@ -32,7 +32,7 @@ LinearStringTerminatingSymbol::LinearStringTerminatingSymbol ( alphabet::Symbol
 LinearStringTerminatingSymbol::LinearStringTerminatingSymbol ( alphabet::Symbol terminatingSymbol, std::vector < alphabet::Symbol > data ) : LinearStringTerminatingSymbol ( std::set < alphabet::Symbol > ( data.begin ( ), data.end ( ) ) + std::set < alphabet::Symbol > { terminatingSymbol }, terminatingSymbol, data ) {
 }
 
-LinearStringTerminatingSymbol::LinearStringTerminatingSymbol ( alphabet::Symbol terminatingSymbol, const LinearString & string ) : LinearStringTerminatingSymbol ( string.getAlphabet( ), std::move ( terminatingSymbol ), string.getContent ( ) ) {
+LinearStringTerminatingSymbol::LinearStringTerminatingSymbol ( alphabet::Symbol terminatingSymbol, const LinearString < > & string ) : LinearStringTerminatingSymbol ( string.getAlphabet( ), std::move ( terminatingSymbol ), string.getContent ( ) ) {
 }
 
 StringBase * LinearStringTerminatingSymbol::clone ( ) const {
diff --git a/alib2data/src/string/LinearStringTerminatingSymbol.h b/alib2data/src/string/LinearStringTerminatingSymbol.h
index 99376d97d2..b8046979ab 100644
--- a/alib2data/src/string/LinearStringTerminatingSymbol.h
+++ b/alib2data/src/string/LinearStringTerminatingSymbol.h
@@ -8,17 +8,18 @@
 #ifndef LINEAR_STRING_TERMINATING_SYMBOL_H_
 #define LINEAR_STRING_TERMINATING_SYMBOL_H_
 
-#include "StringBase.h"
 #include <iostream>
 #include <set>
 #include <vector>
 
+#include "StringBase.h"
+#include "StringFeatures.h"
+
 #include "../alphabet/Symbol.h"
 #include <core/components.hpp>
 
 namespace string {
 
-class LinearString;
 class GeneralAlphabet;
 class TerminatingSymbol;
 
@@ -33,7 +34,7 @@ public:
 	explicit LinearStringTerminatingSymbol ( alphabet::Symbol terminatingSymbol );
 	explicit LinearStringTerminatingSymbol ( std::set < alphabet::Symbol > alphabet, alphabet::Symbol terminatingSymbol, std::vector < alphabet::Symbol > data );
 	explicit LinearStringTerminatingSymbol ( alphabet::Symbol terminatingSymbol, std::vector < alphabet::Symbol > data );
-	explicit LinearStringTerminatingSymbol ( alphabet::Symbol terminatingSymbol, const LinearString & string );
+	explicit LinearStringTerminatingSymbol ( alphabet::Symbol terminatingSymbol, const LinearString < > & string );
 
 	virtual StringBase * clone ( ) const;
 	virtual StringBase * plunder ( ) &&;
diff --git a/alib2data/src/string/String.cpp b/alib2data/src/string/String.cpp
index ba842cef75..394ca7fc47 100644
--- a/alib2data/src/string/String.cpp
+++ b/alib2data/src/string/String.cpp
@@ -22,21 +22,11 @@ void String::extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
 }
 
 string::String stringFrom ( const alphabet::Symbol & symbol ) {
-	return string::String {
-			   string::LinearString {
-				   std::vector < alphabet::Symbol > {
-					   symbol
-				   }
-			   }
-	};
+	return string::String { string::LinearString < > { std::vector < alphabet::Symbol > { symbol } } };
 }
 
 string::String stringFrom ( const std::string & string ) {
-	return string::String {
-			   string::LinearString {
-				   string
-			   }
-	};
+	return string::String { string::LinearString < > { string } };
 }
 
 string::String stringFrom ( const char * string ) {
@@ -44,7 +34,7 @@ string::String stringFrom ( const char * string ) {
 }
 
 string::String stringFrom ( const std::vector < alphabet::Symbol > & str ) {
-	return string::String { string::LinearString { str } };
+	return string::String { string::LinearString < > { str } };
 }
 
 } /* namespace string */
diff --git a/alib2data/src/string/StringFeatures.h b/alib2data/src/string/StringFeatures.h
index f73ca684b5..beb9b48f3e 100644
--- a/alib2data/src/string/StringFeatures.h
+++ b/alib2data/src/string/StringFeatures.h
@@ -23,8 +23,11 @@ class StringBase;
 
 template < class SymbolType = alphabet::Symbol >
 class Epsilon;
+template < class SymbolType = alphabet::Symbol >
 class LinearString;
+template < class SymbolType = alphabet::Symbol >
 class CyclicString;
+class LinearStringTerminatingSymbol;
 
 } /* namespace string */
 
diff --git a/alib2data/test-src/string/StringTest.cpp b/alib2data/test-src/string/StringTest.cpp
index 5e237fb113..0a637a882c 100644
--- a/alib2data/test-src/string/StringTest.cpp
+++ b/alib2data/test-src/string/StringTest.cpp
@@ -28,7 +28,7 @@ void StringTest::tearDown ( ) {
 }
 
 void StringTest::testCopyConstruct ( ) {
-	string::LinearString linearString;
+	string::LinearString < > linearString;
 
 	linearString.accessComponent < string::GeneralAlphabet > ( ).set( { alphabet::symbolFrom ( "1" ), alphabet::symbolFrom ( "2" ), alphabet::symbolFrom ( "3" ) } );
 	linearString.setContent ( { alphabet::symbolFrom ( "1" ), alphabet::symbolFrom ( "2" ), alphabet::symbolFrom ( "1" ) } );
@@ -44,7 +44,7 @@ void StringTest::testCopyConstruct ( ) {
 
 void StringTest::testXMLParser ( ) {
 
-	string::LinearString linearString;
+	string::LinearString < > linearString;
 
 	linearString.accessComponent < string::GeneralAlphabet > ( ).set( { alphabet::symbolFrom ( "1" ), alphabet::symbolFrom ( "2" ), alphabet::symbolFrom ( "3" ) } );
 	linearString.setContent ( { alphabet::symbolFrom ( "1" ), alphabet::symbolFrom ( "2" ), alphabet::symbolFrom ( "1" ) } );
diff --git a/alib2raw/src/string/StringFromRawParser.cpp b/alib2raw/src/string/StringFromRawParser.cpp
index f036065b70..8796f84b24 100644
--- a/alib2raw/src/string/StringFromRawParser.cpp
+++ b/alib2raw/src/string/StringFromRawParser.cpp
@@ -23,7 +23,7 @@ String StringFromRawParser::parseString(std::istream_iterator<char>& input, cons
 	for(;input != std::istream_iterator<char>(); input++) {
 		data.push_back(alphabet::symbolFrom(*input));
 	}
-	LinearString string { data };
+	LinearString < > string { data };
 
 	if(features.count(FEATURES::LINEAR)) return String{string};
 
diff --git a/alib2raw/src/string/StringToRawComposer.cpp b/alib2raw/src/string/StringToRawComposer.cpp
index 2e4df53d55..b563d931ed 100644
--- a/alib2raw/src/string/StringToRawComposer.cpp
+++ b/alib2raw/src/string/StringToRawComposer.cpp
@@ -14,13 +14,13 @@ void StringToRawComposer::compose(std::ostream& out, const String& string) {
 	dispatch(out, string.getData());
 }
 
-void StringToRawComposer::compose(std::ostream& out, const LinearString& string) {
+void StringToRawComposer::compose(std::ostream& out, const LinearString < > & string) {
 	for(const alphabet::Symbol& symbol : string.getContent()) {
 		out << (std::string) symbol;
 	}
 }
 
-StringToRawComposer::RegistratorWrapper<void, LinearString> StringToRawComposerLinearString = StringToRawComposer::RegistratorWrapper<void, LinearString>(StringToRawComposer::compose);
+StringToRawComposer::RegistratorWrapper<void, LinearString < > > StringToRawComposerLinearString = StringToRawComposer::RegistratorWrapper<void, LinearString < > >(StringToRawComposer::compose);
 
 } /* namespace automaton */
 
diff --git a/alib2raw/src/string/StringToRawComposer.h b/alib2raw/src/string/StringToRawComposer.h
index 5c27786f51..5c3067b325 100644
--- a/alib2raw/src/string/StringToRawComposer.h
+++ b/alib2raw/src/string/StringToRawComposer.h
@@ -24,7 +24,7 @@ class StringToRawComposer : public std::SingleDispatchFirstStaticParam<StringToR
 public:
 	static void compose(std::ostream& out, const String& string);
 
-	static void compose(std::ostream& out, const LinearString& string);
+	static void compose(std::ostream& out, const LinearString < > & string);
 
 };
 
diff --git a/alib2str/src/string/StringFromStringParser.cpp b/alib2str/src/string/StringFromStringParser.cpp
index b79cf85b8b..72333d93d1 100644
--- a/alib2str/src/string/StringFromStringParser.cpp
+++ b/alib2str/src/string/StringFromStringParser.cpp
@@ -28,7 +28,7 @@ String StringFromStringParser::parseString(std::istream& input, const std::set<F
 		std::vector<alphabet::Symbol> data = parseContent(input);
 		token = m_StringLexer.next(input);
 		if(token.type == StringFromStringLexer::TokenType::GREATER) {
-			return String(CyclicString(data));
+			return String(CyclicString < > (data));
 		} else {
 			throw exception::CommonException("Invalid cyclic string terminating character");
 		}
@@ -37,7 +37,7 @@ String StringFromStringParser::parseString(std::istream& input, const std::set<F
 		std::vector<alphabet::Symbol> data = parseContent(input);
 		token = m_StringLexer.next(input);
 		if(token.type == StringFromStringLexer::TokenType::QUOTE) {
-			return String(LinearString(data));
+			return String(LinearString < >(data));
 		} else {
 			throw exception::CommonException("Invalid linear string terminating character");
 		}
diff --git a/alib2str/src/string/StringToStringComposer.cpp b/alib2str/src/string/StringToStringComposer.cpp
index 4e2c07470c..f49bd62166 100644
--- a/alib2str/src/string/StringToStringComposer.cpp
+++ b/alib2str/src/string/StringToStringComposer.cpp
@@ -14,7 +14,7 @@
 
 namespace string {
 
-void StringToStringComposer::compose ( std::ostream & out, const CyclicString & string ) {
+void StringToStringComposer::compose ( std::ostream & out, const CyclicString < > & string ) {
 	out << "<";
 
 	for ( const auto & symbol : string.getContent ( ) )
@@ -23,9 +23,9 @@ void StringToStringComposer::compose ( std::ostream & out, const CyclicString &
 	out << ">";
 }
 
-StringToStringComposer::RegistratorWrapper < void, CyclicString > StringToStringComposerCyclicString = StringToStringComposer::RegistratorWrapper < void, CyclicString > ( StringToStringComposer::compose );
+StringToStringComposer::RegistratorWrapper < void, CyclicString < > > StringToStringComposerCyclicString = StringToStringComposer::RegistratorWrapper < void, CyclicString < > > ( StringToStringComposer::compose );
 
-void StringToStringComposer::compose ( std::ostream & out, const LinearString & string ) {
+void StringToStringComposer::compose ( std::ostream & out, const LinearString < > & string ) {
 	out << "\"";
 
 	for ( const auto & symbol : string.getContent ( ) )
@@ -34,7 +34,7 @@ void StringToStringComposer::compose ( std::ostream & out, const LinearString &
 	out << "\"";
 }
 
-StringToStringComposer::RegistratorWrapper < void, LinearString > StringToStringComposerLinearString = StringToStringComposer::RegistratorWrapper < void, LinearString > ( StringToStringComposer::compose );
+StringToStringComposer::RegistratorWrapper < void, LinearString < > > StringToStringComposerLinearString = StringToStringComposer::RegistratorWrapper < void, LinearString < > > ( StringToStringComposer::compose );
 
 void StringToStringComposer::compose ( std::ostream & out, const Epsilon < > & ) {
 	out << "#E";
diff --git a/alib2str/src/string/StringToStringComposer.h b/alib2str/src/string/StringToStringComposer.h
index 4283fc2db6..7085942d8d 100644
--- a/alib2str/src/string/StringToStringComposer.h
+++ b/alib2str/src/string/StringToStringComposer.h
@@ -20,8 +20,8 @@ namespace string {
  */
 class StringToStringComposer: public std::SingleDispatchFirstStaticParam<StringToStringComposer, void, std::ostream&, StringBase> {
 public:
-	static void compose(std::ostream&, const LinearString& string);
-	static void compose(std::ostream&, const CyclicString& string);
+	static void compose(std::ostream&, const LinearString < > & string);
+	static void compose(std::ostream&, const CyclicString < > & string);
 	static void compose(std::ostream&, const Epsilon < > & string);
 
 	/**
diff --git a/arand2/src/arand.cpp b/arand2/src/arand.cpp
index 18152e84d5..b7e349b9de 100644
--- a/arand2/src/arand.cpp
+++ b/arand2/src/arand.cpp
@@ -137,7 +137,7 @@ int main ( int argc, char * argv[] ) {
 		} else if ( type.getValue ( ) == "ST" ) {
 			measurements::start ( "Algorithm", measurements::Type::MAIN );
 
-			string::LinearString res = string::generate::RandomStringFactory::generateLinearString ( length.getValue ( ), alphabetSize.getValue ( ), randomizedAlphabet.getValue ( ), integerSymbols.getValue ( ) );
+			string::LinearString < > res = string::generate::RandomStringFactory::generateLinearString ( length.getValue ( ), alphabetSize.getValue ( ), randomizedAlphabet.getValue ( ), integerSymbols.getValue ( ) );
 
 			measurements::end ( );
 			measurements::start ( "Output write", measurements::Type::AUXILIARY );
diff --git a/arun2/src/arun.cpp b/arun2/src/arun.cpp
index f0109fe6ea..46a1ded8cc 100644
--- a/arun2/src/arun.cpp
+++ b/arun2/src/arun.cpp
@@ -104,7 +104,7 @@ int main(int argc, char* argv[]) {
 
 			alib::XmlDataFactory::toStdout( res );
 		} else if( type.getValue() == "translate") {
-			std::set < string::LinearString > res = automaton::run::Translate::translate(automatonData, inputData);
+			std::set < string::LinearString < > > res = automaton::run::Translate::translate(automatonData, inputData);
 
 			measurements::end();
 			measurements::start("Output write", measurements::Type::AUXILIARY);
-- 
GitLab