diff options
author | XapaJIaMnu <nheart@gmail.com> | 2014-12-23 18:21:06 +0300 |
---|---|---|
committer | XapaJIaMnu <nheart@gmail.com> | 2014-12-23 18:21:06 +0300 |
commit | d0807c45f28a8ebe02d119f2563bb3835a153e0f (patch) | |
tree | ccfe23e4a7f98aebdea1f7d03a2f10e9ee1dcd52 /misc | |
parent | 61c0c752b3beefa92172fef27ad2c6acfc1a9a1e (diff) |
Fixed crash in probingPT when probability is precisely 0
Diffstat (limited to 'misc')
-rw-r--r-- | misc/CreateProbingPT.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/misc/CreateProbingPT.cpp b/misc/CreateProbingPT.cpp index 3ea369a96..2b0e8cd8a 100644 --- a/misc/CreateProbingPT.cpp +++ b/misc/CreateProbingPT.cpp @@ -5,14 +5,22 @@ int main(int argc, char* argv[]){ - if (argc != 3) { + const char * is_reordering = "false"; + + if (!(argc == 5 || argc == 4)) { // Tell the user how to run the program - std::cerr << "Provided " << argc << " arguments, needed 3." << std::endl; - std::cerr << "Usage: " << argv[0] << " path_to_phrasetable output_dir" << std::endl; + std::cerr << "Provided " << argc << " arguments, needed 4 or 5." << std::endl; + std::cerr << "Usage: " << argv[0] << " path_to_phrasetable output_dir num_scores is_reordering" << std::endl; + std::cerr << "is_reordering should be either true or false, but it is currently a stub feature." << std::endl; + //std::cerr << "Usage: " << argv[0] << " path_to_phrasetable number_of_uniq_lines output_bin_file output_hash_table output_vocab_id" << std::endl; return 1; } - createProbingPT(argv[1], argv[2]); + if (argc == 5) { + is_reordering = argv[4]; + } + + createProbingPT(argv[1], argv[2], argv[3], is_reordering); util::PrintUsage(std::cout); return 0; |