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
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2013-05-30 21:34:10 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-05-30 21:34:10 +0400
commit117eb76b0a0eb9563028206a547f8bf3e6e43fb2 (patch)
tree2906efdf0370cc520bd6c4f0d16205ff71f0685f /moses/FactorTypeSet.cpp
parentf83622b0b76244964371ca7753a44d711d02c42a (diff)
figure out which feature function to apply at which decode step. Book-keeping
Diffstat (limited to 'moses/FactorTypeSet.cpp')
-rw-r--r--moses/FactorTypeSet.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/moses/FactorTypeSet.cpp b/moses/FactorTypeSet.cpp
index de2166ba2..44379e9f8 100644
--- a/moses/FactorTypeSet.cpp
+++ b/moses/FactorTypeSet.cpp
@@ -33,6 +33,19 @@ FactorMask::FactorMask(const vector<FactorType> &factors)
}
}
+bool FactorMask::IsUseable(const FactorMask &other) const
+{
+ for (size_t i = 0; i < other.size(); ++i) {
+ if (other[i]) {
+ if (!this->operator[](i) ) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
TO_STRING_BODY(FactorMask);
// friend