diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2016-10-06 15:48:06 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2016-10-06 15:48:06 +0300 |
commit | babc5acf70730bd9fd28d0d4deede8fe0fb23c29 (patch) | |
tree | c70404476fd6703b5c61216578052d1af83ecd27 /moses/TranslationModel | |
parent | d03991acec06b10bdd6fe213aac64012978ae90b (diff) |
check that pt exists
Diffstat (limited to 'moses/TranslationModel')
-rw-r--r-- | moses/TranslationModel/ProbingPT/quering.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/moses/TranslationModel/ProbingPT/quering.cpp b/moses/TranslationModel/ProbingPT/quering.cpp index d616e1f25..52cd7f516 100644 --- a/moses/TranslationModel/ProbingPT/quering.cpp +++ b/moses/TranslationModel/ProbingPT/quering.cpp @@ -11,10 +11,15 @@ QueryEngine::QueryEngine(const char * filepath) //Create filepaths std::string basepath(filepath); + std::string path_to_config = basepath + "/config"; std::string path_to_hashtable = basepath + "/probing_hash.dat"; std::string path_to_source_vocabid = basepath + "/source_vocabids"; std::string alignPath = basepath + "/Alignments.dat"; + if (!FileExists(path_to_config)) { + UTIL_THROW2("Binary table doesn't exist is didn't finish binarizing: " << path_to_config); + } + ///Source phrase vocabids read_map(source_vocabids, path_to_source_vocabid.c_str()); @@ -24,7 +29,7 @@ QueryEngine::QueryEngine(const char * filepath) //Read config file boost::unordered_map<std::string, std::string> keyValue; - std::ifstream config((basepath + "/config").c_str()); + std::ifstream config(path_to_config.c_str()); std::string line; while (getline(config, line)) { std::vector<std::string> toks = Tokenize(line, "\t"); |