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:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-03-30 03:20:17 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-03-30 03:20:17 +0300
commitfcbfc5a535522328cd9c7abfc7f0680d93c3c9f4 (patch)
tree3c6c00c783fb098e1448c6c8ed4740c77431efae /moses/TranslationOptionCollectionConfusionNet.cpp
parent79cd40d2c487179565bdd05947cb11c996c3ce14 (diff)
Feature functions and the constructors of TranslationOptionCollections
now have access to the current translation task. This was done to allow context-sensitive processing (if provided by the FF).
Diffstat (limited to 'moses/TranslationOptionCollectionConfusionNet.cpp')
-rw-r--r--moses/TranslationOptionCollectionConfusionNet.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/moses/TranslationOptionCollectionConfusionNet.cpp b/moses/TranslationOptionCollectionConfusionNet.cpp
index d7579f0e4..b344fc14f 100644
--- a/moses/TranslationOptionCollectionConfusionNet.cpp
+++ b/moses/TranslationOptionCollectionConfusionNet.cpp
@@ -20,10 +20,11 @@ namespace Moses
/** constructor; just initialize the base class */
TranslationOptionCollectionConfusionNet::
-TranslationOptionCollectionConfusionNet(const ConfusionNet &input,
+TranslationOptionCollectionConfusionNet(ttasksptr const& ttask,
+ const ConfusionNet &input,
size_t maxNoTransOptPerCoverage,
float translationOptionThreshold)
- : TranslationOptionCollection(input, maxNoTransOptPerCoverage,
+ : TranslationOptionCollection(ttask,input, maxNoTransOptPerCoverage,
translationOptionThreshold)
{
// Prefix checkers are phrase dictionaries that provide a prefix check
@@ -105,7 +106,7 @@ TranslationOptionCollectionConfusionNet(const ConfusionNet &input,
bool OK = prefixCheckers.size() == 0;
for (size_t k = 0; !OK && k < prefixCheckers.size(); ++k)
- OK = prefixCheckers[k]->PrefixExists(subphrase);
+ OK = prefixCheckers[k]->PrefixExists(m_ttask.lock(), subphrase);
if (!OK) continue;
const ScorePair &scores = col[i].second;
@@ -160,8 +161,10 @@ void TranslationOptionCollectionConfusionNet::ProcessUnknownWord(size_t sourcePo
}
}
-
-void TranslationOptionCollectionConfusionNet::CreateTranslationOptions()
+
+void
+TranslationOptionCollectionConfusionNet
+::CreateTranslationOptions()
{
if (!StaticData::Instance().GetUseLegacyPT()) {
GetTargetPhraseCollectionBatch();
@@ -198,8 +201,9 @@ CreateTranslationOptionsForRange(const DecodeGraph &decodeGraph,
bool
TranslationOptionCollectionConfusionNet::
-CreateTranslationOptionsForRangeNew(const DecodeGraph &decodeGraph, size_t startPos,
- size_t endPos, bool adhereTableLimit, size_t graphInd)
+CreateTranslationOptionsForRangeNew
+( const DecodeGraph &decodeGraph, size_t startPos, size_t endPos,
+ bool adhereTableLimit, size_t graphInd)
{
InputPathList &inputPathList = GetInputPathList(startPos, endPos);
if (inputPathList.size() == 0) return false; // no input path matches!