summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-11 22:40:01 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-11 22:40:01 +0000
commit5359400c08f817f8c980c034fa1de4d55a43a65c (patch)
tree8cfad5744a6f25f6601f07e4a130bcda910e9f8e /decoder
parent6dbbe6ad899d1849b23f87a205556f3e51751879 (diff)
itoa
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@529 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder')
-rwxr-xr-xdecoder/apply_fsa_models.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/decoder/apply_fsa_models.cc b/decoder/apply_fsa_models.cc
index 3a1e8050..1c30eb90 100755
--- a/decoder/apply_fsa_models.cc
+++ b/decoder/apply_fsa_models.cc
@@ -9,6 +9,7 @@
#include <cassert>
#include "cfg.h"
#include "hg_cfg.h"
+#include "utoa.h"
using namespace std;
@@ -107,8 +108,8 @@ ApplyFsaBy::ApplyFsaBy(std::string const& n, int pop_limit) : pop_limit(pop_limi
}
ApplyFsaBy::ApplyFsaBy(int i, int pop_limit) : pop_limit(pop_limit) {
- assert (i>=0);
- assert (i<N_ALGORITHMS);
+ if (i<0 || i>=N_ALGORITHMS)
+ throw std::runtime_error("Unknown ApplyFsaBy type id: "+itos(i)+" - legal types: "+all_names());
algorithm=i;
}