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 | e0507d1aa96c6b1348e6a202beb95f63d8662258 (patch) | |
tree | 48afbac98a9df9d9d85a18553feb5548d6b4e391 /decoder | |
parent | 064e53669428404269c9015af2dee135bf91226d (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); |