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-10-28 13:26:41 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-10-28 13:26:41 +0300
commit6a2e6feeed434966ba72adc9f26d7b3496070b87 (patch)
treee5d391f97ac84817851f906e85a3eed5a6cd7c97 /moses/ExportInterface.cpp
parent50c109699618ef4372ba78c4e3bf7e788c6a0884 (diff)
Context weights now live in the ContextScope, not any more on TranslationTask.
TargetPhrase now has weak ptr to ContextScope, not to TranslationTask any more, because TargetPhrases can outlive the scope of a Translation Task.
Diffstat (limited to 'moses/ExportInterface.cpp')
-rw-r--r--moses/ExportInterface.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/moses/ExportInterface.cpp b/moses/ExportInterface.cpp
index 53ccbe8f2..2372d5c1c 100644
--- a/moses/ExportInterface.cpp
+++ b/moses/ExportInterface.cpp
@@ -225,12 +225,13 @@ batch_run()
if(!use_sliding_context_window)
cw = NULL;
}
+
if (context_window)
task->SetContextWindow(context_window);
-
- if (context_weights != "")
- task->SetContextWeights(context_weights);
-
+
+ if (context_weights != "" && !task->GetScope()->GetContextWeights())
+ task->GetScope()->SetContextWeights(context_weights);
+
// Allow for (sentence-)context-specific processing prior to
// decoding. This can be used, for example, for context-sensitive
// phrase lookup.