diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-10-28 13:26:41 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-10-28 13:26:41 +0300 |
commit | 6a2e6feeed434966ba72adc9f26d7b3496070b87 (patch) | |
tree | e5d391f97ac84817851f906e85a3eed5a6cd7c97 /moses/ExportInterface.cpp | |
parent | 50c109699618ef4372ba78c4e3bf7e788c6a0884 (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.cpp | 9 |
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. |