mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
check that pt exists
This commit is contained in:
parent
d03991acec
commit
babc5acf70
@ -12,10 +12,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());
|
||||
|
||||
@ -25,7 +30,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 = Moses2::Tokenize(line, "\t");
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user