diff --git a/misc/processLexicalTableMin.cpp b/misc/processLexicalTableMin.cpp index cee984bad..2aebaacfc 100644 --- a/misc/processLexicalTableMin.cpp +++ b/misc/processLexicalTableMin.cpp @@ -15,15 +15,15 @@ void printHelp(char **argv) "options: \n" "\t-in string -- input table file name\n" "\t-out string -- prefix of binary table file\n" +#ifdef WITH_THREADS + "\t-threads int -- number of threads used for conversion\n" +#endif "\nadvanced:\n" "\t-landmark int -- use landmark phrase every 2^n phrases\n" "\t-fingerprint int -- number of bits used for phrase fingerprints\n" "\t-join-scores -- single set of Huffman codes for score components\n" "\t-quantize int -- maximum number of scores per score component\n" -#ifdef WITH_THREADS - "\t-threads int -- number of threads used for conversion\n" -#endif - "\n\n" + "\n" " For more information see: http://www.statmt.org/moses/...\n" " and\n\n" diff --git a/misc/processPhraseTableMin.cpp b/misc/processPhraseTableMin.cpp index 1181eccc6..60c71480d 100644 --- a/misc/processPhraseTableMin.cpp +++ b/misc/processPhraseTableMin.cpp @@ -10,20 +10,19 @@ void printHelp(char **argv) { "options: \n" "\t-in string -- input table file name\n" "\t-out string -- prefix of binary table file\n" - "\t-encoding string -- Encoding type (PREnc REnc None)\n" - "\t-maxrank int -- Maximum rank for PREnc\n" "\t-nscores int -- number of score components in phrase table\n" "\t-alignment-info -- include alignment info in the binary phrase table\n" +#ifdef WITH_THREADS + "\t-threads int -- number of threads used for conversion\n" +#endif "\nadvanced:\n" + "\t-encoding string -- Encoding type (PREnc REnc None)\n" + "\t-maxrank int -- Maximum rank for PREnc\n" "\t-landmark int -- use landmark phrase every 2^n source phrases\n" "\t-fingerprint int -- number of bits used for source phrase fingerprints\n" "\t-join-scores -- single set of Huffman codes for score components\n" "\t-quantize int -- maximum number of scores per score component\n" - -#ifdef WITH_THREADS - "\t-threads int -- number of threads used for conversion\n" -#endif - "\n\n" + "\n" " For more information see: http://www.statmt.org/moses/...\n" " and\n\n" diff --git a/moses/src/CompactPT/CanonicalHuffman.h b/moses/src/CompactPT/CanonicalHuffman.h index 84790e521..f145e8527 100644 --- a/moses/src/CompactPT/CanonicalHuffman.h +++ b/moses/src/CompactPT/CanonicalHuffman.h @@ -271,7 +271,7 @@ class BitStream public: BitStream(Container &data) - : m_data(data), m_iterator(m_data.begin()), + : m_data(data), m_iterator(m_data.begin()), m_currentValue(0), m_valueBits(sizeof(typename Container::value_type) * 8), m_mask(1), m_bitPos(0) { } diff --git a/moses/src/CompactPT/Jamfile b/moses/src/CompactPT/Jamfile index 22db312ce..a2e94d5ae 100644 --- a/moses/src/CompactPT/Jamfile +++ b/moses/src/CompactPT/Jamfile @@ -1,4 +1,5 @@ local with-cmph = [ option.get "with-cmph" ] ; -lib CompactPT : [ glob *.cpp ] ..//moses_internal $(with-cmph)/src/libcmph.a - : $(with-cmph)/src/ +lib cmph : : $(with-cmph)/lib ; +lib CompactPT : [ glob *.cpp ] ..//moses_internal cmph + : $(with-cmph)/include ; diff --git a/moses/src/CompactPT/LexicalReorderingTableCreator.cpp b/moses/src/CompactPT/LexicalReorderingTableCreator.cpp index 811631a72..2d112091c 100644 --- a/moses/src/CompactPT/LexicalReorderingTableCreator.cpp +++ b/moses/src/CompactPT/LexicalReorderingTableCreator.cpp @@ -31,8 +31,8 @@ LexicalReorderingTableCreator::LexicalReorderingTableCreator( , size_t threads #endif ) - : m_inPath(inPath), m_outPath(outPath), m_numScoreComponent(numScoreComponent), - m_orderBits(orderBits), m_fingerPrintBits(fingerPrintBits), + : m_inPath(inPath), m_outPath(outPath), m_orderBits(orderBits), + m_fingerPrintBits(fingerPrintBits), m_numScoreComponent(numScoreComponent), m_multipleScoreTrees(multipleScoreTrees), m_quantize(quantize), m_separator(" ||| "), m_hash(m_orderBits, m_fingerPrintBits), m_lastFlushedLine(-1) diff --git a/moses/src/CompactPT/LexicalReorderingTableCreator.h b/moses/src/CompactPT/LexicalReorderingTableCreator.h index 2ee14ef81..e3fff8e52 100644 --- a/moses/src/CompactPT/LexicalReorderingTableCreator.h +++ b/moses/src/CompactPT/LexicalReorderingTableCreator.h @@ -45,10 +45,6 @@ class LexicalReorderingTableCreator { BlockHashIndex m_hash; -#ifdef WITH_THREADS - size_t m_threads; -#endif - typedef Counter ScoreCounter; typedef CanonicalHuffman ScoreTree; @@ -64,6 +60,10 @@ class LexicalReorderingTableCreator { std::string m_lastFlushedSourcePhrase; std::vector m_lastRange; +#ifdef WITH_THREADS + size_t m_threads; +#endif + void PrintInfo(); void EncodeScores(); diff --git a/moses/src/CompactPT/PhraseTableCreator.cpp b/moses/src/CompactPT/PhraseTableCreator.cpp index a787802e8..04405a3f2 100644 --- a/moses/src/CompactPT/PhraseTableCreator.cpp +++ b/moses/src/CompactPT/PhraseTableCreator.cpp @@ -26,6 +26,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA namespace Moses { +bool operator<(const PackedItem &pi1, const PackedItem &pi2) +{ + if(pi1.GetLine() < pi2.GetLine()) + return false; + return true; +} + std::string PhraseTableCreator::m_phraseStopSymbol = "__SPECIAL_STOP_SYMBOL__"; std::string PhraseTableCreator::m_separator = " ||| "; diff --git a/moses/src/CompactPT/PhraseTableCreator.h b/moses/src/CompactPT/PhraseTableCreator.h index dc5fc3f1f..0c3e4ad9f 100644 --- a/moses/src/CompactPT/PhraseTableCreator.h +++ b/moses/src/CompactPT/PhraseTableCreator.h @@ -186,11 +186,7 @@ class PackedItem float GetScore() const; }; -static bool operator<(const PackedItem &pi1, const PackedItem &pi2) { - if(pi1.GetLine() < pi2.GetLine()) - return false; - return true; -} +bool operator<(const PackedItem &pi1, const PackedItem &pi2); class PhraseTableCreator {