mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
Merge ../mosesdecoder into merge-cmd
This commit is contained in:
commit
65c016667e
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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::ofstream *m_alignmentInfoStream;
|
||||
std::ostream *m_unknownsStream;
|
||||
std::ostream *m_outputSearchGraphStream;
|
||||
std::ofstream *m_latticeSamplesStream;
|
||||
std::ostream *m_unknownsStream;
|
||||
std::ostream *m_detailedTreeFragmentsTranslationReportingStream;
|
||||
|
||||
bool m_surpressSingleBestOutput;
|
||||
std::ofstream *m_alignmentInfoStream;
|
||||
std::ofstream *m_latticeSamplesStream;
|
||||
|
||||
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;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
/***
|
||||
|
10
moses/Util.h
10
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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user