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-17 23:43:03 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-10-18 00:09:36 +0300
commit2683b58b537e12b23993c99f3a4e38b4106b2b34 (patch)
treeeb30e3a7196aabb6db55c9217be00ad19ff71c83 /moses/Syntax
parent5754a46905346987cdcc9eead16a3a06458b787b (diff)
clean up comparison functions for Words and Phrases
Diffstat (limited to 'moses/Syntax')
-rw-r--r--moses/Syntax/F2S/Manager.h2
-rw-r--r--moses/Syntax/Manager.cpp2
-rw-r--r--moses/Syntax/Manager.h3
-rw-r--r--moses/Syntax/S2T/Manager-inl.h2
-rw-r--r--moses/Syntax/S2T/Manager.h2
5 files changed, 6 insertions, 5 deletions
diff --git a/moses/Syntax/F2S/Manager.h b/moses/Syntax/F2S/Manager.h
index bcf1ff2bd..7514338f7 100644
--- a/moses/Syntax/F2S/Manager.h
+++ b/moses/Syntax/F2S/Manager.h
@@ -1,10 +1,10 @@
#pragma once
-#include <set>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
#include "moses/InputType.h"
#include "moses/Syntax/KBestExtractor.h"
diff --git a/moses/Syntax/Manager.cpp b/moses/Syntax/Manager.cpp
index 5dd4c3b64..10b0d25c9 100644
--- a/moses/Syntax/Manager.cpp
+++ b/moses/Syntax/Manager.cpp
@@ -65,7 +65,7 @@ void Manager::OutputUnknowns(OutputCollector *collector) const
long translationId = m_source.GetTranslationId();
std::ostringstream out;
- for (std::set<Moses::Word>::const_iterator p = m_oovs.begin();
+ for (boost::unordered_set<Moses::Word>::const_iterator p = m_oovs.begin();
p != m_oovs.end(); ++p) {
out << *p;
}
diff --git a/moses/Syntax/Manager.h b/moses/Syntax/Manager.h
index d62e2f72a..a80c756a8 100644
--- a/moses/Syntax/Manager.h
+++ b/moses/Syntax/Manager.h
@@ -1,5 +1,6 @@
#pragma once
+#include <boost/unordered_set.hpp>
#include "moses/InputType.h"
#include "moses/BaseManager.h"
@@ -50,7 +51,7 @@ public:
virtual const SHyperedge *GetBestSHyperedge() const = 0;
protected:
- std::set<Word> m_oovs;
+ boost::unordered_set<Word> m_oovs;
private:
// Syntax-specific helper functions used to implement OutputNBest.
diff --git a/moses/Syntax/S2T/Manager-inl.h b/moses/Syntax/S2T/Manager-inl.h
index 67588eb94..422f14915 100644
--- a/moses/Syntax/S2T/Manager-inl.h
+++ b/moses/Syntax/S2T/Manager-inl.h
@@ -108,7 +108,7 @@ void Manager<Parser>::InitializeParsers(PChart &pchart,
// Find the set of OOVs for this input. This function assumes that the
// PChart argument has already been initialized from the input.
template<typename Parser>
-void Manager<Parser>::FindOovs(const PChart &pchart, std::set<Word> &oovs,
+void Manager<Parser>::FindOovs(const PChart &pchart, boost::unordered_set<Word> &oovs,
std::size_t maxOovWidth)
{
// Get the set of RuleTries.
diff --git a/moses/Syntax/S2T/Manager.h b/moses/Syntax/S2T/Manager.h
index 711d6f9d8..b0e6555cf 100644
--- a/moses/Syntax/S2T/Manager.h
+++ b/moses/Syntax/S2T/Manager.h
@@ -45,7 +45,7 @@ public:
void OutputDetailedTranslationReport(OutputCollector *collector) const;
private:
- void FindOovs(const PChart &, std::set<Word> &, std::size_t);
+ void FindOovs(const PChart &, boost::unordered_set<Word> &, std::size_t);
void InitializeCharts();