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:
-rwxr-xr-xmoses/.cdtbuild12
-rwxr-xr-xmoses/src/Arc.cpp1
-rwxr-xr-xmoses/src/Arc.h8
-rwxr-xr-xmoses/src/Factor.h2
-rwxr-xr-xmoses/src/FactorCollection.cpp2
-rwxr-xr-xmoses/src/FactorCollection.h3
-rwxr-xr-xmoses/src/FactorTypeSet.cpp4
-rwxr-xr-xmoses/src/FactorTypeSet.h2
-rwxr-xr-xmoses/src/HypothesisCollection.cpp2
-rwxr-xr-xmoses/src/HypothesisCollection.h5
-rwxr-xr-xmoses/src/HypothesisCollectionIntermediate.cpp2
-rwxr-xr-xmoses/src/HypothesisCollectionIntermediate.h3
-rw-r--r--moses/src/Input.cpp2
-rw-r--r--moses/src/Input.h3
-rwxr-xr-xmoses/src/LatticeEdge.cpp2
-rwxr-xr-xmoses/src/LatticeEdge.h3
-rwxr-xr-xmoses/src/LatticePath.cpp2
-rwxr-xr-xmoses/src/LatticePath.h2
-rwxr-xr-xmoses/src/Object.h8
-rwxr-xr-xmoses/src/Phrase.cpp2
-rwxr-xr-xmoses/src/Phrase.h2
-rwxr-xr-xmoses/src/PhraseDictionary.cpp2
-rwxr-xr-xmoses/src/PhraseDictionary.h3
-rw-r--r--moses/src/SquareMatrix.cpp10
-rw-r--r--moses/src/SquareMatrix.h20
-rw-r--r--moses/src/TargetPhrase.cpp2
-rw-r--r--moses/src/TargetPhrase.h1
-rwxr-xr-xmoses/src/TranslationOption.cpp2
-rwxr-xr-xmoses/src/TranslationOption.h1
-rw-r--r--moses/src/TranslationOptionCollection.cpp3
-rwxr-xr-xmoses/src/TranslationOptionCollection.h2
-rwxr-xr-xmoses/src/Word.cpp2
-rwxr-xr-xmoses/src/Word.h2
-rwxr-xr-xmoses/src/WordsBitmap.cpp3
-rwxr-xr-xmoses/src/WordsBitmap.h3
-rw-r--r--moses/src/WordsRange.cpp2
-rwxr-xr-xmoses/src/WordsRange.h3
37 files changed, 103 insertions, 30 deletions
diff --git a/moses/.cdtbuild b/moses/.cdtbuild
index 7c7fdc53b..45a5ce0b9 100755
--- a/moses/.cdtbuild
+++ b/moses/.cdtbuild
@@ -45,10 +45,10 @@
<listOptionValue builtIn="false" value="${ProjDirPath}/../mysqlpp/lib"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.444585015" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
-<listOptionValue builtIn="false" value="_LARGE_FILES"/>
<listOptionValue builtIn="false" value="LM_SRI"/>
-<listOptionValue builtIn="false" value="_FILE_OFFSET_BITS=64"/>
<listOptionValue builtIn="false" value="TRACE_ENABLE"/>
+<listOptionValue builtIn="false" value="_FILE_OFFSET_BITS=64"/>
+<listOptionValue builtIn="false" value="_LARGE_FILES"/>
</option>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.lib.release.1731276863" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.lib.release"/>
@@ -62,10 +62,10 @@
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.lib.debug.57605597" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.lib.debug">
<option id="gnu.cpp.compiler.option.preprocessor.def.547610699" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="LM_SRI"/>
-<listOptionValue builtIn="false" value="_FILE_OFFSET_BITS=64"/>
-<listOptionValue builtIn="false" value="_LARGE_FILES"/>
<listOptionValue builtIn="false" value="TRACE_ENABLE"/>
<listOptionValue builtIn="false" value="N_BEST"/>
+<listOptionValue builtIn="false" value="_FILE_OFFSET_BITS=64"/>
+<listOptionValue builtIn="false" value="_LARGE_FILES"/>
</option>
<option id="gnu.cpp.compiler.option.include.paths.2084651176" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="${ProjDirPath}/../boost/include/boost-1_33_1"/>
@@ -99,10 +99,10 @@
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.1390867069" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="LM_SRI"/>
-<listOptionValue builtIn="false" value="_FILE_OFFSET_BITS=64"/>
-<listOptionValue builtIn="false" value="_LARGE_FILES"/>
<listOptionValue builtIn="false" value="TRACE_ENABLE"/>
<listOptionValue builtIn="false" value="N_BEST"/>
+<listOptionValue builtIn="false" value="_FILE_OFFSET_BITS=64"/>
+<listOptionValue builtIn="false" value="_LARGE_FILES"/>
</option>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.lib.release.22025776" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.lib.release"/>
diff --git a/moses/src/Arc.cpp b/moses/src/Arc.cpp
index a63e808a3..effaf49b2 100755
--- a/moses/src/Arc.cpp
+++ b/moses/src/Arc.cpp
@@ -55,3 +55,4 @@ std::ostream& operator<<(std::ostream& out, const Arc& arc)
return out;
}
+TO_STRING_BODY(Arc);
diff --git a/moses/src/Arc.h b/moses/src/Arc.h
index 40a03583d..31f680222 100755
--- a/moses/src/Arc.h
+++ b/moses/src/Arc.h
@@ -43,13 +43,17 @@ public:
{
}
+ ~Arc();
+
inline void SetMainHypo(const Hypothesis &hypo)
{
m_mainHypo = &hypo;
}
- ~Arc();
-
+
const std::vector<Arc*>* GetArcList() const;
+
+ TO_STRING;
+
};
std::ostream& operator<<(std::ostream& out, const Arc& arc);
diff --git a/moses/src/Factor.h b/moses/src/Factor.h
index 6f06257d0..72440b6d1 100755
--- a/moses/src/Factor.h
+++ b/moses/src/Factor.h
@@ -108,7 +108,7 @@ public:
return Compare(compare) < 0;
}
- TO_STRING
+ TO_STRING;
};
diff --git a/moses/src/FactorCollection.cpp b/moses/src/FactorCollection.cpp
index ba034ecf3..5cb022e3b 100755
--- a/moses/src/FactorCollection.cpp
+++ b/moses/src/FactorCollection.cpp
@@ -92,6 +92,8 @@ FactorCollection::~FactorCollection()
//}
}
+TO_STRING_BODY(FactorCollection);
+
// friend
ostream& operator<<(ostream& out, const FactorCollection& factorCollection)
{
diff --git a/moses/src/FactorCollection.h b/moses/src/FactorCollection.h
index f2900ac65..2f19e3bd2 100755
--- a/moses/src/FactorCollection.h
+++ b/moses/src/FactorCollection.h
@@ -54,5 +54,8 @@ public:
void SetFactorLmId(const Factor *factor, LmId lmId);
void LoadVocab(FactorDirection direction, FactorType factorType, const std::string &fileName);
+
+ TO_STRING;
+
};
diff --git a/moses/src/FactorTypeSet.cpp b/moses/src/FactorTypeSet.cpp
index 37bf2e29d..ee11aeb0a 100755
--- a/moses/src/FactorTypeSet.cpp
+++ b/moses/src/FactorTypeSet.cpp
@@ -32,3 +32,7 @@ FactorTypeSet::FactorTypeSet(const vector<FactorType> &factors)
Add(*iter);
}
}
+
+TO_STRING_BODY(FactorTypeSet);
+
+
diff --git a/moses/src/FactorTypeSet.h b/moses/src/FactorTypeSet.h
index 54678f113..792502785 100755
--- a/moses/src/FactorTypeSet.h
+++ b/moses/src/FactorTypeSet.h
@@ -78,6 +78,8 @@ public:
unsigned int value = static_cast<unsigned int>(factorType);
return (m_bit & (1 << value)) > 0;
}
+
+ TO_STRING;
};
// friend
diff --git a/moses/src/HypothesisCollection.cpp b/moses/src/HypothesisCollection.cpp
index b46a9fdc8..483ddf74b 100755
--- a/moses/src/HypothesisCollection.cpp
+++ b/moses/src/HypothesisCollection.cpp
@@ -213,6 +213,8 @@ void HypothesisCollection::InitializeArcs()
#endif
}
+TO_STRING_BODY(HypothesisCollection);
+
// friend
std::ostream& operator<<(std::ostream& out, const HypothesisCollection& hypoColl)
diff --git a/moses/src/HypothesisCollection.h b/moses/src/HypothesisCollection.h
index df650845a..40b9ba90e 100755
--- a/moses/src/HypothesisCollection.h
+++ b/moses/src/HypothesisCollection.h
@@ -58,7 +58,7 @@ public:
// static
static inline void SetMaxNGramOrder(FactorType factorType, size_t ngramMaxOrder)
{
- assert(factorType < NUM_FACTORS);
+ assert((size_t)factorType < NUM_FACTORS);
if (s_ngramMaxOrder[factorType] < ngramMaxOrder)
s_ngramMaxOrder[factorType] = ngramMaxOrder;
}
@@ -137,4 +137,7 @@ public:
const Hypothesis *GetBestHypothesis() const;
std::list<const Hypothesis*> GetSortedList() const;
void InitializeArcs();
+
+ TO_STRING;
+
};
diff --git a/moses/src/HypothesisCollectionIntermediate.cpp b/moses/src/HypothesisCollectionIntermediate.cpp
index 3402b2f75..c0b74013b 100755
--- a/moses/src/HypothesisCollectionIntermediate.cpp
+++ b/moses/src/HypothesisCollectionIntermediate.cpp
@@ -34,6 +34,8 @@ void HypothesisCollectionIntermediate::RemoveAll()
}
}
+TO_STRING_BODY(HypothesisCollectionIntermediate);
+
// sorting helper
struct HypothesisSort
{
diff --git a/moses/src/HypothesisCollectionIntermediate.h b/moses/src/HypothesisCollectionIntermediate.h
index 83acfd193..ae9a09a2e 100755
--- a/moses/src/HypothesisCollectionIntermediate.h
+++ b/moses/src/HypothesisCollectionIntermediate.h
@@ -55,5 +55,8 @@ public:
{
RemoveAll();
}
+
+ TO_STRING;
+
};
diff --git a/moses/src/Input.cpp b/moses/src/Input.cpp
index e2666d4a5..24be57c76 100644
--- a/moses/src/Input.cpp
+++ b/moses/src/Input.cpp
@@ -4,6 +4,8 @@
InputType::InputType(long translationId) : m_translationId(translationId) {}
InputType::~InputType() {}
+TO_STRING_BODY(InputType);
+
std::ostream& operator<<(std::ostream& out,InputType const& x)
{
x.Print(out); return out;
diff --git a/moses/src/Input.h b/moses/src/Input.h
index b90223d71..323f34da4 100644
--- a/moses/src/Input.h
+++ b/moses/src/Input.h
@@ -42,6 +42,9 @@ protected:
virtual Phrase GetSubString(const WordsRange&) const =0;
virtual const FactorArray& GetFactorArray(size_t pos) const=0;
+
+ TO_STRING;
+
};
std::ostream& operator<<(std::ostream&,InputType const&);
diff --git a/moses/src/LatticeEdge.cpp b/moses/src/LatticeEdge.cpp
index b59bc2637..c0ce8c407 100755
--- a/moses/src/LatticeEdge.cpp
+++ b/moses/src/LatticeEdge.cpp
@@ -89,3 +89,5 @@ void LatticeEdge::ResizeComponentScore(const LMList &allLM, const list < DecodeS
#endif
+TO_STRING_BODY(LatticeEdge);
+
diff --git a/moses/src/LatticeEdge.h b/moses/src/LatticeEdge.h
index be5994a53..d9c690d42 100755
--- a/moses/src/LatticeEdge.h
+++ b/moses/src/LatticeEdge.h
@@ -130,6 +130,9 @@ public:
void ResizeComponentScore(const LMList &allLM, const std::list < DecodeStep > &decodeStepList);
#endif
+
+ TO_STRING;
+
};
inline std::ostream& operator<<(std::ostream& out, const LatticeEdge& edge)
diff --git a/moses/src/LatticePath.cpp b/moses/src/LatticePath.cpp
index ad6bf0230..b4b3869c6 100755
--- a/moses/src/LatticePath.cpp
+++ b/moses/src/LatticePath.cpp
@@ -201,3 +201,5 @@ void LatticePath::CreateDeviantPaths(LatticePathCollection &pathColl) const
}
#endif
+TO_STRING_BODY(LatticePath);
+
diff --git a/moses/src/LatticePath.h b/moses/src/LatticePath.h
index 39d864ce7..b33dc75c4 100755
--- a/moses/src/LatticePath.h
+++ b/moses/src/LatticePath.h
@@ -97,6 +97,8 @@ public:
#endif
+ TO_STRING;
+
};
// friend
diff --git a/moses/src/Object.h b/moses/src/Object.h
index f9dcb8e77..ed3a4b460 100755
--- a/moses/src/Object.h
+++ b/moses/src/Object.h
@@ -29,14 +29,6 @@ class Object
friend std::ostream& operator<<(std::ostream&, const Object&);
public:
- virtual void ToStream(std::ostream &out) const = 0
-
- virtual std::string ToString() const
- {
- std::stringstream out;
- out << *this;
- return out.str();
- }
};
diff --git a/moses/src/Phrase.cpp b/moses/src/Phrase.cpp
index c299c8005..ff151c70d 100755
--- a/moses/src/Phrase.cpp
+++ b/moses/src/Phrase.cpp
@@ -346,6 +346,8 @@ bool Phrase::IsCompatible(const Phrase &inputPhrase) const
// return false;
//}
+TO_STRING_BODY(Phrase);
+
// friend
ostream& operator<<(ostream& out, const Phrase& phrase)
{
diff --git a/moses/src/Phrase.h b/moses/src/Phrase.h
index 4bd370b31..a327912f3 100755
--- a/moses/src/Phrase.h
+++ b/moses/src/Phrase.h
@@ -110,7 +110,7 @@ public:
std::string GetStringRep(const WordsRange &wordsRange);
- TO_STRING
+ TO_STRING;
// used to insert & find phrase in dictionary
bool operator< (const Phrase &compare) const;
diff --git a/moses/src/PhraseDictionary.cpp b/moses/src/PhraseDictionary.cpp
index 28384d42c..30ff9091b 100755
--- a/moses/src/PhraseDictionary.cpp
+++ b/moses/src/PhraseDictionary.cpp
@@ -252,6 +252,8 @@ bool PhraseDictionary::Contains(const vector< vector<string> > &phraseVector
return false;
}
+TO_STRING_BODY(PhraseDictionary);
+
// friend
ostream& operator<<(ostream& out, const PhraseDictionary& phraseDict)
{
diff --git a/moses/src/PhraseDictionary.h b/moses/src/PhraseDictionary.h
index bb8bf2f1a..e3df37e9b 100755
--- a/moses/src/PhraseDictionary.h
+++ b/moses/src/PhraseDictionary.h
@@ -103,5 +103,8 @@ public:
// for mert
void SetWeightTransModel(const std::vector<float> &weightT);
+
+ TO_STRING;
+
};
diff --git a/moses/src/SquareMatrix.cpp b/moses/src/SquareMatrix.cpp
index 21e65a118..347837f9b 100644
--- a/moses/src/SquareMatrix.cpp
+++ b/moses/src/SquareMatrix.cpp
@@ -8,12 +8,4 @@
using namespace std;
-std::string SquareMatrix::ToString()
-{
- for (size_t col = 0 ; col < m_size ; col++)
- {
- for (size_t row = 0 ; row < m_size ; row++)
- TRACE_ERR(GetScore(row, col) << " ");
- TRACE_ERR(endl);
- }
-} \ No newline at end of file
+TO_STRING_BODY(SquareMatrix);
diff --git a/moses/src/SquareMatrix.h b/moses/src/SquareMatrix.h
index 4acb8b6cc..cbb3de72c 100644
--- a/moses/src/SquareMatrix.h
+++ b/moses/src/SquareMatrix.h
@@ -21,11 +21,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#pragma once
+#include <iostream>
#include "TypeDef.h"
#include "Util.h"
class SquareMatrix
{
+ friend std::ostream& operator<<(std::ostream &out, const SquareMatrix &matrix);
protected:
const size_t m_size;
float *m_array;
@@ -43,6 +45,10 @@ public:
{
free(m_array);
}
+ inline float GetSize() const
+ {
+ return m_size;
+ }
inline float GetScore(size_t row, size_t col) const
{
return m_array[row * m_size + col];
@@ -52,6 +58,18 @@ public:
m_array[row * m_size + col] = value;
}
- std::string ToString();
+ TO_STRING;
};
+inline std::ostream& operator<<(std::ostream &out, const SquareMatrix &matrix)
+{
+ for (size_t col = 0 ; col < matrix.GetSize() ; col++)
+ {
+ for (size_t row = 0 ; row < matrix.GetSize() ; row++)
+ TRACE_ERR(matrix.GetScore(row, col) << " ");
+ TRACE_ERR(std::endl);
+ }
+
+ return out;
+}
+
diff --git a/moses/src/TargetPhrase.cpp b/moses/src/TargetPhrase.cpp
index 1ac9afbc2..72720e9d8 100644
--- a/moses/src/TargetPhrase.cpp
+++ b/moses/src/TargetPhrase.cpp
@@ -147,6 +147,8 @@ TargetPhrase *TargetPhrase::MergeNext(const TargetPhrase &inputPhrase) const
return clone;
}
+TO_STRING_BODY(TargetPhrase);
+
std::ostream& operator<<(std::ostream& os, const TargetPhrase& tp)
{
os << static_cast<const Phrase&>(tp) << ", pC=" << tp.m_transScore << ", c=" << tp.m_fullScore;
diff --git a/moses/src/TargetPhrase.h b/moses/src/TargetPhrase.h
index 02c90f14a..a3c64786c 100644
--- a/moses/src/TargetPhrase.h
+++ b/moses/src/TargetPhrase.h
@@ -90,6 +90,7 @@ public:
}
#endif
+ TO_STRING;
};
std::ostream& operator<<(std::ostream&, const TargetPhrase&);
diff --git a/moses/src/TranslationOption.cpp b/moses/src/TranslationOption.cpp
index ed48f6ac6..637e66928 100755
--- a/moses/src/TranslationOption.cpp
+++ b/moses/src/TranslationOption.cpp
@@ -168,6 +168,8 @@ void TranslationOption::CalcScore(const LMList &allLM, float weightWordPenalty)
m_futureScore += m_scoreTrans - phraseSize * weightWordPenalty;
}
+TO_STRING_BODY(TranslationOption);
+
// friend
ostream& operator<<(ostream& out, const TranslationOption& possibleTranslation)
{
diff --git a/moses/src/TranslationOption.h b/moses/src/TranslationOption.h
index 9d8b414d8..281181102 100755
--- a/moses/src/TranslationOption.h
+++ b/moses/src/TranslationOption.h
@@ -171,6 +171,7 @@ public:
}
#endif
+ TO_STRING;
};
diff --git a/moses/src/TranslationOptionCollection.cpp b/moses/src/TranslationOptionCollection.cpp
index ddb9df5ef..6238acc61 100644
--- a/moses/src/TranslationOptionCollection.cpp
+++ b/moses/src/TranslationOptionCollection.cpp
@@ -483,3 +483,6 @@ void TranslationOptionCollection::ProcessInitialTranslation(
}
}
}
+
+TO_STRING_BODY(TranslationOptionCollection);
+
diff --git a/moses/src/TranslationOptionCollection.h b/moses/src/TranslationOptionCollection.h
index 95466ce3b..f90467565 100755
--- a/moses/src/TranslationOptionCollection.h
+++ b/moses/src/TranslationOptionCollection.h
@@ -113,6 +113,8 @@ public:
, float weightWordPenalty);
void ComputeFutureScores(size_t verboseLevel);
+
+ TO_STRING;
};
inline std::ostream& operator<<(std::ostream& out, const TranslationOptionCollection& coll)
diff --git a/moses/src/Word.cpp b/moses/src/Word.cpp
index 22aa68a7b..9a36cc821 100755
--- a/moses/src/Word.cpp
+++ b/moses/src/Word.cpp
@@ -109,6 +109,8 @@ std::string Word::ToString(const FactorArray &factorArray)
return str;
}
+TO_STRING_BODY(Word);
+
// friend
ostream& operator<<(ostream& out, const Word& word)
{
diff --git a/moses/src/Word.h b/moses/src/Word.h
index 2d95950fc..691018e39 100755
--- a/moses/src/Word.h
+++ b/moses/src/Word.h
@@ -76,7 +76,7 @@ public:
return Compare(compare) < 0;
}
- TO_STRING
+ TO_STRING;
// FactorArray
static void Copy(FactorArray &target, const FactorArray &source);
diff --git a/moses/src/WordsBitmap.cpp b/moses/src/WordsBitmap.cpp
index ee9f21396..57741c7e3 100755
--- a/moses/src/WordsBitmap.cpp
+++ b/moses/src/WordsBitmap.cpp
@@ -20,3 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
#include "WordsBitmap.h"
+
+TO_STRING_BODY(WordsBitmap);
+
diff --git a/moses/src/WordsBitmap.h b/moses/src/WordsBitmap.h
index 1a8b93834..e4a2f8995 100755
--- a/moses/src/WordsBitmap.h
+++ b/moses/src/WordsBitmap.h
@@ -154,8 +154,11 @@ public:
return std::memcmp(m_bitmap, compare.m_bitmap, thisSize);
}
+
+ TO_STRING;
};
+
// friend
inline std::ostream& operator<<(std::ostream& out, const WordsBitmap& wordsBitmap)
{
diff --git a/moses/src/WordsRange.cpp b/moses/src/WordsRange.cpp
index 7cf2d2516..ff6d1662e 100644
--- a/moses/src/WordsRange.cpp
+++ b/moses/src/WordsRange.cpp
@@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "WordsRange.h"
+TO_STRING_BODY(WordsRange);
+
std::ostream& operator << (std::ostream& out, const WordsRange& range)
{
out << "[" << range.m_startPos << " -> " << range.m_endPos << "]" << std::endl;
diff --git a/moses/src/WordsRange.h b/moses/src/WordsRange.h
index f99879fb2..d1b2d1786 100755
--- a/moses/src/WordsRange.h
+++ b/moses/src/WordsRange.h
@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <iostream>
#include "TypeDef.h"
+#include "Util.h"
/***
* Efficient version of WordsBitmap for contiguous ranges
@@ -63,5 +64,7 @@ public:
return (m_startPos<x.m_startPos
|| (m_startPos==x.m_startPos && m_endPos<x.m_endPos));
}
+
+ TO_STRING;
};