daily automatic beautifier

This commit is contained in:
MosesAdmin 2015-06-04 13:41:46 +01:00
parent 0e11919ffb
commit 5696a59ae4
20 changed files with 117 additions and 118 deletions

View File

@ -67,7 +67,9 @@ private:
protected:
/// For child classes only: retrieve filebuf.
__gnu_cxx::stdio_filebuf<char> *get_filebuf() { return _filebuf; }
__gnu_cxx::stdio_filebuf<char> *get_filebuf() {
return _filebuf;
}
};
class ifdstream : public _fdstream

View File

@ -303,8 +303,7 @@ ReadInput()
boost::lock_guard<boost::mutex> lock(m_lock);
#endif
boost::shared_ptr<InputType> source = GetBufferedInput();
if (source)
{
if (source) {
source->SetTranslationId(m_currentLine++);
if (m_look_ahead || m_look_back)
this->set_context_for(*source);

View File

@ -621,8 +621,7 @@ bool StaticData::LoadData(Parameter *parameter)
#ifdef HAVE_PROTOBUF
|| m_outputSearchGraphPB
#endif
|| m_latticeSamplesFilePath.size())
{
|| m_latticeSamplesFilePath.size()) {
m_nbest_options.enabled = true;
}

View File

@ -1,6 +1,7 @@
#include "BookkeepingOptions.h"
namespace Moses {
namespace Moses
{
bool
BookkeepingOptions::
init(Parameter const& P)
@ -8,8 +9,7 @@ namespace Moses {
bool& x = need_alignment_info;
P.SetParameter(x, "print-alignment-info", false);
if (!x) P.SetParameter(x, "print-alignment-info-in-n-best", false);
if (!x)
{
if (!x) {
PARAM_VEC const* params = P.GetParam("alignment-output-file");
x = params && params->size();
}

View File

@ -2,10 +2,10 @@
#include "moses/Parameter.h"
// #include <string>
namespace Moses {
struct BookkeepingOptions
namespace Moses
{
struct BookkeepingOptions {
bool need_alignment_info;
bool init(Parameter const& param);
};

View File

@ -2,7 +2,8 @@
#include "moses/Parameter.h"
#include "NBestOptions.h"
namespace Moses {
namespace Moses
{
bool
NBestOptions::
@ -10,21 +11,16 @@ init(Parameter const& P)
{
const PARAM_VEC *params;
params = P.GetParam("n-best-list");
if (params)
{
if (params->size() >= 2)
{
if (params) {
if (params->size() >= 2) {
output_file_path = params->at(0);
nbest_size = Scan<size_t>( params->at(1) );
only_distinct = (params->size()>2 && params->at(2)=="distinct");
}
else
{
} else {
std::cerr << "wrong format for switch -n-best-list file size [disinct]";
return false;
}
}
else nbest_size = 0;
} else nbest_size = 0;
P.SetParameter<size_t>(factor, "n-best-factor", 20);
P.SetParameter(include_alignment_info, "print-alignment-info-in-n-best", false );

View File

@ -1,10 +1,10 @@
// -*- mode: c++; cc-style: gnu -*-
#include <string>
namespace Moses {
struct NBestOptions
namespace Moses
{
struct NBestOptions {
size_t nbest_size;
size_t factor;
bool enabled;

View File

@ -22,7 +22,8 @@
#include <map>
#include <string>
namespace MosesTraining {
namespace MosesTraining
{
struct SyntaxNode {
typedef std::map<std::string, std::string> AttributeMap;

View File

@ -51,7 +51,9 @@ public:
const std::vector< SyntaxNode* >& GetNodes( int startPos, int endPos ) const;
//! Get a vector of pointers to all SyntaxNodes (unordered).
const std::vector< SyntaxNode* >& GetAllNodes() { return m_nodes; };
const std::vector< SyntaxNode* >& GetAllNodes() {
return m_nodes;
};
size_t GetNumWords() const {
return m_numWords;