summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-07-29 00:48:04 +0200
committerPatrick Simianer <p@simianer.de>2011-09-23 19:13:57 +0200
commitd980ecbbcd35fba23313aa715046bc0f87a23afd (patch)
tree0d31ab39ee3bb47b8172f30cb0e5d76a96fcdaaa /utils
parent4a1d2e56744cc97c11ef8220623bd7c5467d6c02 (diff)
first cut for sofia-ml, little change in utils/dict.h, coarse refactoring
Diffstat (limited to 'utils')
-rw-r--r--utils/dict.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/dict.h b/utils/dict.h
index 75ea3def..33cca6cf 100644
--- a/utils/dict.h
+++ b/utils/dict.h
@@ -1,7 +1,7 @@
#ifndef DICT_H_
#define DICT_H_
-
+#include <iostream>
#include <cassert>
#include <cstring>
@@ -73,7 +73,8 @@ class Dict {
inline const std::string& Convert(const WordID& id) const {
if (id == 0) return b0_;
- assert(id <= (int)words_.size());
+ //assert(id <= (int)words_.size());
+ if (id < 0 || id > (int)words_.size()) return b0_;
return words_[id-1];
}