summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorKenneth Heafield <kenlm@kheafield.com>2011-06-03 20:56:37 -0400
committerPatrick Simianer <p@simianer.de>2011-09-23 19:13:56 +0200
commit545c79f6bd0982f02bc22e16a9e904a483f98881 (patch)
tree9ab3988fff10eb2bc0fe8ad63f49babfe9d16073 /decoder
parent010b19d68fd82dce4279b0f50e51eee9b75d0252 (diff)
Code cleanup for vocabulary mapping
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ff_klm.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/decoder/ff_klm.cc b/decoder/ff_klm.cc
index 71ba9f30..a3bd0c5f 100644
--- a/decoder/ff_klm.cc
+++ b/decoder/ff_klm.cc
@@ -282,11 +282,10 @@ class KLanguageModelImpl {
KLanguageModelImpl(const string& filename, const string& mapfile, bool explicit_markers) :
kCDEC_UNK(TD::Convert("<unk>")) ,
add_sos_eos_(!explicit_markers) {
- if (true) {
- boost::scoped_ptr<lm::ngram::EnumerateVocab> vm;
- vm.reset(new VMapper(&cdec2klm_map_));
+ {
+ VMapper vm(&cdec2klm_map_);
lm::ngram::Config conf;
- conf.enumerate_vocab = vm.get();
+ conf.enumerate_vocab = &vm;
ngram_ = new Model(filename.c_str(), conf);
}
order_ = ngram_->Order();