diff --git a/concordia/anubis_searcher.cpp b/concordia/anubis_searcher.cpp index 8f389c7..8725d64 100644 --- a/concordia/anubis_searcher.cpp +++ b/concordia/anubis_searcher.cpp @@ -24,39 +24,34 @@ boost::ptr_vector AnubisSearcher::anubisSearch( boost::shared_ptr > pattern) throw(ConcordiaException) { boost::ptr_vector result; - + boost::shared_ptr > patternVector = Utils::indexVectorToSaucharVector(pattern); - - if (patternVector->size() != pattern->size() * sizeof(INDEX_CHARACTER_TYPE)) { - throw ConcordiaException("Increasing pattern resolution went wrong."); - } - + if (patternVector->size() != + pattern->size() * sizeof(INDEX_CHARACTER_TYPE)) { + throw ConcordiaException("Increasing pattern resolution went wrong."); + } + TmMatchesMap tmMatchesMap; - for (int offset = 0;offset < pattern->size(); offset++) { + for (int offset = 0; offset < pattern->size(); offset++) { int highResOffset = offset * sizeof(INDEX_CHARACTER_TYPE); boost::shared_ptr > currentPattern = - boost::shared_ptr >(new std::vector( - patternVector->begin()+highResOffset,patternVector->end())); + boost::shared_ptr > + (new std::vector( + patternVector->begin()+highResOffset, patternVector->end())); SUFFIX_MARKER_TYPE longestPrefixesLength; - boost::ptr_vector longestPrefixes = lcpSearch(T, markers, SA, - currentPattern, longestPrefixesLength); + boost::ptr_vector longestPrefixes = + lcpSearch(T, markers, SA, currentPattern, longestPrefixesLength); BOOST_FOREACH(SubstringOccurence & occurence, longestPrefixes) { - TmMatchesMapIterator mapIterator = tmMatchesMap.find(occurence.getId()); - if(mapIterator != tmMatchesMap.end()) { - - } else { - - } + TmMatchesMapIterator mapIterator = tmMatchesMap.find( + occurence.getId()); + if (mapIterator != tmMatchesMap.end()) { + } } + } - - - - } - return result; } diff --git a/concordia/common/utils.cpp b/concordia/common/utils.cpp index 7ae58cc..fa0edb7 100644 --- a/concordia/common/utils.cpp +++ b/concordia/common/utils.cpp @@ -44,10 +44,9 @@ sauchar_t * Utils::indexVectorToSaucharArray( boost::shared_ptr > Utils::indexVectorToSaucharVector( boost::shared_ptr > input) { - - boost::shared_ptr > result = boost::shared_ptr >( - new std::vector); - + boost::shared_ptr > result = + boost::shared_ptr >(new std::vector); + for (vector::iterator it = input->begin(); it != input->end(); ++it) { appendCharToSaucharVector(result, *it); @@ -71,6 +70,4 @@ void Utils::_insertCharToSaucharArray(sauchar_t * array, array[i] = characterArray[i-pos]; } } - - diff --git a/concordia/common/utils.hpp b/concordia/common/utils.hpp index 4fc3897..a100af0 100644 --- a/concordia/common/utils.hpp +++ b/concordia/common/utils.hpp @@ -34,7 +34,8 @@ public: static sauchar_t * indexVectorToSaucharArray( boost::shared_ptr > input); - static boost::shared_ptr > indexVectorToSaucharVector( + static boost::shared_ptr > + indexVectorToSaucharVector( boost::shared_ptr > input); static void appendCharToSaucharVector(