diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-05 21:29:37 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-05 21:29:37 +0300 |
commit | 65c016667e051e29b93ee6398adcfa72eefe1186 (patch) | |
tree | f2946dabe1cba266f2f7d17977ff3145abd43f56 | |
parent | 23ca29a2ea13bfa12210f4f278785aefdd45a672 (diff) | |
parent | c52f4d3e7532ae93326e87cd9204a05bdf84c843 (diff) |
Merge ../mosesdecoder into merge-cmd
-rw-r--r-- | moses/FF/FeatureFunction.cpp | 4 | ||||
-rw-r--r-- | moses/FF/PhraseOrientationFeature.cpp | 6 | ||||
-rw-r--r-- | moses/FF/SoftSourceSyntacticConstraintsFeature.cpp | 2 | ||||
-rw-r--r-- | moses/IOWrapper.h | 18 | ||||
-rw-r--r-- | moses/LM/IRST.cpp | 1 | ||||
-rw-r--r-- | moses/Timer.cpp | 11 | ||||
-rw-r--r-- | moses/Util.h | 10 | ||||
-rw-r--r-- | scripts/share/nonbreaking_prefixes/nonbreaking_prefix.en | 14 |
8 files changed, 38 insertions, 28 deletions
diff --git a/moses/FF/FeatureFunction.cpp b/moses/FF/FeatureFunction.cpp index 4b5faa91e..62f9437ac 100644 --- a/moses/FF/FeatureFunction.cpp +++ b/moses/FF/FeatureFunction.cpp @@ -45,7 +45,7 @@ void FeatureFunction::CallChangeSource(InputType *&input) FeatureFunction:: FeatureFunction(const std::string& line) : m_tuneable(true) - , m_verbosity(1) + , m_verbosity(std::numeric_limits<std::size_t>::max()) , m_numScoreComponents(1) { Initialize(line); @@ -55,7 +55,7 @@ FeatureFunction:: FeatureFunction(size_t numScoreComponents, const std::string& line) : m_tuneable(true) - , m_verbosity(0) + , m_verbosity(std::numeric_limits<std::size_t>::max()) , m_numScoreComponents(numScoreComponents) { Initialize(line); diff --git a/moses/FF/PhraseOrientationFeature.cpp b/moses/FF/PhraseOrientationFeature.cpp index 4e2a8c637..0727330c0 100644 --- a/moses/FF/PhraseOrientationFeature.cpp +++ b/moses/FF/PhraseOrientationFeature.cpp @@ -40,11 +40,7 @@ PhraseOrientationFeature::PhraseOrientationFeature(const std::string &line) void PhraseOrientationFeature::SetParameter(const std::string& key, const std::string& value) { - if (key == "tuneable") - { - m_tuneable = Scan<bool>(value); - } - else if (key == "glueTargetLHS") + if (key == "glueTargetLHS") { m_glueTargetLHSStr = value; } diff --git a/moses/FF/SoftSourceSyntacticConstraintsFeature.cpp b/moses/FF/SoftSourceSyntacticConstraintsFeature.cpp index fe1144465..39156b09a 100644 --- a/moses/FF/SoftSourceSyntacticConstraintsFeature.cpp +++ b/moses/FF/SoftSourceSyntacticConstraintsFeature.cpp @@ -35,8 +35,6 @@ void SoftSourceSyntacticConstraintsFeature::SetParameter(const std::string& key, m_coreSourceLabelSetFile = value; } else if (key == "targetSourceLeftHandSideJointCountFile") { m_targetSourceLHSJointCountFile = value; - } else if (key == "tuneable") { - m_tuneable = Scan<bool>(value); } else if (key == "featureVariant") { m_featureVariant = Scan<size_t>(value); // 0: only dense features, 1: no mismatches (also set weights 1 0 0 and tuneable=false), 2: with sparse features, 3: with sparse features for core labels only } else { diff --git a/moses/IOWrapper.h b/moses/IOWrapper.h index 59af4600d..9bcd387d8 100644 --- a/moses/IOWrapper.h +++ b/moses/IOWrapper.h @@ -75,20 +75,18 @@ protected: const std::vector<Moses::FactorType> *m_inputFactorOrder; const std::vector<Moses::FactorType> *m_outputFactorOrder; - Moses::FactorMask m_inputFactorUsed; - std::string m_inputFilePath; - Moses::InputFileStream *m_inputFile; - std::istream *m_inputStream; + Moses::FactorMask m_inputFactorUsed; + std::string m_inputFilePath; + Moses::InputFileStream *m_inputFile; + std::istream *m_inputStream; std::ostream *m_nBestStream; std::ostream *m_outputWordGraphStream; + std::ostream *m_outputSearchGraphStream; std::ostream *m_detailedTranslationReportingStream; + std::ostream *m_unknownsStream; + std::ostream *m_detailedTreeFragmentsTranslationReportingStream; std::ofstream *m_alignmentInfoStream; - std::ostream *m_unknownsStream; - std::ostream *m_outputSearchGraphStream; std::ofstream *m_latticeSamplesStream; - std::ostream *m_detailedTreeFragmentsTranslationReportingStream; - - bool m_surpressSingleBestOutput; Moses::OutputCollector *m_singleBestOutputCollector; Moses::OutputCollector *m_nBestOutputCollector; @@ -100,6 +98,8 @@ protected: Moses::OutputCollector *m_latticeSamplesCollector; Moses::OutputCollector *m_detailTreeFragmentsOutputCollector; + bool m_surpressSingleBestOutput; + // CHART typedef std::vector<std::pair<Moses::Word, Moses::WordsRange> > ApplicationContext; diff --git a/moses/LM/IRST.cpp b/moses/LM/IRST.cpp index 44c5d8c4c..88a38d283 100644 --- a/moses/LM/IRST.cpp +++ b/moses/LM/IRST.cpp @@ -41,6 +41,7 @@ namespace Moses { LanguageModelIRST::LanguageModelIRST(const std::string &line) :LanguageModelSingleFactor(line) + ,m_lmtb_dub(0) { const StaticData &staticData = StaticData::Instance(); int threadCount = staticData.ThreadCount(); diff --git a/moses/Timer.cpp b/moses/Timer.cpp index 75f4154ec..fbe5fcab6 100644 --- a/moses/Timer.cpp +++ b/moses/Timer.cpp @@ -2,6 +2,7 @@ #include <iomanip> #include "Util.h" #include "Timer.h" +#include "StaticData.h" #include "util/usage.hh" @@ -30,7 +31,7 @@ double Timer::get_elapsed_time() const void Timer::start(const char* msg) { // Print an optional message, something like "Starting timer t"; - if (msg) TRACE_ERR( msg << std::endl); + if (msg) VERBOSE(1, msg << std::endl); // Return immediately if the timer is already running if (running && !stopped) return; @@ -53,7 +54,7 @@ void Timer::start(const char* msg) void Timer::stop(const char* msg) { // Print an optional message, something like "Stopping timer t"; - if (msg) TRACE_ERR( msg << std::endl); + if (msg) VERBOSE(1, msg << std::endl); // Return immediately if the timer is not running if (stopped || !running) return; @@ -71,10 +72,10 @@ void Timer::stop(const char* msg) void Timer::check(const char* msg) { // Print an optional message, something like "Checking timer t"; - if (msg) TRACE_ERR( msg << " : "); + if (msg) VERBOSE(1, msg << " : "); -// TRACE_ERR( "[" << std::setiosflags(std::ios::fixed) << std::setprecision(2) << (running ? elapsed_time() : 0) << "] seconds\n"); - TRACE_ERR( "[" << (running ? get_elapsed_time() : 0) << "] seconds\n"); +// VERBOSE(1, "[" << std::setiosflags(std::ios::fixed) << std::setprecision(2) << (running ? elapsed_time() : 0) << "] seconds\n"); + VERBOSE(1, "[" << (running ? get_elapsed_time() : 0) << "] seconds\n"); } /*** diff --git a/moses/Util.h b/moses/Util.h index ca34fcfb0..61db1bf27 100644 --- a/moses/Util.h +++ b/moses/Util.h @@ -57,13 +57,13 @@ namespace Moses /** verbose macros * */ -#define VERBOSE(level,str) { if (StaticData::Instance().GetVerboseLevel() >= level) { TRACE_ERR(str); } } +#define VERBOSE(level,str) { IFVERBOSE(level) { TRACE_ERR(str); } } #define IFVERBOSE(level) if (StaticData::Instance().GetVerboseLevel() >= level) -#define XVERBOSE(level,str) { if (StaticData::Instance().GetVerboseLevel() >= level) { TRACE_ERR("[" << __FILE__ << ":" << __LINE__ << "] "); TRACE_ERR(str); } } +#define XVERBOSE(level,str) VERBOSE(level, "[" << HERE << "] " << str) #define HERE __FILE__ << ":" << __LINE__ -#define FEATUREVERBOSE(level,str) { if (m_verbosity >= level) { TRACE_ERR("[" << GetScoreProducerDescription() << "] "); FEATUREVERBOSE2(level,str); } } -#define FEATUREVERBOSE2(level,str) { if (m_verbosity >= level) { TRACE_ERR(str); } } -#define IFFEATUREVERBOSE(level) if (m_verbosity >= level) +#define FEATUREVERBOSE(level,str) FEATUREVERBOSE2(level, "[" << GetScoreProducerDescription() << "] " << str) +#define FEATUREVERBOSE2(level,str) { IFFEATUREVERBOSE(level) { TRACE_ERR(str); } } +#define IFFEATUREVERBOSE(level) if ((m_verbosity == std::numeric_limits<std::size_t>::max() && StaticData::Instance().GetVerboseLevel() >= level) || (m_verbosity != std::numeric_limits<std::size_t>::max() && m_verbosity >= level)) #if __GNUC__ == 4 && __GNUC_MINOR__ == 8 && (__GNUC_PATCHLEVEL__ == 1 || __GNUC_PATCHLEVEL__ == 2) diff --git a/scripts/share/nonbreaking_prefixes/nonbreaking_prefix.en b/scripts/share/nonbreaking_prefixes/nonbreaking_prefix.en index e1a3733b5..43770db14 100644 --- a/scripts/share/nonbreaking_prefixes/nonbreaking_prefix.en +++ b/scripts/share/nonbreaking_prefixes/nonbreaking_prefix.en @@ -105,3 +105,17 @@ Nos Art #NUMERIC_ONLY# Nr pp #NUMERIC_ONLY# + +#month abbreviations +Jan +Feb +Mar +Apr +May +Jun +Jul +Aug +Sep +Oct +Nov +Dec |