diff --git a/words/sloynik_engine.cpp b/words/sloynik_engine.cpp index 137c0faee1..3c2c74fac3 100644 --- a/words/sloynik_engine.cpp +++ b/words/sloynik_engine.cpp @@ -13,11 +13,13 @@ sl::SloynikEngine::SloynikEngine(string const & dictionaryPath, FileReader * pDicFileReader = new FileReader(dictionaryPath); // m_pDictionary takes ownership of pDicFileReader. m_pDictionary.reset(new sl::SlofDictionary(pDicFileReader)); + vector stamp; stamp.push_back(strFn.m_PrimaryCompareId); stamp.push_back(strFn.m_SecondaryCompareId); stamp.push_back(m_pDictionary->KeyCount()); stamp.push_back(pDicFileReader->Size()); + string const stampPath = indexPath + ".stamp"; bool needIndexBuild = false; try @@ -33,11 +35,13 @@ sl::SloynikEngine::SloynikEngine(string const & dictionaryPath, needIndexBuild = true; } } - catch (RootException &) + catch (RootException const &) { needIndexBuild = true; } + LOG(LINFO, ("Started sloynik engine. Words in the dictionary:", m_pDictionary->KeyCount())); + // Uncomment to always rebuild the index: needIndexBuild = true; if (needIndexBuild) { diff --git a/words/sloynik_index.cpp b/words/sloynik_index.cpp index b2399d2e39..41bbdb97f5 100644 --- a/words/sloynik_index.cpp +++ b/words/sloynik_index.cpp @@ -1,12 +1,15 @@ #include "sloynik_index.hpp" #include "dictionary.hpp" + #include "../coding/file_writer.hpp" +#include "../coding/timsort/timsort.hpp" + #include "../base/assert.hpp" #include "../base/logging.hpp" #include "../base/cache.hpp" + #include "../std/bind.hpp" -#include "../coding/timsort/timsort.hpp" #define FILE_SORTER_LOG_BATCH_SIZE 11