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-07-04 18:13:29 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-07-04 18:13:29 +0400
commitf0dc30f25ab318535e92f2b7520a9ed2f0c6da77 (patch)
tree5fba8bb932bfa2f52ba56ef67921dc4c74eb9f9c /moses/Word.cpp
parent934e24718e5feb1349609e5d429cb4b1acdd6823 (diff)
prefix subphrase optimization done for in-memory pt. Need to delete objects also
Diffstat (limited to 'moses/Word.cpp')
-rw-r--r--moses/Word.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/moses/Word.cpp b/moses/Word.cpp
index 41e5fae03..f53e8a2c7 100644
--- a/moses/Word.cpp
+++ b/moses/Word.cpp
@@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "memory.h"
#include "Word.h"
#include "TypeDef.h"
+#include "FactorTypeSet.h"
#include "StaticData.h" // needed to determine the FactorDelimiter
#include "util/exception.hh"
#include "util/tokenize_piece.hh"
@@ -127,6 +128,15 @@ void Word::CreateUnknownWord(const Word &sourceWord)
m_isNonTerminal = sourceWord.IsNonTerminal();
}
+void Word::OnlyTheseFactors(const FactorMask &factors)
+{
+ for (unsigned int currFactor = 0 ; currFactor < MAX_NUM_FACTORS ; currFactor++) {
+ if (!factors[currFactor]) {
+ SetFactor(currFactor, NULL);
+ }
+ }
+}
+
TO_STRING_BODY(Word);
// friend