summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdecoder/oracle_bleu.h2
-rw-r--r--decoder/sparse_vector.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/decoder/oracle_bleu.h b/decoder/oracle_bleu.h
index 550f438f..6708b02e 100755
--- a/decoder/oracle_bleu.h
+++ b/decoder/oracle_bleu.h
@@ -38,7 +38,7 @@ struct Translation {
out<<pre<<"features: "<<features<<std::endl;
}
bool is_null() {
- return features.size()==0 /* && sentence.size()==0 */;
+ return features.empty() /* && sentence.empty() */;
}
};
diff --git a/decoder/sparse_vector.h b/decoder/sparse_vector.h
index c6c57150..455a162b 100644
--- a/decoder/sparse_vector.h
+++ b/decoder/sparse_vector.h
@@ -255,6 +255,8 @@ public:
return values_.size() < other.values_.size();
}
+ int size() const { return values_.size(); }
+
int num_active() const { return values_.size(); }
bool empty() const { return values_.empty(); }