diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2012-03-03 03:24:53 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2012-03-03 03:24:53 -0500 |
commit | b3c0b5e4a05019045e6a81209741b60e0f20b073 (patch) | |
tree | 70ffad8c6b486d0bb3830154294c3ee455e5bb6f /decoder | |
parent | d258228a87bf83b14b2ff58b010cd977a15a8c43 (diff) |
PYP language model (Teh 2006)
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/fst_translator.cc | 5 |
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); |