diff options
Diffstat (limited to 'moses-cmd')
-rwxr-xr-x | moses-cmd/src/IOWrapper.cpp | 1 | ||||
-rwxr-xr-x | moses-cmd/src/IOWrapper.h | 48 | ||||
-rw-r--r-- | moses-cmd/src/Main.cpp | 1 | ||||
-rw-r--r-- | moses-cmd/src/Main.h | 2 | ||||
-rw-r--r-- | moses-cmd/src/TranslationAnalysis.cpp | 2 | ||||
-rw-r--r-- | moses-cmd/src/TranslationAnalysis.h | 5 | ||||
-rw-r--r-- | moses-cmd/src/mbr.cpp | 2 | ||||
-rw-r--r-- | moses-cmd/src/mbr.h | 6 |
8 files changed, 36 insertions, 31 deletions
diff --git a/moses-cmd/src/IOWrapper.cpp b/moses-cmd/src/IOWrapper.cpp index e20209867..0e9121332 100755 --- a/moses-cmd/src/IOWrapper.cpp +++ b/moses-cmd/src/IOWrapper.cpp @@ -44,6 +44,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "InputFileStream.h" using namespace std; +using namespace Moses; IOWrapper::IOWrapper( const vector<FactorType> &inputFactorOrder diff --git a/moses-cmd/src/IOWrapper.h b/moses-cmd/src/IOWrapper.h index bc6e560bf..5999c04b6 100755 --- a/moses-cmd/src/IOWrapper.h +++ b/moses-cmd/src/IOWrapper.h @@ -38,54 +38,54 @@ POSSIBILITY OF SUCH DAMAGE. #include <vector> #include "TypeDef.h" #include "Sentence.h" - -class FactorMask; -class FactorCollection; -class Hypothesis; -class TrellisPathList; -class InputFileStream; +#include "FactorTypeSet.h" +#include "FactorCollection.h" +#include "Hypothesis.h" +#include "TrellisPathList.h" +#include "InputFileStream.h" +#include "InputType.h" class IOWrapper { protected: long m_translationId; - const std::vector<FactorType> &m_inputFactorOrder; - const std::vector<FactorType> &m_outputFactorOrder; - const FactorMask &m_inputFactorUsed; + const std::vector<Moses::FactorType> &m_inputFactorOrder; + const std::vector<Moses::FactorType> &m_outputFactorOrder; + const Moses::FactorMask &m_inputFactorUsed; std::ostream *m_nBestStream ,*m_outputWordGraphStream,*m_outputSearchGraphStream; std::string m_inputFilePath; std::istream *m_inputStream; - InputFileStream *m_inputFile; + Moses::InputFileStream *m_inputFile; bool m_surpressSingleBestOutput; - void Initialization(const std::vector<FactorType> &inputFactorOrder - , const std::vector<FactorType> &outputFactorOrder - , const FactorMask &inputFactorUsed + void Initialization(const std::vector<Moses::FactorType> &inputFactorOrder + , const std::vector<Moses::FactorType> &outputFactorOrder + , const Moses::FactorMask &inputFactorUsed , size_t nBestSize , const std::string &nBestFilePath); public: - IOWrapper(const std::vector<FactorType> &inputFactorOrder - , const std::vector<FactorType> &outputFactorOrder - , const FactorMask &inputFactorUsed + IOWrapper(const std::vector<Moses::FactorType> &inputFactorOrder + , const std::vector<Moses::FactorType> &outputFactorOrder + , const Moses::FactorMask &inputFactorUsed , size_t nBestSize , const std::string &nBestFilePath); - IOWrapper(const std::vector<FactorType> &inputFactorOrder - , const std::vector<FactorType> &outputFactorOrder - , const FactorMask &inputFactorUsed + IOWrapper(const std::vector<Moses::FactorType> &inputFactorOrder + , const std::vector<Moses::FactorType> &outputFactorOrder + , const Moses::FactorMask &inputFactorUsed , size_t nBestSize , const std::string &nBestFilePath , const std::string &infilePath); ~IOWrapper(); - InputType* GetInput(InputType *inputType); - void OutputBestHypo(const Hypothesis *hypo, long translationId, bool reportSegmentation, bool reportAllFactors); - void OutputBestHypo(const std::vector<const Factor*>& mbrBestHypo, long translationId, bool reportSegmentation, bool reportAllFactors); - void OutputNBestList(const TrellisPathList &nBestList, long translationId); - void Backtrack(const Hypothesis *hypo); + Moses::InputType* GetInput(Moses::InputType *inputType); + void OutputBestHypo(const Moses::Hypothesis *hypo, long translationId, bool reportSegmentation, bool reportAllFactors); + void OutputBestHypo(const std::vector<const Moses::Factor*>& mbrBestHypo, long translationId, bool reportSegmentation, bool reportAllFactors); + void OutputNBestList(const Moses::TrellisPathList &nBestList, long translationId); + void Backtrack(const Moses::Hypothesis *hypo); void ResetTranslationId() { m_translationId = 0; } diff --git a/moses-cmd/src/Main.cpp b/moses-cmd/src/Main.cpp index c02126fb5..afeccc0da 100644 --- a/moses-cmd/src/Main.cpp +++ b/moses-cmd/src/Main.cpp @@ -62,6 +62,7 @@ POSSIBILITY OF SUCH DAMAGE. #endif using namespace std; +using namespace Moses; bool ReadInput(IOWrapper &ioWrapper, InputTypeEnum inputType, InputType*& source) { diff --git a/moses-cmd/src/Main.h b/moses-cmd/src/Main.h index 76d74264f..e470de06c 100644 --- a/moses-cmd/src/Main.h +++ b/moses-cmd/src/Main.h @@ -39,4 +39,4 @@ POSSIBILITY OF SUCH DAMAGE. class IOWrapper; int main(int argc, char* argv[]); -IOWrapper *GetIODevice(const StaticData &staticData); +IOWrapper *GetIODevice(const Moses::StaticData &staticData); diff --git a/moses-cmd/src/TranslationAnalysis.cpp b/moses-cmd/src/TranslationAnalysis.cpp index 168802982..95b356118 100644 --- a/moses-cmd/src/TranslationAnalysis.cpp +++ b/moses-cmd/src/TranslationAnalysis.cpp @@ -7,6 +7,8 @@ #include "Hypothesis.h" #include "TranslationAnalysis.h" +using namespace Moses; + namespace TranslationAnalysis { void PrintTranslationAnalysis(std::ostream &os, const Hypothesis* hypo) diff --git a/moses-cmd/src/TranslationAnalysis.h b/moses-cmd/src/TranslationAnalysis.h index d7ff181c1..31efab0bd 100644 --- a/moses-cmd/src/TranslationAnalysis.h +++ b/moses-cmd/src/TranslationAnalysis.h @@ -8,8 +8,7 @@ #define _TRANSLATION_ANALYSIS_H_ #include <iostream> - -class Hypothesis; +#include "Hypothesis.h" namespace TranslationAnalysis { @@ -18,7 +17,7 @@ namespace TranslationAnalysis * print details about the translation represented in hypothesis to * os. Included information: phrase alignment, words dropped, scores */ -void PrintTranslationAnalysis(std::ostream &os, const Hypothesis* hypo); + void PrintTranslationAnalysis(std::ostream &os, const Moses::Hypothesis* hypo); } diff --git a/moses-cmd/src/mbr.cpp b/moses-cmd/src/mbr.cpp index ac7b7697a..2084405ce 100644 --- a/moses-cmd/src/mbr.cpp +++ b/moses-cmd/src/mbr.cpp @@ -13,7 +13,9 @@ #include "StaticData.h" #include "Util.h" #include "mbr.h" + using namespace std ; +using namespace Moses; /* Input : diff --git a/moses-cmd/src/mbr.h b/moses-cmd/src/mbr.h index 4d49755c2..c94a058fb 100644 --- a/moses-cmd/src/mbr.h +++ b/moses-cmd/src/mbr.h @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #pragma once -std::vector<const Factor*> doMBR(const TrellisPathList& nBestList); -void GetOutputFactors(const TrellisPath &path, std::vector <const Factor*> &translation); -float calculate_score(const std::vector< std::vector<const Factor*> > & sents, int ref, int hyp, std::vector < std::map < std::vector < const Factor *>, int > > & ngram_stats ); +std::vector<const Moses::Factor*> doMBR(const Moses::TrellisPathList& nBestList); +void GetOutputFactors(const Moses::TrellisPath &path, std::vector <const Moses::Factor*> &translation); +float calculate_score(const std::vector< std::vector<const Moses::Factor*> > & sents, int ref, int hyp, std::vector < std::map < std::vector < const Moses::Factor *>, int > > & ngram_stats ); |