daily automatic beautifier

This commit is contained in:
MosesAdmin 2015-12-12 18:04:13 +00:00
parent d21f62b8a8
commit b0d8c397bb
15 changed files with 34 additions and 34 deletions

View File

@ -299,8 +299,8 @@ OutputSearchGraphAsHypergraph(std::ostream& out) const
void ChartManager::OutputSearchGraphMoses(std::ostream &outputSearchGraphStream) const
{
ChartSearchGraphWriterMoses writer(options(), &outputSearchGraphStream,
m_source.GetTranslationId());
ChartSearchGraphWriterMoses writer(options(), &outputSearchGraphStream,
m_source.GetTranslationId());
WriteSearchGraph(writer);
}

View File

@ -158,8 +158,8 @@ void ChartTranslationOptionList::ApplyThreshold(float const threshold)
scoreThreshold += threshold; // StaticData::Instance().GetTranslationOptionThreshold();
CollType::iterator bound = std::partition(m_collection.begin(),
m_collection.begin()+m_size,
ScoreThresholdPred(scoreThreshold));
m_collection.begin()+m_size,
ScoreThresholdPred(scoreThreshold));
m_size = std::distance(m_collection.begin(), bound);
}

View File

@ -283,7 +283,7 @@ CreateTranslationOptionCollection(ttasksptr const& ttask) const
// float translationOptionThreshold
// = ttask->options()->search.trans_opt_threshold;
TranslationOptionCollection *rv
= new TranslationOptionCollectionConfusionNet(ttask, *this);
= new TranslationOptionCollectionConfusionNet(ttask, *this);
//, maxNoTransOptPerCoverage, translationOptionThreshold);
assert(rv);
return rv;

View File

@ -144,7 +144,7 @@ public:
return m_avg_input_length;
}
void Load(AllOptions::ptr const& opts);
void Load(AllOptions::ptr const& opts);
private:
static std::vector<BleuScoreFeature*> s_staticColl;

View File

@ -56,7 +56,7 @@ void ConstrainedDecoding::Load(AllOptions::ptr const& opts)
for(size_t i = 0; i < m_paths.size(); ++i) {
InputFileStream constraintFile(m_paths[i]);
std::string line;
long sentenceID = opts->output.start_translation_id - 1 ;
long sentenceID = opts->output.start_translation_id - 1 ;
while (getline(constraintFile, line)) {
vector<string> vecStr = Tokenize(line, "\t");

View File

@ -49,16 +49,16 @@ const FFState* DistortionScoreProducer::EmptyHypothesisState(const InputType &in
NOT_FOUND);
}
float
float
DistortionScoreProducer::
CalculateDistortionScore(const Hypothesis& hypo,
const Range &prev, const Range &curr, const int FirstGap)
const Range &prev, const Range &curr, const int FirstGap)
{
// if(!StaticData::Instance().UseEarlyDistortionCost()) {
if(!hypo.GetManager().options()->reordering.use_early_distortion_cost) {
return - (float) hypo.GetInput().ComputeDistortionDistance(prev, curr);
} // else {
/* Pay distortion score as soon as possible, from Moore and Quirk MT Summit 2007
Definitions:
S : current source range

View File

@ -73,8 +73,8 @@ public:
class ChartSearchGraphWriterMoses : public virtual ChartSearchGraphWriter
{
public:
ChartSearchGraphWriterMoses(AllOptions::ptr const& opts,
std::ostream* out, size_t lineNumber)
ChartSearchGraphWriterMoses(AllOptions::ptr const& opts,
std::ostream* out, size_t lineNumber)
: ChartSearchGraphWriter(opts), m_out(out), m_lineNumber(lineNumber) {}
virtual void WriteHeader(size_t, size_t) const {
/* do nothing */
@ -91,7 +91,7 @@ private:
class ChartSearchGraphWriterHypergraph : public virtual ChartSearchGraphWriter
{
public:
ChartSearchGraphWriterHypergraph(AllOptions::ptr const& opts, std::ostream* out)
ChartSearchGraphWriterHypergraph(AllOptions::ptr const& opts, std::ostream* out)
: ChartSearchGraphWriter(opts), m_out(out), m_nodeId(0) { }
virtual void WriteHeader(size_t winners, size_t losers) const;
virtual void WriteHypos(const ChartHypothesisCollection& hypos,

View File

@ -257,7 +257,7 @@ Sentence::
CreateTranslationOptionCollection(ttasksptr const& ttask) const
{
TranslationOptionCollection *rv
= new TranslationOptionCollectionText(ttask, *this);
= new TranslationOptionCollectionText(ttask, *this);
assert(rv);
return rv;
}

View File

@ -440,7 +440,7 @@ LoadDecodeGraphsOld(const vector<string> &mappingVector,
UTIL_THROW_IF2(decodeStep == NULL, "Null decode step");
if (m_decodeGraphs.size() < decodeGraphInd + 1) {
DecodeGraph *decodeGraph;
if (is_syntax(m_options->search.algo)) {
if (is_syntax(m_options->search.algo)) {
size_t maxChartSpan = (decodeGraphInd < maxChartSpans.size()) ? maxChartSpans[decodeGraphInd] : DEFAULT_MAX_CHART_SPAN;
VERBOSE(1,"max-chart-span: " << maxChartSpans[decodeGraphInd] << endl);
decodeGraph = new DecodeGraph(m_decodeGraphs.size(), maxChartSpan);
@ -508,7 +508,7 @@ void StaticData::LoadDecodeGraphsNew(const std::vector<std::string> &mappingVect
UTIL_THROW_IF2(decodeStep == NULL, "Null decode step");
if (m_decodeGraphs.size() < decodeGraphInd + 1) {
DecodeGraph *decodeGraph;
if (is_syntax(m_options->search.algo)) {
if (is_syntax(m_options->search.algo)) {
size_t maxChartSpan = (decodeGraphInd < maxChartSpans.size()) ? maxChartSpans[decodeGraphInd] : DEFAULT_MAX_CHART_SPAN;
VERBOSE(1,"max-chart-span: " << maxChartSpans[decodeGraphInd] << endl);
decodeGraph = new DecodeGraph(m_decodeGraphs.size(), maxChartSpan);

View File

@ -84,9 +84,9 @@ public:
void
Load(std::string filePath);
static void
static void
SetStaticDefaultParameters(Parameter const& param);
};
}

View File

@ -70,8 +70,8 @@ void PhraseDictionaryCompact::Load(AllOptions::ptr const& opts)
if (!FileExists(tFilePath))
throw runtime_error("Error: File " + tFilePath + " does not exist.");
m_phraseDecoder
= new PhraseDecoder(*this, &m_input, &m_output, m_numScoreComponents);
m_phraseDecoder
= new PhraseDecoder(*this, &m_input, &m_output, m_numScoreComponents);
std::FILE* pFile = std::fopen(tFilePath.c_str() , "r");
@ -155,7 +155,7 @@ PhraseDictionaryCompact::
delete m_phraseDecoder;
}
void
void
PhraseDictionaryCompact::
CacheForCleanup(TargetPhraseCollection::shared_ptr tpc)
{
@ -164,12 +164,12 @@ CacheForCleanup(TargetPhraseCollection::shared_ptr tpc)
m_sentenceCache->push_back(tpc);
}
void
void
PhraseDictionaryCompact::
AddEquivPhrase(const Phrase &source, const TargetPhrase &targetPhrase)
AddEquivPhrase(const Phrase &source, const TargetPhrase &targetPhrase)
{ }
void
void
PhraseDictionaryCompact::
CleanUpAfterSentenceProcessing(const InputType &source)
{

View File

@ -20,11 +20,11 @@ namespace Moses
/** constructor; just initialize the base class */
TranslationOptionCollectionConfusionNet::
TranslationOptionCollectionConfusionNet(ttasksptr const& ttask,
TranslationOptionCollectionConfusionNet(ttasksptr const& ttask,
const ConfusionNet &input)
// , size_t maxNoTransOptPerCoverage, float translationOptionThreshold)
// , size_t maxNoTransOptPerCoverage, float translationOptionThreshold)
: TranslationOptionCollection(ttask,input)//
// , maxNoTransOptPerCoverage, translationOptionThreshold)
// , maxNoTransOptPerCoverage, translationOptionThreshold)
{
size_t maxNoTransOptPerCoverage = ttask->options()->search.max_trans_opt_per_cov;
float translationOptionThreshold = ttask->options()->search.trans_opt_threshold;

View File

@ -36,7 +36,7 @@ protected:
public:
TranslationOptionCollectionConfusionNet
(ttasksptr const& ttask, const ConfusionNet &source);
(ttasksptr const& ttask, const ConfusionNet &source);
// , size_t maxNoTransOptPerCoverage, float translationOptionThreshold);
void ProcessUnknownWord(size_t sourcePos);

View File

@ -22,9 +22,9 @@ namespace Moses
TranslationOptionCollectionLattice
::TranslationOptionCollectionLattice
( ttasksptr const& ttask, const WordLattice &input)
// , size_t maxNoTransOptPerCoverage, float translationOptionThreshold)
// , size_t maxNoTransOptPerCoverage, float translationOptionThreshold)
: TranslationOptionCollection(ttask, input)//
// , maxNoTransOptPerCoverage, translationOptionThreshold)
// , maxNoTransOptPerCoverage, translationOptionThreshold)
{
UTIL_THROW_IF2(StaticData::Instance().GetUseLegacyPT(),
"Not for models using the legqacy binary phrase table");

View File

@ -35,14 +35,14 @@ namespace Moses
/** constructor; just initialize the base class */
TranslationOptionCollectionText::
TranslationOptionCollectionText(ttasksptr const& ttask, Sentence const &input)
//, size_t maxNoTransOptPerCoverage, float translationOptionThreshold)
//, size_t maxNoTransOptPerCoverage, float translationOptionThreshold)
: TranslationOptionCollection(ttask,input)
// , maxNoTransOptPerCoverage, translationOptionThreshold)
// , maxNoTransOptPerCoverage, translationOptionThreshold)
{
size_t maxNoTransOptPerCoverage
= ttask->options()->search.max_trans_opt_per_cov;
= ttask->options()->search.max_trans_opt_per_cov;
float translationOptionThreshold
= ttask->options()->search.trans_opt_threshold;
= ttask->options()->search.trans_opt_threshold;
size_t size = input.GetSize();
m_inputPathMatrix.resize(size);
for (size_t phaseSize = 1; phaseSize <= size; ++phaseSize) {