summaryrefslogtreecommitdiff
path: root/decoder/apply_fsa_models.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-13 08:28:58 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-13 08:28:58 +0000
commitcf54677dac448084f38cf54d2596a2078492fce6 (patch)
tree4924c470857ecb493b07ee3123435abce8b9bdf2 /decoder/apply_fsa_models.cc
parentead8845217c5e6e48f3680ead6f859ec8e110eb2 (diff)
boost::hash
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@540 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/apply_fsa_models.cc')
-rwxr-xr-xdecoder/apply_fsa_models.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/decoder/apply_fsa_models.cc b/decoder/apply_fsa_models.cc
index c9bda68b..8771863c 100755
--- a/decoder/apply_fsa_models.cc
+++ b/decoder/apply_fsa_models.cc
@@ -10,6 +10,7 @@
#include "cfg.h"
#include "hg_cfg.h"
#include "utoa.h"
+#include "hash.h"
using namespace std;
@@ -26,12 +27,12 @@ typedef CFG::RuleHandle RuleHandle;
namespace {
// if we don't greedy-binarize, we want to encode recognized prefixes p (X -> p . rest) efficiently. if we're doing this, we may as well also push costs so we can best-first select rules in a lazy fashion. this is effectively left-branching binarization, of course.
-template <class K,class V>
+template <class K,class V,class Hash>
struct prefix_map_type {
typedef std::map<K,V> type;
};
//template typedef
-#define PREFIX_MAP(k,v) prefix_map_type<k,v>::type
+#define PREFIX_MAP(k,v) prefix_map_type<k,v,boost::hash<k> >::type
typedef NTHandle LHS;
struct PrefixTrieNode {
prob_t backward; // (viterbi) backward prob (for cost pushing)