56 const std::string text =
"ababa";
60 std::cout <<
"Suffix Automaton Example\n";
61 std::cout <<
"Text: " << text <<
"\n";
62 std::cout <<
"States: " <<
sam.state_count() <<
"\n";
63 std::cout <<
"Distinct substrings: " <<
sam.distinct_substring_count() <<
"\n";
64 std::cout <<
"Contains 'bab'? " << (
sam.contains(
"bab") ?
"yes" :
"no") <<
"\n";
66 const std::string
other =
"zzabxababa";
67 std::cout <<
"LCS(text, '" <<
other <<
"') = "
68 <<
sam.longest_common_substring(
other) <<
"\n";
Suffix structures: suffix array/LCP, suffix tree, suffix automaton.
Suffix automaton (SAM) over byte alphabet.
void build(const std::string_view text)
Build the SAM from an entire string.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
int main()
Demonstrates basic usage of the Suffix_Automaton API with a sample string.