Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mert
diff options
context:
space:
mode:
authorNicola Bertoldi <bertoldi@fbk.eu>2014-01-15 19:49:57 +0400
committerNicola Bertoldi <bertoldi@fbk.eu>2014-01-15 19:49:57 +0400
commite452a13062400b09ff95af971c1424ac34cf1930 (patch)
tree11b52a2f1228f4e64fb31d061d7e564970140fd7 /mert
parentbd83999264407dd7970736ee3e70a6b39fb19014 (diff)
beautify
Diffstat (limited to 'mert')
-rw-r--r--mert/Data.cpp8
-rw-r--r--mert/Optimizer.cpp20
-rw-r--r--mert/Point.cpp4
-rw-r--r--mert/Scorer.cpp4
4 files changed, 18 insertions, 18 deletions
diff --git a/mert/Data.cpp b/mert/Data.cpp
index 095b26041..b93c3b6c0 100644
--- a/mert/Data.cpp
+++ b/mert/Data.cpp
@@ -263,13 +263,13 @@ void Data::createShards(size_t shard_count, float shard_size, const string& scor
{
UTIL_THROW_IF(shard_count == 0, util::Exception, "Must have at least 1 shard");
UTIL_THROW_IF(shard_size < 0 || shard_size > 1,
- util::Exception,
- "Shard size must be between 0 and 1, inclusive. Currently " << shard_size);
+ util::Exception,
+ "Shard size must be between 0 and 1, inclusive. Currently " << shard_size);
size_t data_size = m_score_data->size();
UTIL_THROW_IF(data_size != m_feature_data->size(),
- util::Exception,
- "Error");
+ util::Exception,
+ "Error");
shard_size *= data_size;
const float coeff = static_cast<float>(data_size) / shard_count;
diff --git a/mert/Optimizer.cpp b/mert/Optimizer.cpp
index 3f5aa48a6..5da32363f 100644
--- a/mert/Optimizer.cpp
+++ b/mert/Optimizer.cpp
@@ -168,8 +168,8 @@ statscore_t Optimizer::LineOptimize(const Point& origin, const Point& direction,
// The rightmost bestindex is the one with the highest slope.
// They should be equal but there might be.
- UTIL_THROW_IF(abs(leftmost->first-gradient.rbegin()->first) >= 0.0001,
- util::Exception, "Error");
+ UTIL_THROW_IF(abs(leftmost->first-gradient.rbegin()->first) >= 0.0001,
+ util::Exception, "Error");
// A small difference due to rounding error
break;
}
@@ -191,8 +191,8 @@ statscore_t Optimizer::LineOptimize(const Point& origin, const Point& direction,
if (tit == previnserted) {
// The threshold is the same as before can happen if 2 candidates are the same for example.
UTIL_THROW_IF(previnserted->second.back().first != newd.first,
- util::Exception,
- "Error");
+ util::Exception,
+ "Error");
previnserted->second.back()=newd; // just replace the 1 best for sentence S
// previnsert doesn't change
} else {
@@ -207,8 +207,8 @@ statscore_t Optimizer::LineOptimize(const Point& origin, const Point& direction,
// We append the diffs in previnsert to tit before destroying previnsert.
tit->second.insert(tit->second.end(),previnserted->second.begin(),previnserted->second.end());
UTIL_THROW_IF(tit->second.back().first != newd.first,
- util::Exception,
- "Error");
+ util::Exception,
+ "Error");
tit->second.back()=newd; // change diff for sentence S
thresholdmap.erase(previnserted); // erase old previnsert
previnserted = tit; // point previnsert to the new threshold
@@ -216,8 +216,8 @@ statscore_t Optimizer::LineOptimize(const Point& origin, const Point& direction,
}
UTIL_THROW_IF(previnserted == thresholdmap.end(),
- util::Exception,
- "Error");
+ util::Exception,
+ "Error");
} else { //normal insertion process
previnserted = AddThreshold(thresholdmap, leftmostx, newd);
}
@@ -254,8 +254,8 @@ statscore_t Optimizer::LineOptimize(const Point& origin, const Point& direction,
// We skipped the first el of thresholdlist but GetIncStatScore return 1 more for first1best.
UTIL_THROW_IF(scores.size() != thresholdmap.size(),
- util::Exception,
- "Error");
+ util::Exception,
+ "Error");
for (unsigned int sc = 0; sc != scores.size(); sc++) {
//cerr << "x=" << thrit->first << " => " << scores[sc] << endl;
diff --git a/mert/Point.cpp b/mert/Point.cpp
index 1db59ce66..55dc6a6b2 100644
--- a/mert/Point.cpp
+++ b/mert/Point.cpp
@@ -40,8 +40,8 @@ Point::Point(const vector<parameter_t>& init,
m_max[i] = max[i];
}
} else {
- UTIL_THROW_IF(init.size() != m_pdim, util::Exception, "Error");
- UTIL_THROW_IF(m_opt_indices.size() != Point::m_dim, util::Exception, "Error");
+ UTIL_THROW_IF(init.size() != m_pdim, util::Exception, "Error");
+ UTIL_THROW_IF(m_opt_indices.size() != Point::m_dim, util::Exception, "Error");
for (unsigned int i = 0; i < Point::m_dim; i++) {
operator[](i) = init[m_opt_indices[i]];
m_min[i] = min[m_opt_indices[i]];
diff --git a/mert/Scorer.cpp b/mert/Scorer.cpp
index ed3ff2458..ffaf03be4 100644
--- a/mert/Scorer.cpp
+++ b/mert/Scorer.cpp
@@ -25,9 +25,9 @@ const int kUnknownToken = -1;
Scorer::Scorer(const string& name, const string& config)
: m_name(name),
m_vocab(mert::VocabularyFactory::GetVocabulary()),
- #if defined(__GLIBCXX__) || defined(__GLIBCPP__)
+#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
m_filter(NULL),
- #endif
+#endif
m_score_data(NULL),
m_enable_preserve_case(true)
{