From bf089b56ac975d4aedb116dc55c78009b6e19a48 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 9 Oct 2014 12:52:06 +0100 Subject: [PATCH] consistent namespace --- contrib/server/mosesserver.cpp | 3 +-- moses-cmd/LatticeMBRGrid.cpp | 3 +-- moses-cmd/Main.cpp | 3 +-- moses/IOWrapper.cpp | 3 +-- moses/IOWrapper.h | 4 ---- moses/LatticeMBR.cpp | 3 +-- moses/LatticeMBR.h | 2 +- moses/TranslationTask.cpp | 5 ++--- moses/TranslationTask.h | 12 ++++-------- 9 files changed, 12 insertions(+), 26 deletions(-) diff --git a/contrib/server/mosesserver.cpp b/contrib/server/mosesserver.cpp index b75ee9820..4d0872f24 100644 --- a/contrib/server/mosesserver.cpp +++ b/contrib/server/mosesserver.cpp @@ -28,7 +28,6 @@ #include using namespace Moses; -using namespace MosesCmd; using namespace std; typedef std::map params_t; @@ -491,7 +490,7 @@ public: { // should the score breakdown be reported in a more structured manner? ostringstream buf; - MosesCmd::OutputAllFeatureScores(path.GetScoreBreakdown(),buf); + Moses::OutputAllFeatureScores(path.GetScoreBreakdown(),buf); nBestXMLItem["fvals"] = xmlrpc_c::value_string(buf.str()); } diff --git a/moses-cmd/LatticeMBRGrid.cpp b/moses-cmd/LatticeMBRGrid.cpp index 677adb791..9a3ccdff0 100644 --- a/moses-cmd/LatticeMBRGrid.cpp +++ b/moses-cmd/LatticeMBRGrid.cpp @@ -55,12 +55,11 @@ POSSIBILITY OF SUCH DAMAGE. using namespace std; using namespace Moses; -using namespace MosesCmd; //keys enum gridkey {lmbr_p,lmbr_r,lmbr_prune,lmbr_scale}; -namespace MosesCmd +namespace Moses { class Grid diff --git a/moses-cmd/Main.cpp b/moses-cmd/Main.cpp index 513c3a187..2e4a4ffdc 100644 --- a/moses-cmd/Main.cpp +++ b/moses-cmd/Main.cpp @@ -53,9 +53,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA using namespace std; using namespace Moses; -using namespace MosesCmd; -namespace MosesCmd +namespace Moses { void OutputFeatureWeightsForHypergraph(std::ostream &outputSearchGraphStream) diff --git a/moses/IOWrapper.cpp b/moses/IOWrapper.cpp index bb2735224..b00e5abae 100644 --- a/moses/IOWrapper.cpp +++ b/moses/IOWrapper.cpp @@ -51,9 +51,8 @@ POSSIBILITY OF SUCH DAMAGE. #include "IOWrapper.h" using namespace std; -using namespace Moses; -namespace MosesCmd +namespace Moses { IOWrapper::IOWrapper(const std::vector &inputFactorOrder diff --git a/moses/IOWrapper.h b/moses/IOWrapper.h index ec1137bdd..82f2fb6a1 100644 --- a/moses/IOWrapper.h +++ b/moses/IOWrapper.h @@ -57,10 +57,6 @@ namespace Moses class ScoreComponentCollection; class Hypothesis; class Factor; -} - -namespace MosesCmd -{ /** Helper class that holds misc variables to write data out to command line. */ diff --git a/moses/LatticeMBR.cpp b/moses/LatticeMBR.cpp index 148b44743..9ea21d5db 100644 --- a/moses/LatticeMBR.cpp +++ b/moses/LatticeMBR.cpp @@ -13,9 +13,8 @@ #include using namespace std; -using namespace Moses; -namespace MosesCmd +namespace Moses { size_t bleu_order = 4; diff --git a/moses/LatticeMBR.h b/moses/LatticeMBR.h index ab8b3cb76..47d6da3c4 100644 --- a/moses/LatticeMBR.h +++ b/moses/LatticeMBR.h @@ -19,7 +19,7 @@ -namespace MosesCmd +namespace Moses { class Edge; diff --git a/moses/TranslationTask.cpp b/moses/TranslationTask.cpp index c2f33db27..3a984ea70 100644 --- a/moses/TranslationTask.cpp +++ b/moses/TranslationTask.cpp @@ -10,12 +10,11 @@ #include "mbr.h" using namespace std; -using namespace Moses; -namespace MosesCmd +namespace Moses { -TranslationTask::TranslationTask(InputType* source, MosesCmd::IOWrapper &ioWrapper, +TranslationTask::TranslationTask(InputType* source, Moses::IOWrapper &ioWrapper, bool outputSearchGraphSLF, boost::shared_ptr > hypergraphOutput) : m_source(source), diff --git a/moses/TranslationTask.h b/moses/TranslationTask.h index 39a66a74a..f0f237c35 100644 --- a/moses/TranslationTask.h +++ b/moses/TranslationTask.h @@ -7,12 +7,8 @@ namespace Moses { - class InputType; - class OutputCollector; -} - -namespace MosesCmd -{ +class InputType; +class OutputCollector; class IOWrapper; @@ -26,7 +22,7 @@ class TranslationTask : public Moses::Task public: - TranslationTask(Moses::InputType* source, MosesCmd::IOWrapper &ioWrapper, + TranslationTask(Moses::InputType* source, Moses::IOWrapper &ioWrapper, bool outputSearchGraphSLF, boost::shared_ptr > hypergraphOutput); @@ -39,7 +35,7 @@ public: private: Moses::InputType* m_source; - MosesCmd::IOWrapper &m_ioWrapper; + Moses::IOWrapper &m_ioWrapper; bool m_outputSearchGraphSLF; boost::shared_ptr > m_hypergraphOutput;