summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-03-03 03:24:53 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2012-03-03 03:24:53 -0500
commite0507d1aa96c6b1348e6a202beb95f63d8662258 (patch)
tree48afbac98a9df9d9d85a18553feb5548d6b4e391 /decoder
parent064e53669428404269c9015af2dee135bf91226d (diff)
PYP language model (Teh 2006)
Diffstat (limited to 'decoder')
-rw-r--r--decoder/fst_translator.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/decoder/fst_translator.cc b/decoder/fst_translator.cc
index 38dbd717..074de4c9 100644
--- a/decoder/fst_translator.cc
+++ b/decoder/fst_translator.cc
@@ -30,7 +30,10 @@ struct FSTTranslatorImpl {
if (input.find("{\"rules\"") == 0) {
istringstream is(input);
Hypergraph src_cfg_hg;
- assert(HypergraphIO::ReadFromJSON(&is, &src_cfg_hg));
+ if (!HypergraphIO::ReadFromJSON(&is, &src_cfg_hg)) {
+ cerr << "Failed to read HG from JSON.\n";
+ abort();
+ }
if (add_pass_through_rules) {
SparseVector<double> feats;
feats.set_value(FD::Convert("PassThrough"), 1);