summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorKenneth Heafield <kenlm@kheafield.com>2011-06-03 20:49:52 -0400
committerPatrick Simianer <p@simianer.de>2011-09-23 19:13:56 +0200
commit67b7b0296f8a7d2763fa49f8846513f0b610fe9f (patch)
tree0c6789766f3d93ef8713a6ad4a4eb5e154ba286c /decoder
parent7b39f6f36d737b6de0f551a9f814e303fc0cbd34 (diff)
Add exception catcher around constructor
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ff_klm.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/decoder/ff_klm.cc b/decoder/ff_klm.cc
index 35b35d36..71ba9f30 100644
--- a/decoder/ff_klm.cc
+++ b/decoder/ff_klm.cc
@@ -385,7 +385,12 @@ KLanguageModel<Model>::KLanguageModel(const string& param) {
if (!ParseLMArgs(param, &filename, &mapfile, &explicit_markers, &featname)) {
abort();
}
- pimpl_ = new KLanguageModelImpl<Model>(filename, mapfile, explicit_markers);
+ try {
+ pimpl_ = new KLanguageModelImpl<Model>(filename, mapfile, explicit_markers);
+ } catch (std::exception &e) {
+ std::cerr << e.what() << std::endl;
+ abort();
+ }
fid_ = FD::Convert(featname);
oov_fid_ = FD::Convert(featname+"_OOV");
cerr << "FID: " << oov_fid_ << endl;