Skip to content
Snippets Groups Projects
Commit af0051b0 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

expose computation of BCS table for trees

parent 8072b246
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -56,6 +56,8 @@ int main ( int argc, char * argv[] ) { ...@@ -56,6 +56,8 @@ int main ( int argc, char * argv[] ) {
allowed.push_back ( "exactSubtreeRepeatsNaive" ); allowed.push_back ( "exactSubtreeRepeatsNaive" );
allowed.push_back ( "compressedBitParallelIndex" ); allowed.push_back ( "compressedBitParallelIndex" );
allowed.push_back ( "fullAndLinearIndex" ); allowed.push_back ( "fullAndLinearIndex" );
allowed.push_back ( "badCharacterShiftTable" );
TCLAP::ValuesConstraint < std::string > allowedVals ( allowed ); TCLAP::ValuesConstraint < std::string > allowedVals ( allowed );
   
TCLAP::ValueArg < std::string > algorithm ( "a", "algorithm", "Execute algorithm", false, "exactSubtreeMatch", & allowedVals ); TCLAP::ValueArg < std::string > algorithm ( "a", "algorithm", "Execute algorithm", false, "exactSubtreeMatch", & allowedVals );
...@@ -281,6 +283,18 @@ int main ( int argc, char * argv[] ) { ...@@ -281,6 +283,18 @@ int main ( int argc, char * argv[] ) {
measurements::start ( "Output write", measurements::Type::AUXILIARY ); measurements::start ( "Output write", measurements::Type::AUXILIARY );
   
alib::XmlDataFactory::toStdout ( fullAndLinearIndex ); alib::XmlDataFactory::toStdout ( fullAndLinearIndex );
} else if ( algorithm.getValue ( ) == "badCharacterShiftTable" ) {
tree::RankedTreeWrapper pattern = alib::XmlDataFactory::fromTokens ( std::move ( sax::FromXMLParserHelper::parseInput(true, patternInput).front ( ) ) );
measurements::end ( );
measurements::start ( "Algorithm", measurements::Type::MAIN );
std::map < std::ranked_symbol < DefaultSymbolType, DefaultRankType >, size_t > bcs = tree::properties::BadCharacterShiftTable::bcs ( pattern );
measurements::end ( );
measurements::start ( "Output write", measurements::Type::AUXILIARY );
alib::XmlDataFactory::toStdout ( bcs );
} else { } else {
throw exception::CommonException ( "Invalid algorithm" ); throw exception::CommonException ( "Invalid algorithm" );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment