From f467e60fe09b6f30487a0a341988d0014bca4794 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Fri, 23 Oct 2015 18:33:12 +0100 Subject: [PATCH] init moses2 --- contrib/other-builds/moses2/Factor.h | 6 ++---- contrib/other-builds/moses2/Main.cpp | 15 +++++++++++++++ contrib/other-builds/moses2/StaticData.cpp | 18 ++++++++++++++++++ contrib/other-builds/moses2/StaticData.h | 15 +++++++++++++++ contrib/other-builds/moses2/Vocab.h | 10 +++++----- contrib/other-builds/moses2/compile.sh | 3 ++- 6 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 contrib/other-builds/moses2/Main.cpp create mode 100644 contrib/other-builds/moses2/StaticData.cpp create mode 100644 contrib/other-builds/moses2/StaticData.h diff --git a/contrib/other-builds/moses2/Factor.h b/contrib/other-builds/moses2/Factor.h index f4c966969..a6c5e33e4 100644 --- a/contrib/other-builds/moses2/Factor.h +++ b/contrib/other-builds/moses2/Factor.h @@ -5,8 +5,7 @@ * Author: hieu */ -#ifndef FACTOR_H_ -#define FACTOR_H_ +#pragma once #include "util/string_piece.hh" #include "util/string_piece_hash.hh" @@ -23,7 +22,7 @@ public: } inline bool operator==(const Factor &compare) const { - return m_string == &compare.m_string; + return m_string == compare.m_string; } protected: @@ -31,4 +30,3 @@ protected: }; -#endif /* FACTOR_H_ */ diff --git a/contrib/other-builds/moses2/Main.cpp b/contrib/other-builds/moses2/Main.cpp new file mode 100644 index 000000000..07a60831f --- /dev/null +++ b/contrib/other-builds/moses2/Main.cpp @@ -0,0 +1,15 @@ +#include +#include "StaticData.cpp" +#include "Word.h" + +using namespace std; + +int main() +{ + cerr << "Starting..." << endl; + + //StaticData sd; + //Word w; + + cerr << "Finished" << endl; +} diff --git a/contrib/other-builds/moses2/StaticData.cpp b/contrib/other-builds/moses2/StaticData.cpp new file mode 100644 index 000000000..c5ab0184b --- /dev/null +++ b/contrib/other-builds/moses2/StaticData.cpp @@ -0,0 +1,18 @@ +/* + * StaticData.cpp + * + * Created on: 23 Oct 2015 + * Author: hieu + */ + +#include "StaticData.h" + +StaticData::StaticData() { + // TODO Auto-generated constructor stub + +} + +StaticData::~StaticData() { + // TODO Auto-generated destructor stub +} + diff --git a/contrib/other-builds/moses2/StaticData.h b/contrib/other-builds/moses2/StaticData.h new file mode 100644 index 000000000..e3212fea5 --- /dev/null +++ b/contrib/other-builds/moses2/StaticData.h @@ -0,0 +1,15 @@ +/* + * StaticData.h + * + * Created on: 23 Oct 2015 + * Author: hieu + */ + +#pragma once + +class StaticData { +public: + StaticData(); + virtual ~StaticData(); +}; + diff --git a/contrib/other-builds/moses2/Vocab.h b/contrib/other-builds/moses2/Vocab.h index ae2687b90..944bd1ec1 100644 --- a/contrib/other-builds/moses2/Vocab.h +++ b/contrib/other-builds/moses2/Vocab.h @@ -9,8 +9,8 @@ #define VOCAB_H_ #include -#include "util/string_piece.hh" -#include "moses/Util.h" +//#include "util/string_piece.hh" +//#include "moses/Util.h" class Vocab { public: @@ -21,13 +21,13 @@ public: Vocab(); virtual ~Vocab(); - const Factor *AddFactor(const StringPiece &factorString); + //const Factor *AddFactor(const StringPiece &factorString); protected: static Vocab s_instance; - typedef boost::unordered_set, Moses::UnorderedComparer> Set; - Set m_set; + //typedef boost::unordered_set, Moses::UnorderedComparer> Set; + //Set m_set; }; diff --git a/contrib/other-builds/moses2/compile.sh b/contrib/other-builds/moses2/compile.sh index 3ca828406..3217b7b68 100755 --- a/contrib/other-builds/moses2/compile.sh +++ b/contrib/other-builds/moses2/compile.sh @@ -1 +1,2 @@ -g++ -I../../.. -I../../../boost/include StaticData.cpp Factor.cpp Word.cpp \ No newline at end of file +#g++ -I../../.. -I../../../boost/include Factor.cpp Word.cpp StaticData.cpp Main.cpp +g++ -I../../.. -I../../../boost/include StaticData.cpp Main.cpp