From: nvalimak Date: Mon, 8 Nov 2010 12:56:23 +0000 (+0000) Subject: Bug fixes for RLCSA wrapper X-Git-Url: http://git.nguyen.vg/gitweb/?p=SXSI%2FTextCollection.git;a=commitdiff_plain;h=362c485f3a3cb6e32a77baeacb28c8832f96c879 Bug fixes for RLCSA wrapper git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/TextCollection@934 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- diff --git a/RLCSAWrapper.h b/RLCSAWrapper.h index 44f7268..c92bdb9 100644 --- a/RLCSAWrapper.h +++ b/RLCSAWrapper.h @@ -167,7 +167,7 @@ public: goto exact_pattern_matching; // Invalid format IndelQuery iq(this); - //std::cerr << "Pattern: " << tmp+1 << ", k = " << k << std::endl; +// std::cerr << "RLCSAWrapper::Contains(): Pattern: " << tmp+1 << ", k = " << k << std::endl; return iq.align(tmp+1, k); } @@ -226,7 +226,10 @@ public: // Index from/to disk RLCSAWrapper(FILE *file, char const *filename) : rlcsa(new CSA::RLCSA(std::string(filename))) - { /* NOP */ } + { + // Init the edit distance look-up tables + MyersEditDistanceIncremental::initMyersFourRussians(); + } void Save(FILE *file, char const *filename) const { @@ -234,6 +237,7 @@ public: // Saving type info: if (std::fwrite(&type, 1, 1, file) != 1) throw std::runtime_error("RLCSAWrapper::Save(): file write error (type flag)."); + fflush(file); this->rlcsa->writeTo(std::string(filename)); }