diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-24 21:18:01 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-24 21:18:01 +0000 |
commit | 2cb224de7db49b761ac06b031090fe7f846744fe (patch) | |
tree | dc1d4e949081ea0e0868773bd7a31b96faa77487 /decoder/scfg_translator.cc | |
parent | 1fbdaa4d49acf90d2124aef8810d723ddbb0dad5 (diff) |
FSA: simpler Scan1 ScanT1 methods, otherewise also expose edge to full Scan
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@399 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/scfg_translator.cc')
-rw-r--r-- | decoder/scfg_translator.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/decoder/scfg_translator.cc b/decoder/scfg_translator.cc index bfbe44ee..08276c71 100644 --- a/decoder/scfg_translator.cc +++ b/decoder/scfg_translator.cc @@ -2,10 +2,10 @@ //TODO: grammar heuristic (min cost of reachable rule set) for binarizations (active edges) if we wish to prune those also +#include "hash.h" #include "translator.h" #include <algorithm> #include <vector> -#include <tr1/unordered_map> #include <boost/foreach.hpp> #include <boost/functional/hash.hpp> #include "hg.h" @@ -169,13 +169,15 @@ struct SCFGTranslatorImpl { typedef std::pair<int, WordID> StateSplit; typedef std::pair<StateSplit, int> StateSplitPair; - typedef std::tr1::unordered_map<StateSplit, int, boost::hash<StateSplit> > Split2Node; - typedef std::tr1::unordered_map<int, vector<WordID> > Splits; + typedef HASH_MAP<StateSplit, int, boost::hash<StateSplit> > Split2Node; + typedef HASH_MAP<int, vector<WordID> > Splits; bool RefineForest(Hypergraph* forest) { Hypergraph refined_forest; Split2Node s2n; + HASH_MAP_RESERVED(s2n,StateSplit(-1,-1),StateSplit(-2,-2)); Splits splits; + HASH_MAP_RESERVED(splits,-1,-2); Hypergraph::Node& coarse_goal_node = *(forest->nodes_.end()-1); bool refined_goal_node = false; foreach(Hypergraph::Node& node, forest->nodes_){ |