diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-20 21:38:29 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-20 21:38:29 +0000 |
commit | cd5d8e0ab902a0c87e108b863aca2888248a4516 (patch) | |
tree | 27118981b820e8e5f4663baf8be195a19b1c8ab1 /decoder/dict.h | |
parent | 07e718c343f0e3cde63d3bed94cdba56c222007d (diff) |
hash.h
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@342 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/dict.h')
-rw-r--r-- | decoder/dict.h | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/decoder/dict.h b/decoder/dict.h index dd433c3e..348a97e3 100644 --- a/decoder/dict.h +++ b/decoder/dict.h @@ -1,37 +1,21 @@ #ifndef DICT_H_ #define DICT_H_ -#include "config.h" #include <cassert> #include <cstring> -#ifdef HAVE_SPARSEHASH -# include <google/dense_hash_map> -#else -# include <tr1/unordered_map> -#endif #include <string> #include <vector> -#include <boost/functional/hash.hpp> - +#include "hash.h" #include "wordid.h" class Dict { typedef -#ifdef HAVE_SPARSEHASH - google::dense_hash_map -#else - std::tr1::unordered_map -#endif - <std::string, WordID, boost::hash<std::string> > Map; - + HASH_MAP<std::string, WordID, boost::hash<std::string> > Map; public: Dict() : b0_("<bad0>") { -#ifdef HAVE_SPARSEHASH - d_.set_empty_key("<bad1>"); - d_.set_deleted_key("<bad2>"); -#endif + HASH_MAP_EMPTY(d_,"<bad1>"); words_.reserve(1000); } |