From d980ecbbcd35fba23313aa715046bc0f87a23afd Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Fri, 29 Jul 2011 00:48:04 +0200 Subject: first cut for sofia-ml, little change in utils/dict.h, coarse refactoring --- utils/dict.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'utils') 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 #include #include @@ -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]; } -- cgit v1.2.3