Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2015-10-12 16:31:29 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-10-12 16:31:29 +0300
commit6b182ee5e987a5b2823aea7eaaa7ef0457c6a30d (patch)
tree1016815a41605c85765312d00172b3c602da8db6 /moses/Hypothesis.h
parentb0248f8ad53012e7f2b43f88ce67747403c41a80 (diff)
pb framework for using boost::unordered_set instead of std::set
Diffstat (limited to 'moses/Hypothesis.h')
-rw-r--r--moses/Hypothesis.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/moses/Hypothesis.h b/moses/Hypothesis.h
index 0ce75b83c..e8c1edcb2 100644
--- a/moses/Hypothesis.h
+++ b/moses/Hypothesis.h
@@ -288,13 +288,16 @@ public:
// creates a map of TARGET positions which should be replaced by word using placeholder
std::map<size_t, const Moses::Factor*> GetPlaceholders(const Moses::Hypothesis &hypo, Moses::FactorType placeholderFactor) const;
+ // for unordered_set in stack
+ size_t hash() const;
+ bool operator==(const Hypothesis& other) const;
+
#ifdef HAVE_XMLRPC_C
void OutputWordAlignment(std::vector<xmlrpc_c::value>& out) const;
void OutputLocalWordAlignment(std::vector<xmlrpc_c::value>& dest) const;
#endif
-
};
std::ostream& operator<<(std::ostream& out, const Hypothesis& hypothesis);
@@ -335,5 +338,18 @@ public:
}
};
+class HypothesisRecombinationUnordered
+{
+public:
+ size_t operator()(const Hypothesis* hypo) const {
+ return hypo->hash();
+ }
+
+ bool operator()(const Hypothesis* hypoA, const Hypothesis* hypoB) const {
+ return (*hypoA) == (*hypoB);
+ }
+
+};
+
}
#endif